来源: 分析 #641(PR review)时发现
Problem
tests/launcher.test.ts:1069 — resolveClientCommand: codex/claude resolve to themselves asserts the not-on-PATH fallback:
assert.deepEqual(resolveClientCommand("codex", { PATH: "/usr/bin" }), {
command: "codex",
prefixArgs: [],
});
assert.deepEqual(resolveClientCommand("claude", { PATH: "/usr/bin" }), {
command: "claude",
prefixArgs: [],
});
It hard-codes /usr/bin as a PATH that does NOT contain codex/claude. On any machine where codex or claude is installed in /usr/bin (common for this project's target users — developers who run these CLIs), the test fails:
AssertionError: Expected values to be strictly deep-equal:
{
+ command: '/usr/bin/codex',
- command: 'codex',
}
Impact
npm test is red on any dev machine with codex/claude in /usr/bin (observed: sandbox with /usr/bin/codex installed → 1 failure out of 1252; pre-existing on master, not PR-specific).
- CI stays green (GitHub ubuntu runners don't ship codex/claude), so the breakage is only visible locally.
- No product impact —
resolveOnPath (src/launcher.ts) itself is correct; only the test's environment assumption is wrong.
Suggested fix
Make the test hermetic, following the pattern of the codebuddy tests in #641:
- not-on-PATH case: pass a PATH pointing at an empty temp dir.
- on-PATH case: create a fake
codex/claude executable in a temp bin dir and assert the absolute path is returned.
Minor severity — test hygiene only.
来源: 分析 #641(PR review)时发现
Problem
tests/launcher.test.ts:1069—resolveClientCommand: codex/claude resolve to themselvesasserts the not-on-PATH fallback:It hard-codes
/usr/binas a PATH that does NOT contain codex/claude. On any machine wherecodexorclaudeis installed in/usr/bin(common for this project's target users — developers who run these CLIs), the test fails:Impact
npm testis red on any dev machine with codex/claude in /usr/bin (observed: sandbox with /usr/bin/codex installed → 1 failure out of 1252; pre-existing on master, not PR-specific).resolveOnPath(src/launcher.ts) itself is correct; only the test's environment assumption is wrong.Suggested fix
Make the test hermetic, following the pattern of the codebuddy tests in #641:
codex/claudeexecutable in a temp bin dir and assert the absolute path is returned.Minor severity — test hygiene only.