test(server): run fake provider CLIs through a Node stub on every host - #9567
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
339ef03 to
e439d44
Compare
9d13453 to
c1ae303
Compare
c1ae303 to
78bde4a
Compare
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The changes are confined to cross-platform test fixtures and test utilities, with no product-runtime or default-setting impact. Human review is required because the PR adds file-level and line-level directives that suppress static-analysis diagnostics. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
2a88601 to
7e2a578
Compare
7e2a578 to
8f60545
Compare
Seven suites faked a provider CLI with a #!/bin/sh script made executable by chmod, which Windows cannot run: the shebang is ignored and there is no extension for PATHEXT to match, so the spawn either failed or fell through to a real CLI on PATH. CodexTextGeneration's fake was a 120-line sh argument parser. Add apps/server/src/testUtils/fakeCli.ts. writeFakeCli writes the CLI's behaviour as a Node stub and a launcher shaped for the host: a shebang script on posix, a .cmd shim on Windows, which resolveSpawnCommand already routes through a shell. execScriptSource covers the common case of handing over to the mock ACP agent after an argv check. ClaudeTextGeneration, which had its own .cmd branch, moves onto the shared helper too. The tests that assert the agent logged SIGTERM on stop are skipped on Windows, where the child is terminated rather than signalled. Co-Authored-By: Claude Code <noreply@anthropic.com>
8f60545 to
b4e082c
Compare
Seven suites faked a provider CLI with a #!/bin/sh script made executable
by chmod, which Windows cannot run: the shebang is ignored and there is no
extension for PATHEXT to match, so the spawn either failed or fell through
to a real CLI on PATH. CodexTextGeneration's fake was a 120-line sh
argument parser.
Add apps/server/src/testUtils/fakeCli.ts. writeFakeCli writes the CLI's
behaviour as a Node stub and a launcher shaped for the host: a shebang
script on posix, a .cmd shim on Windows, which resolveSpawnCommand already
routes through a shell. execScriptSource covers the common case of handing
over to the mock ACP agent after an argv check. ClaudeTextGeneration, which
had its own .cmd branch, moves onto the shared helper too.
The tests that assert the agent logged SIGTERM on stop are skipped on
Windows, where the child is terminated rather than signalled.
Part of the Windows test-suite stack rooted at #9564; the manual Windows lane comes from #9538.
Model: Claude Fable 5 in Claude Code.
🤖 Generated with Claude Code
Note
Run fake provider CLI fixtures through a shared Node stub on Windows and POSIX hosts
writeFakeCliutility in fakeCli.ts that emits a Node stub module plus a platform-appropriate launcher (POSIX shell or Windows.cmd), replacing per-test shell-script generation across provider and text-generation test suitesCursorAdapter,CursorProvider,GrokAdapter,GrokProvider,CodexTextGeneration,CursorTextGeneration,GrokTextGeneration, andClaudeTextGenerationtests to build their fake agent binaries through the shared writer.cmdwrapper for the Codex collaboration mock peer and selects it onwin32in the integration test; adds.cmd/.batCRLF checkout rules in .gitattributeswin32skip condition inCursorAdapter,CursorProvider,GrokAdapter,CursorTextGeneration, andCodexCollabRuntimetests, since Windows terminates processes without delivering SIGTERMwriteFakeCliwriter is the single path for fake CLI creation; any mismatch between the generated Node stub contract and an individual test's expectations (e.g. argument validation inexecScriptSource) will surface as fixture failures across all refactored suitesMacroscope summarized b4e082c.
Note
Low Risk
Changes are limited to test fixtures, git attributes, and conditional test skips; no production provider or spawn logic is modified.
Overview
Provider and text-generation tests no longer build fake CLIs with hand-written
#!/bin/shwrappers (and chmod), which fail or hit the real binary on Windows. They now go throughwriteFakeCliinapps/server/src/testUtils/fakeCli.ts, which writes a Node stub plus a host-specific launcher (POSIX shell script or.cmdshim), with env applied via a JSON sidecar.execScriptSourcecovers the common “validate argv, then import the mock ACP agent” pattern; Codex’s large shell-based fake is reimplemented in Node the same way.Codex collab integration picks
codexCollabMockPeer.cmdonwin32(new file);.gitattributesforces CRLF for*.cmd/*.bat.Tests that assert SIGTERM in an exit log are
skipIfon Windows, where children are killed without that signal. Production spawn paths are unchanged—this is test/fixture plumbing for the Windows test suite.Reviewed by Cursor Bugbot for commit b4e082c. Bugbot is set up for automated code reviews on this repo. Configure here.