Skip to content

fix: speed up Codex session forks - #10

Merged
Leeeon233 merged 1 commit into
mainfrom
agent/optimize-codex-fork-startup
Jul 28, 2026
Merged

fix: speed up Codex session forks#10
Leeeon233 merged 1 commit into
mainfrom
agent/optimize-codex-fork-startup

Conversation

@Leeeon233

Copy link
Copy Markdown
Member

What changed

  • upgrade the bundled @openai/codex runtime from 0.144.4 to 0.145.0
  • send excludeTurns: true with native thread/fork requests
  • keep forked history intact in Codex while avoiding full turn reconstruction in the synchronous fork response
  • regenerate stable app-server protocol types and adapt the extension to the new runtime fields
  • add coverage that locks the metadata-only fork request behavior

Why

The first fork of a long session can be much slower than later forks because Codex app-server reconstructs the source thread's turns for the thread/fork response, even though this ACP adapter does not consume those returned turns. thread/fork.excludeTurns preserves the child thread's complete context but returns only the metadata and live fork state needed by the adapter, removing that unnecessary work from the tab-creation critical path.

The experimental field is modeled explicitly at the app-server client boundary. This avoids an unsafe cast and avoids importing every unrelated experimental protocol type into the generated stable bindings.

Impact

Fork semantics do not change: the child remains a native Codex fork with full inherited context and is immediately usable for normal follow-up turns. Only unused response history reconstruction is skipped.

Validation

  • npm run typecheck
  • npm test — 324 passed, 29 skipped
  • npm run build
  • npm run bundle:all — Linux x64/arm64, macOS x64/arm64, and Windows x64 passed; the final Windows arm64 target could not run because local Bun 1.3.5 reports that compile target as unsupported

Upgrade the bundled Codex runtime and request metadata-only fork responses so app-server does not reconstruct the full turn history on the critical path. Regenerate protocol types and adapt to the updated stable schema.

Model: GPT-5
@Leeeon233
Leeeon233 marked this pull request as ready for review July 28, 2026 12:38
@Leeeon233
Leeeon233 merged commit ab32e2e into main Jul 28, 2026
1 check passed
@Leeeon233
Leeeon233 deleted the agent/optimize-codex-fork-startup branch July 28, 2026 12:41
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