fix(acp): forward ATLASSIAN_SA_TOKEN into buzz-dev-mcp env - #7445
Open
aptera-motors-it wants to merge 1 commit into
Open
fix(acp): forward ATLASSIAN_SA_TOKEN into buzz-dev-mcp env#7445aptera-motors-it wants to merge 1 commit into
aptera-motors-it wants to merge 1 commit into
Conversation
Desktop injects the managed-agent token into buzz-acp via descriptor.env, but build_mcp_servers only forwarded BUZZ_RELAY_URL, BUZZ_PRIVATE_KEY, BUZZ_AUTH_TAG, and BUZZ_ACP_DISPLAY_NAME. buzz-agent then env_clear()s and restores spec.env, so shell tools never saw ATLASSIAN_SA_TOKEN. Forward the token the same way as BUZZ_AUTH_TAG: present-and-nonempty only. Do not copy the parent environment. IT-139 Signed-off-by: Aptera Motors IT <80414522+aptera-motors-it@users.noreply.github.com>
🔐 Codex Security Review
|
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
Managed agents get
ATLASSIAN_SA_TOKENin the Desktop definition. Desktop writesdescriptor.envinto thebuzz-acpchild, butbuild_mcp_serversonly forwardedBUZZ_RELAY_URL,BUZZ_PRIVATE_KEY, optionalBUZZ_AUTH_TAG, andBUZZ_ACP_DISPLAY_NAME.buzz-agentthenenv_clear()s and restoresspec.env, sobuzz-dev-mcpshell tools never see the token. A Desktop restart cannot fix this hop.Diagnosed on IT-139 comment 59775. Closest open PR: #4798 (general
BUZZ_ACP_FORWARD_ENVforwarding). That PR still refuses API tokens by design, so it would not close this gap. This change is the narrowBUZZ_AUTH_TAG-shaped allowlist hop, not a parent-env copy.Fix
If
ATLASSIAN_SA_TOKENis present and nonempty in thebuzz-acpprocess, add it to the trusted MCP serverEnvVarlist. Unset/empty omits the key. Unlisted parent secrets are not forwarded.Tests
Four
build_mcp_serverscases bind the production function: set, unset, empty, and an unlisted parent secret that must not leak. Tests restore the previous process value so a real token in the runner is not dropped.cargo test -p buzz-acpat1f0da474(parentee883d73): 909 lib + 9pool_lifecycle_statepassed. Two clap default tests fail in this managed-agent process unlessBUZZ_ACP_LAZY_POOLandBUZZ_ACP_IDLE_POOL_SLEEPare unset; those vars are Desktop launch policy, not this diff. Re-ran the package with those two unset.No deployment or live harness change in this PR. Independent review requested before rebuild/restart.