Repository navigation
fix(codex): keep task lists active across compaction - #123921
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 14, 2026, 10:34 PM ET / August 15, 2026, 02:34 UTC. ClawSweeper reviewWhat this changesThe PR retains the latest Codex task plan and reinjects it after context compaction so later progress updates can keep the WebChat task list current. Merge readiness⛔ Blocked by patch quality or review findings - 7 items remain Keep open: the updated payload cap still permits roughly 7K tokens of new model-visible text immediately after compaction, creating the context-pressure failure the fix is meant to avoid. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin projects app-server plan events into OpenClaw’s agent and WebChat progress streams. After Codex compacts a thread, this change sends the retained plan back through the app-server client before the model continues. flowchart LR
A[Codex plan update] --> B[Plan event projection]
B --> C[Retained plan]
D[Context compaction completes] --> E[Restore plan]
C --> E
E --> F[Codex thread history]
F --> G[Continuing model turn]
G --> H[WebChat task progress]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +144, Tests +119. Total +263 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain only a compact plan envelope within the model-context budget, measure the complete injected message including its preamble, and verify the exact pinned Codex protocol lifecycle before merge. Do we have a high-confidence way to reproduce the issue? Yes, from source: update_plan accepts arbitrarily large strings and lists, while this branch serializes up to its new high cap into the next model context after compaction. Is this the best way to solve the issue? No: preserving plan state is appropriate, but the restoration must be a small bounded context item rather than a potentially multi-thousand-token replay. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6abfedcca5d4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix(codex): restore plan state after compaction * fix(codex): bound restored plan context
What Problem This Solves
Codex-backed turns could leave the WebChat task list stuck at its initial state after automatic context compaction. OpenClaw retained the visible snapshot, but the continuing model turn no longer had the active structured plan, so it stopped emitting later progress snapshots.
Why This Change Was Made
The Codex app-server boundary now retains the latest valid plan event and restores that exact snapshot into the active thread through the official history-only
thread/inject_itemsAPI after completed compaction.The restoration:
update_plancalls, and nested code-mode tool calls;User Impact
Long-running Codex-backed sessions keep their active task list available to the model across compaction, allowing subsequent
update_plancalls to keep the WebChat list current instead of leaving it at0/N.Evidence
thread/inject_itemsrestoration request.pnpm tsgo:prod, changed-file oxlint, formatting, and local autoreview passed; autoreview reported no findings.An exact live WebChat green replay is not claimed: provider-triggered compaction inside an authenticated live turn is nondeterministic. The original real-session rollout remains the user-surface red occurrence; the deterministic owner-boundary test is the green regression proof.
AI-assisted: yes. The implementation, tests, source audit, and proof were reviewed by the author.