Repository navigation
fix(codex): retain recent answers after tool-heavy thread rotation - #155127
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. |
Co-authored-by: VACInc <[email protected]> OpenClaw-Publication: 6a376f24-3093-4f06-b426-d3411eff955b
8abb1d9 to
11206bf
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 4:45 PM ET / 20:45 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Codex plugin retains recent assistant answers when starting a fresh native thread and adds regression coverage for bounded history, prompt hooks, and test discovery. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and the latest release still skip assistant-only continuity. No actionable defect was found in the introduced changes. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s Codex plugin reads retained conversation history and prepares requests for the Codex app-server. When a native thread starts fresh, the plugin supplies bounded, quoted history so follow-up requests retain context. flowchart TD
A[Saved conversation] --> B[Bounded history reader]
B --> C{Fresh native thread?}
C -->|Yes, useful history| D[Quoted context projection]
E[Current user request] --> D
D --> F[Codex turn input]
C -->|Resumed| F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +217. Total +221 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing bounded projection to carry substantive assistant history into fresh threads while preserving native resume deduplication. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure: a bounded assistant/tool-only suffix fails the old continuity predicate when a fresh thread starts. The added SQLite/request regression covers that path; this review did not run it. Is this the best way to solve the issue? Yes. Extending the existing continuity predicate is a narrow repair that reuses established rendering and lifecycle behavior without adding another history owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 267bb9d27fa1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Co-authored-by: VACInc <[email protected]>
…penclaw#155127) * fix(codex): retain recent answers after tool-heavy thread rotation Co-authored-by: VACInc <[email protected]> OpenClaw-Publication: 6a376f24-3093-4f06-b426-d3411eff955b * test(codex): cover projected continuity hooks and full-suite routing Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
What Problem This Solves
Fixes: Codex forgets its recent answer when a tool-heavy conversation leaves only assistant/tool history in the bounded window and a new native thread starts.
User Impact
Follow-up requests such as “give me the TLDR” retain the recent explanation after native thread rotation. Existing history limits, tool-payload omission, provenance boundaries, and resumed-thread deduplication stay unchanged. No migration or configuration change is required.
Why This Change Was Made
A fresh thread now recognizes nonblank assistant text as useful continuity even when the earlier user turn has fallen outside the retained window. The existing bounded, quoted-context projection still owns rendering. Empty, whitespace-only, and tool-only histories do not activate this new path.
Evidence
turn/starttext. Fresh and tool-schema-rotated cases failed before the production fix; fresh, rotated, resumed, empty, and tool-only/whitespace cases now pass. Synthetic fixtures only.check:changedpassed for all five PR paths: production/test types, formatting, full extension lint (10,335 files), script lint (1,123 files), all dead-export scans, plugin boundaries, and applicable source guards.git diff --checkpassed.4c52c43627ac638b5726faea71298ddeae1b1724, including the CI workflow’s aggregate gate job. The formerly failing named jobs—changed-extensions-config-19, changed-extensions-config-20, and compact-small-1—all completed successfully.Test cost and lifecycle rationale
Measured with
pnpm test <file> --maxWorkers=1: bounded-continuity 50.11 s wall (including 18.86 s shared worker preparation), hooks 11.93 s, and the existing 191-case run-attempt suite 104.88 s. The combined seven-file proof took 247.81 s. The bounded regression needs the real SQLite selector and native request boundary; a projection-helper-only test did not cover the skipped continuity gate. The changed hook case was moved out of the oversized main suite and extended with the empty-history sibling rather than growing that file. Existing fixtures own startup/cleanup; no sleeps, retry wrappers, or new polling loops were added.Hosted timing receipts: the two Codex groups completed 291 tests in 321.46 s and 216 tests in 150.55 s of Vitest wall time; their full jobs took 374 s and 264 s, respectively. The compact-small-1 job completed in 560 s. These are grouped-job timings, not per-file CI timings.
The canonical pipeline builds developer instructions before native thread startup, then rebuilds turn input if the actual startup action requires continuity. The repair does not add another hook lifecycle: assistant-only histories now use that existing path. Both builds retain the raw
currentUserMessage;llm_input, private model diagnostics, and failure snapshots match the submitted model-bound prompt.This is current-source harness/request proof, not a live provider rerun of the original conversation. The original thread-rotation trigger was not retained; the regression exercises a deterministic tool-schema rotation.
Worked on by
Work sessions
View the OpenClaw team session