Repository navigation
fix(codex): opening a Codex session with large tool output freezes the Control UI - #136282
Conversation
…e Control UI `sessions.catalog.read` forwarded whatever `thread/turns/list` returned. Its `limit` bounds App Server turns rather than transcript items, so a thread whose turns are long arrived as a single page, and the projection then shipped every tool payload twice: the full `aggregatedOutput` as `text` plus the entire item as `raw`. One real session answered with 19.19 MB in one response and the Control UI tab stopped responding for good. Bound the payload at the producer, the way the sibling catalogs already do: - preview tool text at 4 KiB, flag it `truncated`, and drop the duplicated `raw` item, which no other catalog provider sets and core strips before history import - page the flattened turn window through the shared `sessionCatalogPaging.boundTranscriptPage`, with a cursor pairing the upstream turn cursor with the item offset already delivered, so a page boundary can fall inside a turn without losing or repeating items - stop echoing the upstream `backwardsCursor`, which the closed read-result schema never declared and no client consumes - render the truncation marker in the Control UI and delete the raw-item fallbacks whose 500-character clamp `text` had been short-circuiting Measured through the production read path against a 34.7 MB rollout: 19.19 MB / 1382 items in one page becomes 63 KiB / 50 items, cursor-resumable. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 11:02 AM ET / 15:02 UTC. ClawSweeper reviewWhat this changesThe PR pages Codex session transcripts, bounds tool-output previews, and preserves continuation across native and legacy Codex stores. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain The revised branch fixes the large-payload paging and preview paths, but its new legacy continuation encoding can emit a cursor that the next read rejects. Repair that boundary before merge. Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin reads stored Codex threads through the Gateway session catalog for display in the Control UI. It transforms native transcript items into paged catalog records, which the UI imports as bounded chat-history previews. flowchart LR
A[Codex stored thread] --> B[Codex plugin]
B --> C[Transcript paging]
C --> D[Gateway session catalog]
D --> E[Control UI]
E --> F[Bounded history preview]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +245, Tests +402, Docs +7. Total +654 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain producer-side paging and preview bounds, but represent legacy continuation without expanding an accepted opaque cursor beyond the catalog limit, and cover the maximum-length round trip. Do we have a high-confidence way to reproduce the issue? Yes, source and the supplied exact-head user-flow evidence establish the affected transcript path, although this read-only review did not execute it. Is this the best way to solve the issue? No: producer-side item paging and unified UI preview bounds are the right design, but the legacy continuation cursor violates the established input boundary for a valid upstream cursor. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cbaa21e6e32b. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
|
Thanks @goslingmanagment and @dmsrg399! Landed as 67351d8, from verified head 52948f7. Proof: Real native Codex sessions opened through the Gateway and Control UI sidebar, with older pages loaded by scrolling. Both local and normally paired headless-node paths passed.
All native item IDs and raw-output hashes matched. Short output remained complete. The existing over-ceiling legacy-turn limitation is unchanged. Exact-head independent review, the complete changed-scope checker, and CI passed. |
…9-prep * commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits) perf(ui): coalesce automation event refreshes (#138065) fix: reject incomplete Skill Workshop directory reads (#138082) test(ui): decouple rendering checks from generated wording (#138283) perf: avoid temporary entries in bounded JSON traversal (#138017) fix(irc): render complete messages before splitting (#138328) perf: prepare worker trajectory payloads only for recorded events (#138086) fix(mcp): paginated listings no longer time out after a forward clock step (#137206) fix(codex): page native transcripts and bound UI previews (#136282) feat(gateway): apply more settings without restarting (#138112) fix(docs): preserve mirrored ClawHub maturity links (#138241) fix(test): own UI animation and legacy database setup (#138296) fix(tts): preserve literal directives in Markdown code (#138319) fix: load chat widgets behind authenticated gateways (#138074) chore(ui): cover native approval finalization (#137259) fix(cron): cancel conditions before main-session handoff (#138313) fix(backup): preserve text after embedded NUL characters (#138327) fix(android): align composer control sheets (#137442) fix(ci): wait for replacement PR runs instead of stale failures (#138307) fix(sessions): keep Gateway responsive with long transcripts (#138094) fix(computer): map window inputs to delivered image coordinates (#138271) ... # Conflicts: # scripts/release-check.ts # test/release-check.test.ts
…36282) Page native Codex catalog reads by items and shared byte bounds. Preserve native cursor progress, legacy node compatibility, full raw output, and the existing 500-character UI preview contract. Verified real local and paired-node sidebar pagination with small, large ASCII, and Unicode native sessions. All items retained their order and raw output. The observed long browser task fell from 16,333 ms to at most 550 ms in the repaired proof run. Co-authored-by: Dmitriy <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #136281
What Problem This Solves
Opening a native Codex session from the Control UI sidebar can render whole tool outputs and return more transcript items than requested. This repair keeps catalog reads item-bounded and applies the existing tool-result preview limit to both text and raw fallbacks.
Root cause and repair
thread/turns/list, then flattened every item from those turns.text, bypassing the existing 500-character raw-output preview.thread/items/list. The existing shared 512 KiB text and 20 MiB page limits apply before transport, including nested node payload encoding.rawoutput remain intact.No configuration, database schema, global protocol version, or generic output policy changes. The original proposed 4 KiB truncation and raw-data removal are not retained.
Evidence
Baseline:
5b6db6d4436afd1d9413e50bea2836425457b929.Repaired head:
52948f7f3ac3feca3ab8870f1e5792bac71736fd.Disposable benign native sessions were created with supported Codex app-server operations. The same sessions were opened through a real Gateway, actual dashboard pairing, the Control UI sidebar, and upward scrolling. No operator history, fabricated transcript rows, mocked Gateway, or substituted transport was used.
Every returned item ID matched the native source in order, with no omissions or duplicates. Every raw tool-output byte length and SHA-256 matched the native source. Visible messages matched chronological source order. All pages stayed below 20 MiB; the largest observed catalog frame was 19,592,925 bytes. These timings are observations from the same isolated browser environment, not a general performance guarantee.
A real paired headless node was approved through the normal pairing flow. Its sidebar entries and
node:catalog reads exercised the bounded node command; these are not local-only results.Dependency and compatibility evidence
OpenClaw pins
@openai/codex0.153.0. Direct upstream implementation inspection and actual native capability probes confirmed that paginated stores supportthread/items/list, while the supported legacy store returns method-not-found. Relevant upstream code:app-server-protocol/src/protocol/v2/thread.rs,app-server/src/request_processors/thread_processor.rs, andthread-store/src/local/thread_history/read.rs.The existing raw
codex.appServer.thread.turns.list.v1command remains unchanged for continuation and older/native nodes. The bounded command is optional and is not advertised by app-owned embedded workers whose native catalog can use another home.A legacy turn response or single item above the transport ceiling still fails visibly. This change does not claim to remove that native legacy limitation. Inline Canvas-card history duplication is outside this repair.
Validation and review scope
policy guards, doctor tests, core-test/UI/plugin/plugin-test type checks,
translations, dead exports, lint, and runtime import cycles.
git diff --checkpassed.Rank-up moves:list was present in that review.Production: +294/-49, net +245. Tests and support: +496/-94. Docs: +13/-6. Production growth supplies native item paging, bounded node transport, and the supported legacy cursor path without changing the shipped raw-turn contract. The preview policy is unified in the UI; the obsolete flattened-turn-only reader is removed.
Thanks @goslingmanagment and @dmsrg399 for the report and original repair. Revised and verified with AI-assisted maintenance.