fix(fm-spawn): forward Anthropic API env vars to crewmate panes for Pioneer/TokenRouter lanes - #1433
Open
jwalin-shah wants to merge 3 commits into
Open
fix(fm-spawn): forward Anthropic API env vars to crewmate panes for Pioneer/TokenRouter lanes#1433jwalin-shah wants to merge 3 commits into
jwalin-shah wants to merge 3 commits into
Conversation
…ioneer/TokenRouter lanes Forward ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, and model discovery env vars (ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL) from firstmate's environment into the crewmate launch command. The pane daemon does not inherit firstmate's environment, so these must be prefixed onto the launch command for the crewmate to authenticate against the correct provider. The existing CLAUDE_CONFIG_DIR forwarding for the claude harness is preserved unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
… env-leak flakiness
…ed in the change itself
5 tasks
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.
Intent
Forward ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, and model discovery env vars (ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL) from firstmate's environment into the crewmate launch command in bin/fm-spawn.sh, so crewmates authenticate against the correct provider for Pioneer/TokenRouter lanes. The existing CLAUDE_CONFIG_DIR forwarding for the claude harness is preserved unchanged.
What Changed
bin/fm-spawn.sh: ForwardANTHROPIC_API_KEY,ANTHROPIC_BASE_URL,ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL, andANTHROPIC_DEFAULT_HAIKU_MODELfrom firstmate's environment into the crewmate launch command, so crewmates authenticate against the correct provider for Pioneer/TokenRouter lanes. Only prepended when the corresponding env var is set; unset values are skipped. The existingCLAUDE_CONFIG_DIRforwarding for the claude harness is preserved unchanged.tests/fm-spawn-dispatch-profile.test.sh: Pin all fiveANTHROPIC_*env vars to empty inrun_spawn()to prevent env-leak flakiness from the developer's shell. Add three new tests covering the forwarding behavior: when vars are set (all harnesses), when vars are unset (no prefix emitted), and verification that forwarding applies to all harnesses, not only claude.Risk Assessment
✅ Low: Change is well-bounded, follows existing patterns, has good test coverage, and fully conforms to the stated user intent.
Testing
Ran the full fm-spawn-dispatch-profile test suite (28 tests). All passed, including the 3 new tests for ANTHROPIC_* env var forwarding (set, unset, and all-harnesses cases) and the 3 existing CLAUDE_CONFIG_DIR tests confirming the existing behavior is preserved. The evidence file is at /var/folders/sj/b3pb98ls4mx03dx50srzyq380000gn/T/no-mistakes-evidence/01KYX34J92A4GH76FWE1M1HTAB/fm-spawn-dispatch-profile-test-output.txt.
Evidence: Full test suite run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-spawn-dispatch-profile.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.