Skip to content

feat: support ACP session fork - #9

Merged
Leeeon233 merged 2 commits into
mainfrom
agent/codex-session-fork
Jul 28, 2026
Merged

feat: support ACP session fork#9
Leeeon233 merged 2 commits into
mainfrom
agent/codex-session-fork

Conversation

@Leeeon233

Copy link
Copy Markdown
Member

What changed

  • advertise sessionCapabilities.fork during ACP initialization
  • register ACP session/fork and map it directly to Codex App Server thread/fork
  • carry cwd, MCP servers, and additional directories into the forked Codex thread
  • install the returned child through the same session-open lifecycle used by new/resumed sessions, including model/mode/config state and stale-open cleanup
  • publish available commands for the child session
  • document the direct-fork/no-replay invariant

Why

Codex App Server already supports thread/fork, but the ACP adapter did not expose that primitive. ACP clients therefore could not discover or invoke native Codex session forking.

This keeps fork as a lifecycle operation and does not emulate it by replaying history.

Refs agentclientprotocol#315.

Impact

ACP clients can capability-gate a fork action, create an independent child session, and continue prompting it using the existing prompt/resume/load/close/delete paths. The source session remains unchanged.

Validation

  • npm run typecheck
  • npm test — 324 passed, 29 skipped
  • npm run build
  • npm pack --dry-run
  • npx -p bun@1.3.11 npm run bundle:all — all six CI targets passed
  • added unit coverage for capability advertisement, request/config mapping, child state installation, no history replay, and cleanup after post-fork setup failure
  • added an opt-in real Codex E2E that verifies inherited history and continued prompting; it was not run locally because this environment has neither CODEX_API_KEY nor OPENAI_API_KEY

Map ACP session/fork directly to Codex thread/fork, advertise the capability, and install forked threads through the shared session lifecycle.

Model: GPT-5
Prepare the native ACP session fork release.

Model: GPT-5
@Leeeon233
Leeeon233 marked this pull request as ready for review July 28, 2026 02:35
@Leeeon233
Leeeon233 merged commit 537a8f3 into main Jul 28, 2026
1 check passed
@Leeeon233
Leeeon233 deleted the agent/codex-session-fork branch July 28, 2026 02:35
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