Skip to content

release: 0.37.0 — codex responses-lite reconstruction, exit auto-merge progress - #88

Merged
lroolle merged 1 commit into
mainfrom
fix/codex-lite-and-exit-merge
Aug 6, 2026
Merged

release: 0.37.0 — codex responses-lite reconstruction, exit auto-merge progress#88
lroolle merged 1 commit into
mainfrom
fix/codex-lite-and-exit-merge

Conversation

@lroolle

@lroolle lroolle commented Aug 6, 2026

Copy link
Copy Markdown
Member

Two fixes from Eric's 2026-08-06 reports, released as 0.37.0.

Codex responses-lite session reconstruction

codex-tui >= ~0.146 sends x-openai-internal-codex-responses-lite: response.completed still carries usage/status but its output is [] — the real items only stream as response.output_item.done events. The old adapter returned the hollow completed object, so every assistant reply reconstructed as empty and the session's final answer (10k chars in the reporting trace) was missing entirely.

  • openaiCompleted grafts collected output_item.done items into an empty completed output; the truncated-stream fallback also assembles output_text.delta runs into a synthetic partial message (dedup by item id) — under lite, deltas are the only copy of an interrupted answer.
  • The leading run of system/developer messages (codex 0.146 opens with five) folds into the system prompt, mirrored exactly between openaiSystemText and normalizeOpenaiTurns; later developer messages still render as context injections.
  • turnSnippet / openaiFirstUserText skip the codex harness wrappers (AGENTS.md digest, environment_context, mode banners), so outlines, thread sigs, compact labels, and the registry firstPrompt land on the human's prompt.

Verified on the real trace: turn 0 snippets the actual prompt, the final verdict turn renders and attributes, 50/50 assistant turns attributed, 0 unattributed/rewound.

Exit auto-merge: scan-first + progress

Huge-session exits looked hung: planMerge read and JSON-parsed every trace in the log dir with zero output — measured ~22s at 7GB peak RSS on a 2.5GB dir — even when the answer was "nothing to consolidate".

  • Scoped plans substring-scan for the run's session ids before parsing anything (a wire sid is always a verbatim substring of its pair's JSON line): unrelated traces are never parsed, and the common fresh-single-file exit concludes from the scan alone. Same dir: 5.9s, 2.5GB peak, correct empty plan.
  • MergeProgress events from plan/apply; the CLI prints steps for files >= 16MB, headed once by "Consolidating session traces — safe to ctrl-c (atomic writes; sources kept until fully merged)". cctrace merge wires the same printer.
  • Merged outputs write in 8MB chunks (tmp + rename unchanged).

Tests

623 pass (10 new: lite graft, delta synthesis/dedup, leading-run fold, wrapper skips, scoped-scan never parses unrelated files, scan-only conclusion, .zst prior prefix, write progress).

🤖 Generated with Claude Code

… with progress

Codex >= ~0.146 (x-openai-internal-codex-responses-lite) sends
response.completed with usage but an empty output[] — every assistant
reply reconstructed as nothing and the session's final answer vanished.
openaiCompleted now grafts the output_item.done items into the hollow
completed object, and a stream cut mid-answer assembles the partial text
from output_text.delta events (under lite the deltas are the only copy).
The leading run of developer messages (five in codex 0.146) folds into
the system prompt instead of rendering as a fake user turn, and the
AGENTS.md digest / environment_context wrappers no longer win the turn
snippet, thread sig, or registry first-prompt — the human's prompt does.

The exit auto-merge on huge sessions looked hung: planMerge parsed every
trace in the log dir silently (~22s at 7GB RSS on a 2.5GB dir) even when
there was nothing to consolidate. Scoped plans now substring-scan for the
run's session ids before parsing anything, so unrelated traces are never
JSON-parsed and the common fresh-single-file exit concludes from the scan
alone (5.9s, 2.5GB on the same dir). Files >= 16MB print scan/read/write
progress lines headed by a ctrl-c-is-safe note; merged outputs write in
8MB chunks; cctrace merge gets the same printer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle merged commit 39de9cb into main Aug 6, 2026
1 check passed
@lroolle
lroolle deleted the fix/codex-lite-and-exit-merge branch August 6, 2026 09:28
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