Repository navigation
Conversation
`spawnRun({ shell: true })` runs the CLI's `listen --run` command line.
A command that got going and exited 1 must be a failed run with exit 1;
one the shell cannot find (sh 127, cmd.exe 9009, nothing on stdout) is
not started. Expected to fail on Windows until spawnRun stops routing
shell runs through cross-spawn, whose Windows hook turns every exit 1
of a shell spawn into a `spawn … ENOENT` error.
Shell runs (the CLI's `listen --run` command line) went through cross-spawn. With `shell: true` cross-spawn resolves nothing, but its Windows hook still re-emits every exit 1 as `spawn <command> ENOENT`: a command that ran and failed with 1 became `not_started`, said to be missing, and was never a could-not-process failure. Shell runs now use Node's own spawn and keep the exit code; the existing rule tells a command cmd.exe cannot find (exit 1, nothing on stdout: not started) from one that ran and failed (exit 1 after output: failed). Direct runs keep cross-spawn for PATHEXT and .cmd shim resolution. The test's Windows exit code for a command not found is 1, as the previous commit's CI run on Windows showed (cmd.exe /c exits 1).
sanctrl
added a commit
to agentchatme/agentchat-cli
that referenced
this pull request
Nov 20, 2026
…er outlives its test Windows CI failed the two could-not-process e2e tests: every run of the stand-in command that exited 1 came back `not_started` with `spawn "<command>" ENOENT`, so no failure was ever reported. The cause is the engine's spawnRun: shell runs go through cross-spawn, whose Windows hook re-emits every exit 1 of a shell spawn as ENOENT. Fixed in agent-core (agentchatme/agentchat-agent-core#28); the CLI picks it up with the engine pin at the release step. - A CommandRunner test pins the contract directly: a command that ran and exited 1 is `failed` with exit 1, never "not found". - The e2e tests stop every listener and watcher they started in afterEach (bounded at twice the engine's 10 s stop grace), so a test that fails before its own abort no longer leaves a listener running into the next test and spawning from a folder that is gone.
Contributor
Author
sanctrl
added a commit
to agentchatme/agentchat-cli
that referenced
this pull request
Nov 20, 2026
…t-core 0.7.1, manual 2.4.0 (#16) * feat(listen): one run per conversation, and could not process With served texts that carry the per-conversation prompt, the engine's receive loop starts one run per conversation that owes a reply (and one for pending invites). The listener wires its runners into that: - the --run command's environment comes from the engine's run context (runContextEnv): AGENTCHAT_WAKE_KIND can be `conversation`, a conversation run gets AGENTCHAT_CONVERSATION_ID, and every other run never inherits one; - forward keeps one POST per wake (conversationRuns: false), its receiver reading the whole tray itself; the foreground and the installed listener take their loop options from one place (listenerRunOptions); - a --run command has no runtime check, so a failed conversation run is reported only with other_run_completed evidence; the presets have the engine's runtime check; - status and doctor show the engine's could-not-process lines. listen, --help, README and CHANGELOG say how a wake becomes runs and what could not process means for the owner. Builds against the unreleased agent-core and agentchatme that add conversation runs; the pins move at the release step. * test: the presets' runtime check on the engine's JSON result; uninstall removes the ledger The engine's Claude Code runtime check now asks for `--output-format json` and judges the result object; the fake runtimes answer one when it is asked for. With the engine's updated clearIntegrationStatus, `listen --uninstall` removes could-not-process.json too: README, CHANGELOG and the service comment say so, and the uninstall test checks it. * release: 0.4.0 — one run per conversation and could-not-process; agent-core 0.7.0, manual 2.4.0 * docs: upgrading a --run script from 0.3.0 (one run per conversation, AGENTCHAT_CONVERSATION_ID); drop the stale pin note * test(listen): a --run command that exits 1 is a failed run; no listener outlives its test Windows CI failed the two could-not-process e2e tests: every run of the stand-in command that exited 1 came back `not_started` with `spawn "<command>" ENOENT`, so no failure was ever reported. The cause is the engine's spawnRun: shell runs go through cross-spawn, whose Windows hook re-emits every exit 1 of a shell spawn as ENOENT. Fixed in agent-core (agentchatme/agentchat-agent-core#28); the CLI picks it up with the engine pin at the release step. - A CommandRunner test pins the contract directly: a command that ran and exited 1 is `failed` with exit 1, never "not found". - The e2e tests stop every listener and watcher they started in afterEach (bounded at twice the engine's 10 s stop grace), so a test that fails before its own abort no longer leaves a listener running into the next test and spawning from a folder that is gone. * release: 0.4.0 — agent-core 0.7.1 (Windows --run exit codes, runtime check), agentchatme ^1.5.0; fake runtimes answer with a finished turn
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.
What changes
On Windows,
spawnRun({ shell: true })reported every command line that exited with code 1 asnot_startedwithspawn "<command>" ENOENT, as if the command did not exist. The CLI'sagentchat listen --run "<command>"is the one caller: a Windows owner's command that got going and then failed with exit 1 (a provider refusal, a crash) was said to be missing, and its failure was never a could-not-process failure.Cause:
spawnRunspawns through cross-spawn. Withshell: true, cross-spawn passes the call straight tochild_process.spawnand resolves nothing (parse()returns beforeparseNonShell, soparsed.filestays unset), but it still installs its Windows hook (lib/enoent.js,verifyENOENT): anexitwith status 1 and no resolved file is re-emitted as anerrorENOENT. For a shell spawn that is every exit 1:cmd.exe /cexits 1 both for a command it cannot find and for a command that ran and failed with 1, so a failed run read as "not found".Fix: shell runs use Node's
child_process.spawndirectly (identical forshell: true, minus the hook) and keep the exit code; the existing rule tells the two apart as on every platform: a non-zero exit with nothing on stdout isnot_started, one after output isfailed. Direct runs keep cross-spawn for PATHEXT and.cmdshim resolution. CHANGELOG (Unreleased); no version bump.Commit 1 is the test alone, so the Windows job shows the failure before the fix.
Verification
pnpm type-check,pnpm buildok,pnpm test39 files, 631 passed, 3 skipped. CI on commit 1 (26a803a, the tests alone): Windows failed exactly as reported: exit 1 after output came backnot_started(ENOENT), the not-found case had exit codenull(the hook's error), while exit 2 wasfailed; Linux and macOS passed. CI on commit 2 (8d784e4, the fix): Linux, macOS and Windows all green. The CLI's tests on Windows against this engine (packed and vendored in throwaway draft [do not merge] CI proof: CLI on Windows with the agent-core#28 shell-run fix agentchat-cli#17): green.Risk and rollback
Shell runs only (the CLI's
--run); preset and integration runs are not shell runs and keep cross-spawn. Rollback: revert.