Skip to content

release: 0.4.0 — one run per conversation and could-not-process; agent-core 0.7.1, manual 2.4.0 - #16

Merged
sanctrl merged 6 commits into
mainfrom
feat/could-not-process
Nov 20, 2026
Merged

sanctrl merged 6 commits into
mainfrom
feat/could-not-process

Conversation

@sanctrl

@sanctrl sanctrl commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What changes

The listener's side of one run per conversation and could not process, on the engine from agentchatme/agentchat-agent-core#27 (released as 0.7.0) and agentchatme 1.5.0 (agentchatme/agentchat-typescript#31).

  • One run per conversation. With served texts that carry the per-conversation prompt, listen --run and listen --preset start one run for each conversation that owes a reply (one at a time) and one run for pending invites, instead of one run for the whole tray. A server without that prompt still gets one run for the tray.
  • The custom command is told its conversation. The --run command's environment now comes from the engine's runContextEnv: AGENTCHAT_WAKE_KIND is conversation, invite or wake; a conversation run also gets AGENTCHAT_CONVERSATION_ID; every other run never inherits one (an inherited value is removed). RUN_ENV.conversationId names it.
  • forward keeps one POST per wake (conversationRuns: false): its receiver reads the whole tray itself. The foreground and the installed listener now take their loop options from one function (listenerRunOptions), so the two cannot drift.
  • Could not process. A --run command has no runtime check, so its failed conversation run is reported only with other_run_completed evidence (within 10 minutes), and never while every run fails; the presets use the engine's runtime check (runtime_check); forward reports nothing. Documented in the README and in command-runner.ts.
  • status and doctor show the engine's could-not-process lines (the CLI's identity commands are the engine's): the paused conversations and until when, the counts, the last run's conversation, and doctor's could-not-process warning.
  • listen --uninstall now also removes could-not-process.json (the engine's updated clearIntegrationStatus); README, CHANGELOG and the uninstall test say so.
  • listen, listen --install, --help and watch say how a wake becomes runs. README (a Could not process section, the env table) and CHANGELOG (Unreleased).
  • No version bump; the pins move at the release step.

Windows: needs the engine with agentchatme/agentchat-agent-core#28. The branch pins agent-core 0.7.0 (release commit 43b13f8). On Windows that engine reports every --run command line that exits 1 as not_started with spawn "<command>" ENOENT: spawnRun({ shell: true }) goes through cross-spawn, whose Windows hook (lib/enoent.js, verifyENOENT) re-emits any exit 1 of a shell spawn, where it resolved no file, as an ENOENT error. cmd.exe /c exits 1 both for a command it cannot find and for a command that ran and failed, and the hook assumes the first. So a Windows owner's command that failed with 1 was said to be missing and never counted as a could-not-process failure. This bug was already there before this PR (a failing --run command on Windows was always shown as "not found"); this PR's tests are the first to run a failing --run command on Windows. It is not a rewrite or unlink of the stand-in script (the same file ran fine for the other conversation), not a run after the temp dir went, and not the CLI's quoting (exit 2 from the same command line is classified correctly). The fix is in the engine (#28: shell runs use Node's own spawn and keep the exit code; the stdout rule tells "not found" from "ran and failed"), so the CLI's src/ does not change. Windows CI here stays red until the pin moves to an engine with #28, which should be 0.7.1 at the release step.

Verification

  • Tests: Windows: on the 0.7.0 pin the Windows job fails exactly on the exit-1 cases (run 44654674345 on 88fa768): the new CommandRunner test (exit 1 after output must be failed) and the two could-not-process e2e tests, all with spawn … ENOENT. With the #28 engine packed and vendored in throwaway draft [do not merge] CI proof: CLI on Windows with the agent-core#28 shell-run fix #17 (closed after the run), Windows passed on three attempts in a row (jobs 136018625739, 136020681738, 136022395791; each runs the suite on Node 22, 24 and 26: 109 passed, 4 skipped, no ENOENT). On Linux and macOS, 0.7.0 is green. #28's own CI: Windows fails on the tests-only commit and passes with the fix.
    Earlier, with the linked engine (c7e1f1a) and SDK (1.5.0): pnpm type-check ok, pnpm build ok, pnpm test 8 files, 111 passed, 1 skipped (112), bash scripts/release-smoke.sh ok, gitleaks on the commits: no leaks. New end-to-end tests against the server double: one run per conversation (each told AGENTCHAT_CONVERSATION_ID, prompted for that conversation alone, the invite run without one, an inherited id never reaching a run); a command failing for one conversation reported with other_run_completed; every run failing reports nothing; a paused answer said in the status file; forward with the template still one POST per wake carrying both conversations (checked to fail with conversationRuns: true); both presets' runtime check as evidence (fixed prompt, no AgentChat tools, no key; the fake Claude Code answers the JSON result the engine's check now judges). Unit tests for commandRunEnv, listenerRunOptions and a --run command that exits 1 (failed, never "not found"); the e2e tests now stop every listener they started in afterEach, so a failing test no longer leaves one running into the next; status/doctor lines from a status file. The engine PR head's own suite against the SDK PR head: 39 files, 618 passed, 3 skipped.
  • Review: self-review of the diff only; no independent review yet.
  • Live check: n/a until release: lab live-fire after the engine and CLI releases; Windows CI red until the engine pin includes #28.

Risk and rollback

  • A --run command that relied on one run per wake for the whole tray now runs once per conversation; its prompt and AGENTCHAT_WAKE_KIND say which. A server without the per-conversation prompt keeps the old behaviour.
  • Windows --run users: a command that exits 1 is shown as "not found" until the CLI bundles an engine with #28.
  • Rollback: revert this PR and keep the engine pin at 0.6.0.

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.
…ll 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.
@sanctrl
sanctrl marked this pull request as ready for review November 20, 2026 00:57
@sanctrl sanctrl changed the title One run per conversation, and could not process (CLI listener) release: 0.4.0 — one run per conversation and could-not-process; agent-core 0.7.0, manual 2.4.0 Nov 20, 2026
@sanctrl
sanctrl enabled auto-merge (squash) November 20, 2026 00:57
…AGENTCHAT_CONVERSATION_ID); drop the stale pin note
@sanctrl
sanctrl disabled auto-merge November 20, 2026 01:23
…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.
…check), agentchatme ^1.5.0; fake runtimes answer with a finished turn
@sanctrl sanctrl changed the title release: 0.4.0 — one run per conversation and could-not-process; agent-core 0.7.0, manual 2.4.0 release: 0.4.0 — one run per conversation and could-not-process; agent-core 0.7.1, manual 2.4.0 Nov 20, 2026
@sanctrl
sanctrl enabled auto-merge (squash) November 20, 2026 10:20
@sanctrl
sanctrl merged commit 7846da2 into main Nov 20, 2026
5 of 6 checks passed
@sanctrl
sanctrl deleted the feat/could-not-process branch November 20, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant