refactor(harness): migrate code agent to env.runner/env.sandbox (ADR 0055)#2760
refactor(harness): migrate code agent to env.runner/env.sandbox (ADR 0055)#2760ralphbean wants to merge 2 commits into
Conversation
PR Summary by QodoRefactor harness: migrate code agent env to env.runner/env.sandbox (ADR 0055)
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
|
🤖 Finished Review · ✅ Success · Started 6:03 PM UTC · Completed 6:18 PM UTC |
Site previewPreview: https://ee04de21-site.fullsend-ai.workers.dev Commit: |
Code Review by Qodo
1.
|
ReviewFindingsMedium
Previous runReviewFindingsMedium
Low
Labels: Refactoring migration PR consistent with sibling ADR 0055 PRs labeled type/chore. Previous run (2)ReviewFindingsMedium
Low
Labels: PR migrates code agent harness config and sandbox env var delivery per ADR 0055. |
|
🤖 Review · ❌ Terminated · Started 6:53 PM UTC · Ended 7:05 PM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · ✅ Success · Started 6:53 PM UTC · Completed 7:05 PM UTC |
…0055) Replace runner_env with env.runner and forge.github.runner_env with forge.github.env.runner in the code agent harness. Move simple passthrough vars (ISSUE_NUMBER, GITHUB_ISSUE_URL, GH_TOKEN, git identity) and hardcoded config (MAX_RETRIES, TIMEOUT_SECONDS, GOPATH, GOMODCACHE) from the host .env file into the harness YAML under env.sandbox. The .env file retains only the GIT_SSL_CAINFO shell conditional that cannot be expressed declaratively. Update scaffold integration tests to handle both runner_env and env.runner schemas. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
The code harness now uses env.runner/env.sandbox instead of runner_env. Update scaffold_test.go assertions to check both legacy RunnerEnv and new Env.Runner fields. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
b876a6a to
f47cb9f
Compare
|
🤖 Finished Review · ✅ Success · Started 7:40 PM UTC · Completed 7:53 PM UTC |
| // produces the expected merged runner_env / env.runner for each scaffold | ||
| // template, with both top-level (platform-neutral) and forge.github | ||
| // (platform-specific) keys present in the final merged state. | ||
| func TestResolveForge_ScaffoldRunnerEnvMerge(t *testing.T) { |
There was a problem hiding this comment.
[medium] test-coverage-gap
TestResolveForge_ScaffoldRunnerEnvMerge validates only runner-side env keys after forge resolution. The diff adds eleven sandbox variables but no test asserts that h.Env.Sandbox contains the expected keys after resolution. A regression in sandbox env merging would go undetected for the code agent.
Suggested fix: Add a sandboxKeys field to the code.yaml test case and assert that h.Env.Sandbox contains the expected keys after forge resolution.
| sandbox: | ||
| ISSUE_NUMBER: "${ISSUE_NUMBER}" | ||
| GITHUB_ISSUE_URL: "${GITHUB_ISSUE_URL}" | ||
| GH_TOKEN: "${GH_TOKEN}" |
There was a problem hiding this comment.
I don't think this is correct. If this gets expanded within the sandbox, there is no GH_TOKEN within the sandbox right? That is why GH_TOKEN was on a file expanded at runner level. Now I'm not sure if other similar PRs to this one are OK. Same for GIT_BOT_EMAIL. I don't think you are testing this locally and you should.
Summary
runner_envwithenv.runner(top-level and forge.github)code-agent.envtoenv.sandboxcode-agent.envtrimmed to just the GIT_SSL_CAINFO shell conditional (can't be expressed in env.sandbox)Phase 2 of ADR 0055 (#2582).
Test plan
go test ./internal/harness/passesgo test ./internal/scaffold/passes🤖 Generated with Claude Code