feat: add ACP v2 adapter and session fork support - #433
Open
nyssance wants to merge 10 commits into
Open
Conversation
session/fork registers on the v2 entry, declares capabilities.session.fork, and installs the forked session through the same create path as new/resume (fork source travels as forkFromSessionId so every "sessionId" in request branch keeps meaning "opening an existing id"). Forked sessions inherit history, so goal republication and title source follow the resume posture. current_mode_update is no longer forwarded as a private dialect: mode changes already travel via config_option_update (MODE_CONFIG_ID) and no consumer reads the old shape. Covers: v2 adapter unit tests (fork mapping, capability passthrough, dialect drop) and a gated real E2E (spawned start:v2, fork carries the source session's memory into a new independent id).
ACP v2's NewSessionRequest makes mcpServers optional; the v1 request type happens to require it, and newSession passed it raw into createSessionConfig where .length threw. Caught live driving session/new over the v2 entry without the field.
thread/fork loads and subscribes the new thread on the app-server side; a failure in the remaining initialization (model listing, auth state) previously left that subscription alive — the resume-path cleanup is keyed on the requested session id, which a fork never has. Both layers now close the forked thread best-effort before rethrowing.
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.
Summary
session/forkthrough Codexthread/fork, including post-fork cleanup on initialization failureCompatibility
mcpServers_codex/current_mode_updateis no longer emitted; standard config option updates are usedVerification
npm run typechecknpm test— 470 passed, 29 skippednpm run build