Skip to content

fix(codex): correct rollout tail ownership — feed clearing during MCP turns (#159)#160

Merged
Juliusolsson05 merged 2 commits into
mainfrom
fix/codex-feed-clearing-mcp
May 16, 2026
Merged

fix(codex): correct rollout tail ownership — feed clearing during MCP turns (#159)#160
Juliusolsson05 merged 2 commits into
mainfrom
fix/codex-feed-clearing-mcp

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented May 16, 2026

Copy link
Copy Markdown
Owner

Fixes #159 — feed-clearing / missing-user-row failure during MCP/tool-call turns. Full root-cause investigation is in the issue thread.

What this PR does

Bumps the packages/codex-headless submodule to Juliusolsson05/codex-headless#9, which fixes the actual root cause: the Codex committed-transcript tailer.

The bug, briefly

During MCP / client-tool runs the feed appears to "clear" every couple of turns and stops growing. It is not a renderer or ghost-system bug — runtime.entries is frozen because the committed-transcript channel goes permanently silent after bootstrap:

  • CodexHeadless pinned its rollout tailer to a single JSONL file. When a resumed Codex session's conversation was written into a forked/reconstructed rollout file, the tailer kept reading the dead one — zero live jsonl-entry events for the whole session.
  • The proxy adapter held the active-flow slot until socket response-end, which for MCP follow-up turns can lag or never arrive, starving the legitimate follow-up flow.

Evidence (issue #159): a 559s session with 67 Responses turns produced exactly one jsonl_entries event — the bootstrap burst.

The submodule fix (#9)

  • Resume: a single sessions-dir watcher detects a forked rollout and switches the committed tail to it, gated by cwd + copied-history lineage (opaque item-id overlap) so sibling orchestration agents sharing a cwd are not latched. cwd is compared canonically (symlink/case/..-normalised).
  • Fresh start: diagnostic when multiple new rollout files appear during startup (wrong-session-attach ambiguity).
  • Proxy: release the active-flow slot on response.completed so MCP follow-up turns publish; completed flows stop accumulating buffer and are reaped.

Scope / notes

🤖 Generated with Claude Code

Bumps packages/codex-headless to include the rollout-tail-ownership
fix (Juliusolsson05/codex-headless#9).

The committed-transcript tailer could go permanently silent after
bootstrap: it pinned to a single rollout JSONL and, when a resumed
Codex session's conversation was written into a forked rollout file,
kept reading the dead one. The renderer still received live proxy
semantics, so the feed appeared to "clear" every couple of turns
during MCP / tool-call runs while runtime.entries stayed frozen.

The submodule fix makes the tailer follow a forked rollout — gated by
cwd plus copied-history lineage so sibling orchestration agents in the
same directory are not latched — and releases the proxy flow slot on
response.completed so MCP follow-up turns are not starved.

Root-cause analysis: #159.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Fix feed clearing and missing user rows during MCP/tool-call turns

1 participant