Repository navigation
strip inherited claude provider routing from local agent launches - #9871
mahiatlinux merged 15 commits into
Conversation
Inherited CLAUDE_CODE_USE_FOUNDRY and related provider routing vars override ANTHROPIC_BASE_URL, so the local Claude subagent silently sends traffic to a remote gateway instead of the Unsloth server.
4162205 to
01c235c
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Confirmed unsloth_cli/commands/start.py:165 still strips only ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN, so an inherited Foundry or Bedrock setup overrides ANTHROPIC_BASE_URL for both the launch path and the subagent bridge. Will get this reviewed. |
Move provider-routing assertions into a focused regression test with explicit selector coverage.
|
Reviewed the routing path against #9864 and Claude Code 2.1.247. The bug is real: Claude evaluates cloud routing selectors and settings before the local Anthropic endpoint in several cases, so inherited configuration can bypass Studio. Confirmed findings and fixes
The fixes are split across ten focused commits. Tests cover direct launches, MCP subagents, Unix sockets, settings precedence, old Claude versions, forwarded arguments, WSL path translation, file permissions, and concurrent sessions. @lonexreb's focused inherited-provider regression coverage from #9907 remains credited in commit Verification
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cff165701d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Convergence update Codex found one P2 on Final verification on the exact PR head merged with current
The upstream Python 3.13 job remains red with the same baseline failures as current |
mahiatlinux
left a comment
There was a problem hiding this comment.
Reviewed through convergence on 16abad94f. Confirmed fixes, focused fork CI, full CPU tests, and live Claude integration all pass.
|
All reviewed and fixed, LGTM. CI results |
Summary
Fixes #9864.
The Claude local-agent child (and
unsloth claude) inherit the parent shell environment and only stripANTHROPIC_API_KEY/CLAUDE_CODE_OAUTH_TOKEN. Claude Code's Foundry, Bedrock, Vertex, AWS, and Mantle routing flags take precedence overANTHROPIC_BASE_URL, so a parent configured for Azure AI Foundry (or similar) silently sends "local" traffic to the remote gateway.This extends
_CLAUDE_ENV_UNSETso those provider-routing variables are dropped before spawn. The same tuple is used by the subagent MCP bridge and the main Claude launch path.Test plan
pytestontest_claude_subagent_mcp.pyand the Claude--no-launch/ launch env-scrub tests (22 passed)