Repository navigation
fix(agents): let tools the agent runs reach its model credentials - #132
Merged
Merged
Conversation
buzz-agent-review failed for every agent whose profile uses a Claude subscription or a Codex access token: both runtimes reported "not logged in". The image's contract is that model credentials stay env-only and that tools the agent runs inherit them, but the agent's tool shell (the MCP server) starts from a cleared environment that never included them. buzz-acp now forwards the variables named in BUZZ_ACP_MCP_FORWARD_ENV into the MCP server. Unset forwards nothing, so the default is unchanged; invalid names and the harness's own variables are ignored. The Voltage bootstrap sets it to exactly the model credentials it configured. Nothing is written to disk: the profile test's no-token-in-files check still holds and now also checks the forwarded list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tee8z <tee8z@protonmail.com>
|
Warning Review limit reached
This review includes 5 billable files and costs up to $1.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 32 minutes for your next included review. View limit details
|
thebrandonlucas
approved these changes
Nov 5, 2026
tee8z
marked this pull request as ready for review
November 5, 2026 16:50
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
buzz-agent-reviewfails in every staging Sandbox whose profile uses a Claude subscription token or a Codex access token. Brokkr hit it today on DEV-2868 and fell back to in-session reviews. Reproduced in Brokkr's pod:claude -preportsNot logged in · Please run /login~/.codex/auth.jsonto copyThe cause is the environment. The harness holds
CLAUDE_CODE_OAUTH_TOKENandCODEX_ACCESS_TOKEN, but the agent's tool shell (buzz-dev-mcp, launched by the ACP adapter) starts from a cleared environment that lists only git config,BUZZ_PRIVATE_KEY, the relay URL, and similar. Only the API-key Codex path worked, becausecodex loginwritesauth.json.The image README already promises the opposite: "Model credentials stay in the harness environment and are never written to workspace files. Tools that the agent runs inherit them." The first half is enforced by
test-profile.py. This PR makes the second half true without breaking the first.Fix
buzz-acp: forwards the harness variables named inBUZZ_ACP_MCP_FORWARD_ENV(comma-separated) into the MCP server.BUZZ_PRIVATE_KEYand so on) are ignored; unset or empty values are skipped.profile.py): sets it to exactly the model credentials it configured (INHERITED_MODEL_VARIABLESthat are set, plusCODEX_HOME).crates/buzz-acp/README.mdenv table, and the image README.Security notes
/home/agentfor the subscription and access tokens./proc/<pid>/environ(same UID), so this documents rather than widens what tools can reach.via. That's stronger isolation, but it needs an admin-created key, so it's a possible follow-up.Validation
New
listed_harness_variables_reach_the_tool_shell_and_nothing_elsedrives the realbuild_mcp_servers:BUZZ_PRIVATE_KEYis never overriddenIt uses synthetic variable names, so no test process sees fake model credentials. It fails with the forwarding line removed.
test-profile.py(image CI) checks the forwarded list is exactly the profile's model credentials.buzz-acp: 1125 passed, run three times; clippy
-D warningsand fmt are clean. Image tests run in CI.To confirm live after rollout: run
buzz-agent-review --runtime claudeand--runtime codexfrom an agent shell; both should return a verdict.🤖 Generated with Claude Code