Skip to content

fix: align adapter with ACP SDK 2.8 and current protocol rules - #775

Merged
benbrandt merged 1 commit into
mainfrom
fix/acp-sdk-2.8-compat
Nov 18, 2026
Merged

benbrandt merged 1 commit into
mainfrom
fix/acp-sdk-2.8-compat

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

Update @agentclientprotocol/sdk from 2.7.0 to 2.8.0 (ACP schemas v1.33.0 and v2.0.0-alpha.17) and align existing adapter behavior with the full protocol diff since the previous schema release, including the later v2 documentation clarifications.

  • Implement v2 session/prompt idempotency. Concurrent retries share one insertion outcome. A session-scoped derived message ID lets the adapter recover retained receipts from Codex history after a restart without storing the raw key. The integration test verifies no duplicate model call after restart and no key inheritance across forks.
  • Prime each chunked replay field before appending. Keep recorded child outcomes on historical parent subagent_update notifications, not live child completions. Reject restricted child requests with -32602 in both versions.
  • Publish the current state of a non-idle new v2 session after the response. Stop waiting for abandoned foreground elicitations, omit string pattern on v2 forms, prevent tool-call status regressions, and check that emitted diffs have at least one change.
  • Reject unsupported fork cursors instead of doing a full fork. Use the v2 request fallback to return -32601 for unimplemented methods: published SDK 2.8.0 otherwise returns -32602 for unimplemented tool and terminal cancellation. This PR does not depend on an unpublished SDK fix.

Session cursor issuance, standard background reporting and per-item cancel controls, and plan removal are intentionally out of scope.

Verification

  • npm run typecheck, npm run build, and all six targets via npm run bundle:all
  • npm test: 2,550 passed, 39 skipped
  • npm run test:integration: 22 passed, including real Codex against a local mock model endpoint for the restart and retry test
  • Live no-tool Codex smoke prompt completed with end_turn. The opt-in live-model E2E suite was not run.
  • git diff --check

@benbrandt
benbrandt merged commit 0a17129 into main Nov 18, 2026
6 checks passed
@benbrandt
benbrandt deleted the fix/acp-sdk-2.8-compat branch November 18, 2026 15:47
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 changed four places next to 904a70d's lines:
- agentclientprotocol#775 rejects a fork at a session cursor at the top of forkSession, where
  the patch maps the ACP v1 _meta.systemPrompt.append alias. The cursor
  check stays first; the alias mapping follows it unchanged.
- agentclientprotocol#778 puts the model options first in session configOptions and notes it
  in the scenario baseline comment and in docs/air-extensions.md, next to
  the patch's notes on the opt-in system prompt append capability. Both
  notes are kept.
- agentclientprotocol#771 (MCP-over-ACP) rewrites the README line after the patch's system
  prompt append line. Both lines are kept.
- agentclientprotocol#742 replaces JsonSnapshot's recursive walk with an explicit container
  stack, so the snapshot walk no longer uses call stack per level. The
  patch's MAX_DEPTH 64 headroom for native JSON.stringify existed only
  because of that recursion. On darwin-arm64 (Node 26), upstream's new
  test (the deepest value JSON.stringify accepts) fails with a
  RangeError on the v2.7.0 recursive walk both at 256 and with the
  downstream 64, and passes on agentclientprotocol#742's walk at 256. The adaptation drops
  that hunk and follows upstream's MAX_DEPTH 256.

Apart from the dropped JsonSnapshot hunk (one removed and three added
lines), the sorted added and removed lines are identical to
904a70d (originally fc0eb68). Upstream
v2.8.0 does not change the systemPrompt conversion that the alias feeds;
newSessionV2, resumeSessionV2 and forkSessionV2 only drop configOptions.
mrmans0n added a commit to mrmans0n/codex-acp that referenced this pull request Nov 19, 2026
Upstream v2.8.0 (agentclientprotocol#780) updates Codex to 0.170.0, whose regenerated
GetAccountResponse requires `userId`; upstream updated every getAccount
mock in its tests to `{account: null, userId: null, ...}`. fdcc23c replays
cleanly, but its fork point test in session-fork.test.ts still mocks
getAccount without `userId`, so `npm run typecheck` fails (TS2741) on the
candidate. The adaptation adds `userId: null` to that mock, like upstream's
other fork tests. Every other added and removed line is identical to
fdcc23c (originally fc9a61e).

Upstream's fork changes in v2.8.0 do not touch the fork point contract:
agentclientprotocol#775 rejects a fork at an ACP session cursor before the patch checks the
neutral _meta fork point, and agentclientprotocol#769 makes forkSessionV2 ignore initial
configOptions. resolveForkTurnId and the forkPoint metadata are unchanged.
mrmans0n added a commit to mrmans0n/codex-acp that referenced this pull request Nov 19, 2026
Upstream v2.8.0 (agentclientprotocol#771) adds an initialize-v2 test (ACP transport is not
advertised over v1 or v2 when Codex lacks modern MCP) at the position of
c51a9ec's v2 test, and agentclientprotocol#775 renames the following upstream test to "still
routes a v1 initialize to the v1 chain". The adaptation keeps upstream's
test and name and the patch's test after it; its sorted added and removed
lines are identical to c51a9ec
(originally 4ab2596).

Upstream v2.8.0 does not change GitPatch, FileChangeReporter or the diff
patch capability in ClientCapabilities. agentclientprotocol#775 only drops v2 diffs without
any change, so the ACP v1 _meta.diffPatch keeps carrying the Git-relative
patch of a file change.
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
3f96716'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 3f96716 (originally
2a1384e).

Upstream v2.8.0 does not change SessionFailureIds, the event handler's
failure and notice reports, SessionFailureExtension or the session failure
format in ClientCapabilities. Its new notice for missing child history
(agentclientprotocol#769) is sent only on ACP v2; v1 keeps the advisory thought, so the ACP v1
_meta.sessionFailure records keep their contract.
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