Skip to content

fix: suppress session messages after close - #712

Merged
benbrandt merged 1 commit into
mainfrom
fix/session-message-fence
Oct 30, 2026
Merged

benbrandt merged 1 commit into
mainfrom
fix/session-message-fence

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

Follow up #711 with a publication fence for closed sessions on ACP v1 and v2.

  • Suppress late session updates and reject new session interactions after teardown, including registered child views and direct v2 state/replay paths. Ordinary request responses are not filtered.
  • Preserve an inserted prompt's successful response even if it follows the close response, while sending the final idle/cancelled state before close responds.
  • Track URL elicitation scope in shared client delivery. Suppress completions for closed-session, declined, duplicate and unknown flows, including after the same session ID resumes. Request-scoped login completion remains independent of session close.
  • Discard queued publication from disposed v2 foreground states and prevent late closed-state calls from recreating state that could contaminate a later resume.
  • Reopen root delivery when session state is installed and child delivery after a fresh announcement.
  • Preserve AIR archive's final metadata update inside the existing outer close fence. The operation finishes its required update before publication closes, rather than adding an exception to the post-close rule.
  • Do not infer session scope from arbitrary custom-extension payloads.

Validation

  • npm run typecheck — passed, including examples.
  • npm test — 2,293 passed, 39 skipped.
  • npm run test:integration — all 19 passed across 8 files.
  • npm run build and git diff --check — passed.
  • Final focused delivery/foreground/wire regression run — 27 passed.
  • Real Codex smoke: npm run codex-test -- -p "Reply with exactly OK. Do not use tools or modify any files." -o summary — completed with end_turn.
  • Opt-in E2E suite was not run.

Wire regression coverage includes v1/v2, standard and AIR child views, close/delete, resume, direct v2 sends, URL completion, and a deliberately delayed inserted-prompt response. Existing notification-order snapshots are unchanged.

Remaining follow-ups

Resume snapshots and metadata resynchronization, setup-response ordering, configuration publication, subagent directories, and authentication/MCP delegation remain separate changes. Active-resume environment replacement still needs the protocol decision about in-flight operations using removed roots or MCP servers. No internal review document is included.

@benbrandt
benbrandt merged commit 85bf932 into main Oct 30, 2026
6 checks passed
@benbrandt
benbrandt deleted the fix/session-message-fence branch October 30, 2026 16:42
EugeneTheDev pushed a commit that referenced this pull request Nov 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.6.0](v2.5.0...v2.6.0)
(2026-11-06)


### Features

* expose configured permission profiles as modes
([#395](#395))
([caf2e87](caf2e87))
* predict the follow-up prompt with thread/sample on the session thread
([#740](#740))
([f9cb470](f9cb470))
* show async Codex questions as elicitations
([#707](#707))
([cc57c7e](cc57c7e))
* update ACP SDK to 2.4 and align protocol behavior
([#727](#727))
([ab513aa](ab513aa))


### Bug Fixes

* clear stale entity metadata during ACP v2 replay
([#716](#716))
([580d8b9](580d8b9))
* defer startup interactions until session setup is delivered
([#714](#714))
([ad993bb](ad993bb))
* fence turn interrupt retries to the original prompt
([#723](#723))
([9c33f86](9c33f86))
* match vendor-prefixed gateway model ids such as OpenRouter's
([#731](#731))
([29195ec](29195ec))
* preserve sibling session metadata namespace fields
([#718](#718))
([3720341](3720341))
* publish complete configuration updates for session changes
([#715](#715))
([b7ac0bf](b7ac0bf))
* release the prompt suggestion thread and keep it minimal
([#709](#709))
([82ad58f](82ad58f))
* report verified standard subagent directories
([#722](#722))
([7d7e95a](7d7e95a))
* resynchronize current session metadata on ACP v2 resume
([#717](#717))
([927c480](927c480))
* scope authentication cancellation and initial status delivery
([#720](#720))
([e059ab7](e059ab7))
* show commands in Zed approval prompts
([#735](#735))
([cca2dca](cca2dca))
* skip the app-server restart when providers/set repeats the applied
config
([#728](#728))
([3b35338](3b35338))
* start the Codex app-server with the provider of the gateway routing
([#733](#733))
([cbcd446](cbcd446))
* suppress session messages after close
([#712](#712))
([85bf932](85bf932))
* synchronize resumed titles and reset replayed message metadata
([#713](#713))
([ef45a6d](ef45a6d))
* tear down session interactions and background processes on close
([#711](#711))
([1e89efa](1e89efa))
* update ACP SDK to 2.2 and align protocol behavior
([#710](#710))
([6f96fbe](6f96fbe))
* update codex to 0.166.0
([#734](#734))
([e53f23e](e53f23e))

---
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>
mrmans0n added a commit to mrmans0n/codex-acp that referenced this pull request Nov 8, 2026
Upstream v2.6.0 (agentclientprotocol#712, agentclientprotocol#718) publishes the archive state of an open session inside the archive's
delivery fence with publishAirSessionMetadata, because a closed session's delivery is sealed when
the fence ends and v2 composes the AIR namespace. The downstream update after the fence would now
be dropped. The archive state now goes through publishArchived inside the fence: AIR keeps
upstream's composed publication and a client-neutral ACP v1 opt-in gets _meta.sessionIndex.archived
as before. Upstream also moved the app-server initialize of initializeV2 before the capability
reads; the v2 session index still configures with neutral: false. A new test (AIR and neutral)
fails both without the neutral branch and with the publication after the fence.
Adapted from a1bfcc7 (original bf6dd64).
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