Repository navigation
fix(codex): preserve conversation text within fork history window - #159651
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 4:43 AM ET / 08:43 UTC (Revision 5). ClawSweeper reviewWhat this changesThe Codex plugin preserves saved conversation text and summaries within the overall continuity window for fresh turns and ordinary forks, with updated tests and documentation. Merge readiness✅ Ready for maintainer review Current main still clips saved conversation text before applying the history window. The prior fixture finding is resolved on this head, and inspected fork proof supports the fix; no new blocking finding emerged. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s Codex plugin reads saved session messages when starting a fresh native turn. Its history projection turns those messages into bounded prompt context sent to the Codex app server. flowchart LR
A[Saved session messages] --> B[Codex history projection]
B --> C{Content type}
C -->|Conversation| D[Continuity window]
C -->|Tool payload| E[Cap and redaction]
D --> F[Fresh Codex turn]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +53, Docs +6. Total +59 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the plugin-owned repair through standard exact-head gates, retaining the existing tool-payload, attachment, and native-input limits. Do we have a high-confidence way to reproduce the issue? Yes. On unpatched main, fork a saved message whose final item is beyond the 6,000-character per-message cap but within the continuity window, then ask for that item. Source and the inspected before screenshot support this path; I did not execute it in this read-only review. Is this the best way to solve the issue? Yes. The existing history window is the right owner for conversation text and summaries, while tool payload and native turn-input limits remain separate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1885ace4b108. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper re-review The current head remains 116a2b4. Its exact-head CI run 36325448555 completed successfully after the prior review. The four stale prefix assertions now verify retained newest-tail content within the overall continuity window, and the real fork screenshot proof remains representative because the final commit changes tests only. Please refresh the review for native landing; the previous review expired while this QA task was interrupted. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…enclaw#159651) * fix(codex): preserve conversation text within fork history window * test(codex): assert continuity within the newest history window
What Problem This Solves
Fixes fresh Codex conversations and ordinary conversation forks losing the end of a saved message even when the complete history fits the continuity window.
User Impact
Conversation text and summaries now use the existing overall history limit. A message that fits remains complete; overflowing history retains its newest tail. Tool payload caps, attachment handling, redaction, Unicode-safe truncation, and native input limits remain unchanged. No migration or configuration change is needed.
Why This Change Was Made
Live browser QA created an 80-item synthetic checklist, then forked it. The UI retained and copied all 7,919 characters, but the fork could not quote item 80; the parent could. The fresh-thread model input contained only the first 6,000 characters plus a truncation notice, ending around item 63. A per-message cap was discarding ordinary conversation text before the existing 24,000-character history window was applied.
The projection owner now reserves per-part truncation for tool payloads and lets the existing history-window owner bound conversation text and summaries. It does not infer a model window or change ordinary forks into native thread forks.
Evidence
All five new regression cases failed against the original owner for the intended clipping behavior. The corrected projection passes all 60 tests, including complete user/assistant/summary text, bounded newest-tail retention, Unicode boundaries, tool payload caps/redaction, and input immutability. Final focused command with
--maxWorkers=1took 35.472 seconds wall; the initial green run took 12.934 seconds, with transform/setup dominating. Production and test type checks passed in 42.826 and 88.233 seconds. Formatting and whitespace checks passed. Independent managed review through P2 found no actionable findings.The type check caught an impossible tool-result string branch missed by runtime tests; that branch was removed before the final proof and review. The canonical tool-result content is an array, whose text blocks retain their cap.
Full build passed (591.150 seconds), and build-dependent lint passed with no warnings or errors (145.195 seconds). The local strict UI asset check remained red by 47 bytes for startup gzip and 73 bytes for the largest chunk; no limits were changed. This patch changes no UI or dependency inputs. Local QA used that explicitly recorded build; CI remains a separate gate.
Live corrected proof on production-equivalent head
9fa6ec5created a fresh fork from a separate 8,686-character, 80-item synthetic checklist. Asked only to quote item 80, the fork returned its exact final sentence and QA1019_FORK_COMPLETE in 11 seconds. The answer and independent Unicode drafts persisted after reload. All 43 saved-workflow groups passed canonical before/after continuity checks across the isolated Gateway update, and all eight served startup assets matched the build. The original parent had no short follow-up exposing item 80.The before and after screenshots use different synthetic parent conversations to avoid contaminating the corrected proof with the original parent control answer. The follow-up commit changes only test fixtures; the built and live-tested production code is unchanged.
CI run 36322820987 caught four existing current-input integration fixtures that still expected an old history prefix to survive. Their 600,000-character message now correctly loses that prefix under the existing 450,000-character newest-tail window. The follow-up fixture repair retains all four scenarios and current-message/current-ID/image assertions, and explicitly checks retained tail, dropped prefix, and the window bound. The accepted auto-merge request was retired through native recovery before changing the head. The corrected owning file now passes 34 tests in 50.295 seconds wall; all 60 projection siblings pass in 28.280 seconds. The four affected integration cases take 148, 134, 132, and 149 milliseconds. Required changed checks passed in 466.802 seconds, including types, lint and guards. Fresh independent review of the full five-file PR found no actionable P0–P2 findings. To retain the file-size limit, scenario setup moved into the existing test-support module; case order, suite lifecycle, and all current-input assertions remain. Exact-head CI run 36325448555 passed on
116a2b4. The refreshed independent review on September 28 found no actionable findings; native recovery then landed this head as9ac804cdcd3232c5d4f8d5ff9a194c350968ae9e. The canonical checkout was fast-forwarded and its merge ancestry verified.