fix(supervisor): preserve Bedrock and Vertex skip-auth flags in SDK env (closes #3053)#3060
Open
rodboev wants to merge 3 commits into
Open
fix(supervisor): preserve Bedrock and Vertex skip-auth flags in SDK env (closes #3053)#3060rodboev wants to merge 3 commits into
rodboev wants to merge 3 commits into
Conversation
Contributor
Greptile SummaryThis PR preserves Bedrock and Vertex skip-auth flags when launching sanitized SDK subprocess environments. The main changes are:
Confidence Score: 5/5The sanitizer change is narrow and covered across both source and packaged runtime surfaces. The updated allowlist preserves only the two missing skip-auth flags while keeping the existing prefix filtering behavior intact, with focused tests covering the helper and shipped bundles.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(mcp): preserve skip-auth env flags d..." | Re-trigger Greptile |
|
great to have you |
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.
Summary
sanitizeEnv()preservesCLAUDE_CODE_USE_BEDROCKandCLAUDE_CODE_USE_VERTEX, but it strips the pairedCLAUDE_CODE_SKIP_BEDROCK_AUTHandCLAUDE_CODE_SKIP_VERTEX_AUTHflags before the SDK subprocess launches. That leaves bearer-auth gateway routes on the Bedrock or Vertex code path without the explicit skip-auth override, which matches the reported hangs and401 Unauthorizedfailures.This change adds the two missing skip-auth flags to the supervisor allowlist, regenerates the shipped worker, server-beta, and MCP bundles that embed that preserve set, and covers both the source helper and the packaged runtime surfaces with focused sanitizer regressions. The subprocess launch flow stays unchanged; only the env contract is corrected.
Why
ENV_PRESERVEinsrc/supervisor/env-sanitizer.tsis the authoritative allowlist forCLAUDE_CODE_*vars that survive sanitization. The exact-match check preservesCLAUDE_CODE_USE_BEDROCKandCLAUDE_CODE_USE_VERTEX, then the prefix filter drops every remainingCLAUDE_CODE_*var, including the omittedCLAUDE_CODE_SKIP_*_AUTHflags.ClaudeProviderbuilds the SDK subprocess env withsanitizeEnv(await buildIsolatedEnvWithFreshOAuth()), so the omission is what reaches the child process. The same preserve set is also baked into the shippedworker-service.cjs,server-beta-service.cjs, andmcp-server.cjsbundles that installed users actually execute. Adding the two missing keys and regenerating those bundles fixes the auth-mode mismatch without widening the rest of the prefix filter.Scope
EnvManager.tsor any subprocess launch site logic.Verification
bun test tests/supervisor/env-sanitizer.test.ts- 14 passing, including shipped-bundle coverage for worker, server-beta, and MCP runtime bundlesnpm run build- bundle within guardrailnpm run lint:hook-io && npm run lint:spawn-env- cleannpm run strip-comments:check- current upstream baseline still reports 329 would-change files, including the pre-existing narrative comment block insrc/supervisor/env-sanitizer.tsorigin/mainthrowaway checkout and confirmed the new skip-auth assertions fail on base but pass on this branchCloses #3053