Skip to content

feat: report ACP v2 background work and cancel individual terminals - #777

Merged
benbrandt merged 2 commits into
mainfrom
feat/v2-background-work
Nov 19, 2026
Merged

benbrandt merged 2 commits into
mainfrom
feat/v2-background-work

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

  • Report detached child sessions and live background terminals in ACP v2 state_update.background. Resume reannounces listed entities before the current-state snapshot. session/cancel leaves listed work and its pending interactions alone; session/close still stops it. An explicitly waited-on child is foreground work while the wait is pending.
  • Implement terminal/cancel for independently stoppable background processes. Resolve the process handle from the terminal and its owning ACP session, not from the client. Announce the exit and clear the terminal's cancel capability before removing it from the list. Cancelling a terminal does not interrupt the turn or stop any other terminal. Codex's process inventory includes foreground commands, so discovery waits until a process has outlived its turn.
  • Map an explicit empty Codex checklist to an empty items update followed by plan_removed on v2. Keep the existing empty checklist update on v1, including AIR. Do not infer removal from turn completion or apply it to Markdown plans.

AIR retains its private subagent routing and _session/async_task/stop. On v2, standard terminal reporting and cancellation coexist with the private extension. The shared inventory now survives a same-connection resume, so current standard terminals are re-announced without re-sending private spawn events for already-known tasks.

Session cursors and generic tool_call/cancel are out of scope. Codex does not expose an independent stop operation for arbitrary model tool calls.

Verification

  • npm test: 2,563 passed, 39 skipped, including AIR golden snapshots and a v1 AIR checklist-clear test.
  • npm run test:integration: 23 passed. The real Codex background test starts two processes, resumes the session, cancels one terminal during an unrelated foreground turn, cancels the turn without stopping the other process, and then closes the session.
  • npm run typecheck, npm run build, all six npm run bundle:all targets, and git diff --check passed.
  • Live no-tool Codex smoke prompt completed with end_turn. The opt-in live-model E2E suite and the JetBrains client itself were not run.

Comment thread src/ACPSessionConnection.ts Fixed
@benbrandt
benbrandt merged commit 74dffa0 into main Nov 19, 2026
6 checks passed
@benbrandt
benbrandt deleted the feat/v2-background-work branch November 19, 2026 09:06
benbrandt pushed a commit that referenced this pull request Nov 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.8.0](v2.7.0...v2.8.0)
(2026-11-19)


### Features

* report ACP v2 background work and cancel individual terminals
([#777](#777))
([74dffa0](74dffa0))
* support MCP-over-ACP in the Codex adapter
([#771](#771))
([b9503ae](b9503ae))


### Bug Fixes

* align adapter with ACP SDK 2.7 and current protocol rules
([#769](#769))
([887aab6](887aab6))
* align adapter with ACP SDK 2.8 and current protocol rules
([#775](#775))
([0a17129](0a17129))
* avoid stack overflow when snapshotting deeply nested JSON
([#742](#742))
([06425cc](06425cc))
* put model settings first in session config options
([#778](#778))
([3645fab](3645fab))
* update codex to 0.170.0
([#780](#780))
([77b12a1](77b12a1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
nyssance added a commit to nyssance/codex-acp that referenced this pull request Nov 19, 2026
…ings first

Upstream since agentclientprotocol#771: ACP SDK 2.8 alignment (agentclientprotocol#775), v2 background work and
terminal cancellation (agentclientprotocol#777), model settings first in config options (agentclientprotocol#778),
the deeply nested JSON snapshot fix (agentclientprotocol#742), Codex 0.170.0 (agentclientprotocol#780).

Kept from this adapter:
- An ordinary v2 prompt during a running turn is still steered into it. A
  keyed prompt takes upstream's derived message ID and shared receipt and is
  steered once; a prompt cannot set both an idempotencyKey and
  _meta.alwith.messageId.
- Child interruption still goes through requestTurnInterrupt and its retry.
  It now reports whether the turn stopped, so a v2 close can require it.
- The generated app-server types (--experimental), the image and audio input
  mapping, the gateway-aware model provider, typed turn failures.

Taken from upstream:
- A v2 session/cancel stops the foreground and leaves children listed as
  background work running until they are cancelled themselves or the session
  closes. The parent-cancellation test follows that rule on v2.
- Upstream's field order in shared test fixtures.

The deep-nesting snapshot test gets a longer timeout: Bun serializes values
about ten times deeper than Node before its stack runs out.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RaizxxJBbHnYoG9L4g1u5b
mrmans0n added a commit to mrmans0n/codex-acp that referenced this pull request Nov 19, 2026
Upstream v2.8.0 (agentclientprotocol#775) renames the initialize-v2 test that follows
95fb2c8's v2 test to "still routes a v1 initialize to the v1 chain", so the
pick conflicted on that context line only. The adaptation keeps the patch's
test before upstream's renamed test; its sorted added and removed lines
are identical to 95fb2c8 (originally
a680425).

Upstream v2.8.0 does not change AgentFileChangeReport, the event handler's
turn diff collection or the composed AIR publication. agentclientprotocol#775 only drops
emitted tool-call diffs without any change and agentclientprotocol#777 only adds terminal
tracking to command items, so the ACP v1 _meta.agentFileChangeReport keeps
its contract.
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