Repository navigation
fix(codex): report safe history rejection reasons - #139933
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: blocked before merge. Reviewed September 6, 2026, 9:40 AM ET / 13:40 UTC. ClawSweeper reviewWhat this changesThe Codex plugin carries safe history-rejection codes through its reader and worker into operator warnings, with regression coverage and documentation. Merge readiness⛔ Blocked before merge - 3 items remain The diagnostic defect remains on main, and the updated native evidence resolves the previous proof blocker. No introduced correctness defect was found; acceptance of the new public SDK export remains a maintainer decision. Priority: P2 Review scores
Verification
How this fits togetherAfter Codex completes tools without a final answer, OpenClaw reads and verifies the session transcript for a restricted summarization turn. Rejected history prevents that recovery and produces an operator diagnostic while preserving the existing fallback. flowchart TD
A[Completed tools without final answer] --> B[Read session transcript]
B --> C[Verify history and projection limits]
C --> D[Recheck snapshot and cancellation]
D --> E{History accepted?}
E -->|Yes| F[Restricted final answer]
E -->|No| G[Safe diagnostic and existing fallback]
Decision needed
Why: The additive export is a narrow diagnostic solution, but accepting a permanent plugin API contract belongs to its owners. Before merge
Agent review detailsSecurityNone. PR surfaceSource +75, Tests +144, Docs +2. Total +221 across 13 files. View PR surface stats
Review metrics
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:
Technical reviewBest possible solution: Keep the typed diagnostic flow and existing rejection rules, with a documented SDK error contract and matching host/plugin release compatibility. Do we have a high-confidence way to reproduce the issue? Yes: an oversized historical field throws during projection, and current main converts that failure to undefined before capture can report it. Source inspection confirms the path; the PR also supplies native before/after observations. Is this the best way to solve the issue? Yes: carrying owner-typed rejection outcomes across the worker is a focused repair that avoids parsing exception text or weakening rejection checks; the SDK export needs explicit contract acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 21294bfa428b. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (1 earlier review cycle)
|
Carry owner-typed rejection reasons through the reader, worker, and capture boundary. Preserve empty-history behavior, cancellation and snapshot precedence, and no replay of completed actions. Refs #139838.
|
landpr-approve-unrelated-red |
|
Thanks @be-student! Proof: Native Gateway recovery now reports
The merge used an unrelated-failure exception based on source separation. A subsequent audit found that cause attribution was not established: timeout responsibility remains unknown, and no matching main failure was proved. This was an exception-policy failure, not evidence of a product regression or retrospective approval. The affected run is CI run 34036480186, job 101495479585: This catalog-only fixture does not run history recovery. Its source and catalog/authentication inputs are unchanged from tested main parent |
Preserve allowlisted history-rejection reasons through the reader, worker, and capture boundary. Keep rejected history unavailable, retain cancellation and snapshot precedence, and never replay completed actions. Fixes openclaw#139838. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #139838.
What Problem This Solves
Fixes an issue where operators could not see why Codex final-answer recovery rejected history. Known rejection reasons disappeared into a generic “context unavailable” diagnostic.
Why This Change Was Made
The history owner now carries a typed, allowlisted reason through the worker and capture boundary. Unknown failures produce a generic safe code. This changes diagnostic reporting only; it does not explain why the original model omitted its final answer.
User Impact
Operators can distinguish size, image, pairing, provenance, and access rejections without exposing transcript content or exception text. Missing files and foreign or absent headers still yield empty history. Cancellation and snapshot invalidation keep their precedence, and completed actions are never replayed.
Evidence
4a42c4ea5dfe337ee8def9056e23b30255a615f7: an oversized history field produced onlycontext_unavailable. The repaired flow reportsfield_limit, rejects the same history, and delivers one fallback after one completed action.history_read_failed.ff3d1cd5e6ace1b3a6eba4cb36d6d6f7580701b1(staging run).Sanitized excerpt from the native field-rejection run; the logging envelope and storage/run identifiers are omitted:
{"1":{"reason":"field_limit"},"message":"codex settled-turn finalization context capture failed"}The terminal reply remained: “The tool run finished, but no final summary was produced. I did not repeat any completed actions.” The action marker and native command events both recorded one completed action.
Preserves @be-student's contribution in this existing PR.