Skip to content

fix(feed): keep semantic history visible while JSONL catches up#165

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/feed-clearing-semantic-history
May 16, 2026
Merged

fix(feed): keep semantic history visible while JSONL catches up#165
Juliusolsson05 merged 1 commit into
mainfrom
fix/feed-clearing-semantic-history

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Summary

Adds a bounded renderer-side semantic-history bridge for the MCP/tool-call feed-clearing failure investigated in #159.

The root cause fix is already in codex-headless and main: the committed JSONL tail now follows Codex rollout forks. This PR handles the remaining renderer gap while JSONL is legitimately behind the live semantic stream. Completed live turns are kept renderable in a small semantic history buffer until committed transcript entries arrive and supersede them.

Behavior

  • Feed now receives semanticHistory in addition to the current live semantic turn.
  • Archived semantic turns render below committed entries while JSONL catches up.
  • Claude archived turns are suppressed once the durable Claude message id arrives.
  • Codex suppression is per rendered block/text instead of turn-level, because Codex commits MCP/tool-call sequences one response item at a time and several committed entries can share the same turn id.
  • Codex can replace an already-ended pending-tool turn with the next Responses turn, which is required for MCP/client-executed tool output handoff.
  • When the last pending tool completes after the turn ended, the turn moves into bounded semantic history instead of occupying the single current-turn slot forever.
  • Feed render-decision debug logging now stays enabled for mounted feeds, so future traces include whether rows actually rendered, not only whether state changed.

Files

  • workspace/semantic/foldEvent.ts — Codex ended-turn replacement, pending-tool completion archive, semantic history handoff.
  • workspace/semantic/helpers.ts and workspaceState.ts — semantic history now stores a bounded full SemanticLiveTurn snapshot instead of a text-only summary.
  • features/feed/ui/Feed.tsx — renders semanticHistory, suppresses only durable duplicates, includes history in auto-scroll/debug signatures.
  • features/feed/ui/semantic/StreamingTurn.tsx and BlockRow.tsx — prevent duplicate assistant text and tolerate missing Write input JSON.
  • TileLeaf.tsx — passes semantic history into Feed and keeps render debug logging attached to mounted feeds.
  • streaming.ts / useIpcSubscriptions.ts — richer debug counts for optimistic user rows and JSONL reconcile handoff.

Verification

  • git diff --check
  • No full tsc -b claim here: the repo currently has unrelated pre-existing typecheck failures outside this PR, so this was limited to diff validation and prior live MCP reproduction context.

Test Plan

  • Run a Codex MCP-heavy turn and confirm the visible conversation grows instead of clearing while the agent works.
  • Send a user message during MCP execution and confirm the optimistic row either remains visible or is replaced by the durable JSONL row.
  • Confirm completed MCP tool rows remain visible until committed transcript rows arrive.
  • Confirm Claude live turns still archive/suppress correctly when durable messages arrive.
  • Confirm feed debug logs include visible_rows changes even when the debug panel is not open.

Context

This is the renderer mitigation layer from the same investigation as #159. It is intentionally separate from the codex-headless tail-ownership fix so the provider/runtime fix and renderer buffering behavior can be reviewed independently.

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