fix test_named_agents by writing fake agent PATH to shell RC file#93
Open
trentdavies wants to merge 1 commit intoraine:mainfrom
Open
fix test_named_agents by writing fake agent PATH to shell RC file#93trentdavies wants to merge 1 commit intoraine:mainfrom
trentdavies wants to merge 1 commit intoraine:mainfrom
Conversation
New tmux panes start a fresh shell that sources .zshrc/.bashrc, so fake agent binaries must be on PATH there — not just in the tmux global environment. Matches the pattern used by test_agents.py. Co-Authored-By: Claude Opus 4.6 (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.
Fix test_named_agents failures
The two
TestKnownAgentAutoDetectiontests intest_named_agents.pyfail on machines that have Claude Code installed because the realclaudebinary runs instead of the fake test script.Root cause
New tmux panes start a fresh shell that sources
.zshrc/.bashrc. The fake agent binary was only added to PATH viatmux set-environment -gand the subprocess environment, but new pane shells don't inherit from either — they get PATH from their shell profile.The passing tests in
test_agents.pyalready handle this correctly by writing the fake PATH into a shell RC file.test_named_agents.pywas missing this step, so I implemented it sojust teston Mac succeeds.Fix
Added
_write_rc_with_fake_path()helper that writesexport PATH="<fake-bin-dir>:$PATH"to the shell RC file, so new tmux panes find the fake agent binary first. Matches the existing pattern intest_agents.py.Test plan
pytest tests/test_workmux_add/test_named_agents.py— both tests passjust test— 328/328 pass, 0 failures