herd spawn / agent start: default --account to the caller's cswap account (RT-237) - #367
Merged
Merged
Conversation
A shepherd under cswap run sets CLAUDE_CONFIG_DIR, but the daemon launches a bare claude that falls back to the global default profile, so workers could land on a different account. The CLI now resolves the caller's active account and passes it when --account is omitted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Same gap as herd spawn: a cswap run caller's plain agent start landed on the global default profile. Codex launches, by flag or agent.provider, are left alone since codex rejects --account. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 45 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 80 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Comment |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
A shepherd running under
cswap run NhasCLAUDE_CONFIG_DIRpointing at that account's session profile.rt herd spawn(andrt agent start) with no--accountsent nothing to the daemon, which launched a bareclaudeon the global default profile. When the default profile is a different account, every worker silently ran as that account.Fix
callerCswapAccount(lib/cswap.ts): whenCLAUDE_CONFIG_DIRis set, runscswap list --jsonin the caller's env and returns the active account's email.rt herd spawnfills a missing--accountfrom it.rt agent startdoes the same for claude launches only; codex (by flag oragent.provider) is untouched since it rejects--account.agent.claude.accountstill applies there.--accountalways wins.Verification
lib/__tests__/cswap.test.ts,lib/__tests__/herd-cli.test.ts,commands/__tests__/agent.test.ts.e2e/tests/herd.test.tsande2e/tests/agent.test.tsgreen.🤖 Generated with Claude Code