Repository navigation
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 real behavior proof before merge. Reviewed October 5, 2026, 11:26 AM ET / 15:26 UTC (Revision 3). ClawSweeper reviewWhat this changesThe agent runner includes the original request in transient retry prompts, retains instructions to preserve completed work, and rejects an empty request. Merge readiness⛔ Blocked before merge - 2 items remain This focused fix remains useful: current main still replaces the request with generic continuation text, and neither related alternative has merged. No introduced correctness defect was found, but the supplied live evidence does not yet establish the central answering and continuation behavior. Likely related people: Peter Steinberger and changeroa are routing candidates from merged retry-path history; source-line introduction remains unverified. Priority: P1 Review scores
Verification
How this fits togetherThe embedded agent runner builds model input and recovers interrupted attempts. Its retry prompt and conversation history determine which task the model continues and which completed actions it can see. flowchart TD
A[Current user request] --> B[Agent attempt]
B --> C[Transient failure]
C --> D[Retry recovery]
A --> E[Request and continuation prompt]
D --> E
F[Conversation history] --> G[Model retry]
E --> G
G --> H[Continued answer]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +11, Tests +31. Total +42 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the current request visible through the existing retry owner while preserving completed-work context and avoiding another persisted user turn. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the missing-input path: generic continuation replaces the original request while the admission-fenced history can exclude it. This review did not execute a failing current-main run. Is this the best way to solve the issue? Yes, retaining the request in the existing continuation prompt is a narrow repair that covers history missing the admitted row; live evidence must still establish correct continuation after partial progress. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 68f038c9467c. LabelsLabel changes: No label 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
History |
Yigtwxx
left a comment
There was a problem hiding this comment.
Reviewed head ee0517578c2. The body's central claim is a source reading, and #165540 depends on the opposite reading, so I measured it on the real Codex projection path. Short version: the claim holds. The same fence also hides the current turn's progress, which matters for the second incident in #165463.
1. Fenced history drops the admitted request (measured)
Probe (temporary test file next to run-attempt.context-engine.test.ts, not committed): createSqliteParams-style SQLite target, a real UserTurnTranscriptRecorder from loadUserTurnTranscriptRecorderFactoryForTest(), Task A persisted with persistApproved(), then Task B persisted as the admitted turn. Codex attempt, no context engine, skipPreparedUserTurnMessage: true, prompt = the continuation text. I read the turn/start input text. There are two arms: the real recorder (fenced), and the same recorder with getAdmissionReceipt returning undefined, which is the shape #165540's test uses.
| head | fenced (production recorder) | receipt undefined |
|---|---|---|
main 0907ac29619 |
Task B absent | Task B absent |
#165540 5e621df90ef |
Task B absent | Task B present |
The fence cuts at seq < beforeRawSeq, and beforeRawSeq is the admitted user row itself (session-transcript-read-fence.ts:227, session-accessor.sqlite-model-context.ts:504). The repo already relies on this: the admitted-continuation scenario in run-attempt.plugin-refresh.test.ts:191-199 injects the persisted admitted message into pluginRuntimeRefreshMessages explicitly. It does not expect history to carry it.
2. The fence also hides the current turn's progress
The cut is at the admitted row, so everything the failed attempt wrote after it is excluded as well. I ran the same probe with an assistant message appended after Task B and the prompt shaped exactly like this PR's retry prompt (Current user request:\n${prompt}\n\n${CONTINUATION_PROMPT}):
{"hasTaskA":true,"hasTaskB":true,"hasProgress":false,"headerCount":2}
<conversation_context>
[user]
Task A: list the open invoices
</conversation_context>
Current user request:
Current user request:
Task B: summarize the migration plan
Continue the current task from the existing transcript, preserving completed work. If an action was interrupted, inspect its state before deciding whether to retry it. Do not restart the task or repeat completed actions.
The appended message was PROGRESS: sent the migration summary to the team channel, and it does not reach the model. For a retry that renders the bounded continuity projection (the trace in #165463 carried conversation_context), this PR restores Task B. The model still cannot see what the failed attempt already did. That is the issue's second incident, where a progress message and a tool call came before server_overloaded. On main the model answers the wrong task. With this PR it answers the right task, but it is told not to repeat actions it cannot see, so a non-idempotent action from the first attempt (a sent message, a write) can run twice. I did not run that end to end; the probe shows only the model input.
Two ways to close it:
- (a) State in the body that the fix targets the before-output case (incident 1) and track incident 2 separately.
- (b) For internal retries, read history through the latest settled entry of the current turn instead of stopping at the admitted row. That fixes the request and the progress at the history owner, and the prompt text would not need to change.
A smaller point: the header is printed twice, because the Codex renderer already prefixes Current user request:. Labelling the inline block Original user request: avoids the stacked header.
3. Other bare continuation producers are unchanged
includeCurrentUserRequest: true is passed only from the transient path (attempt-recovery.ts:464 on this head). These sites still activate the bare continuation, and under the same fence they would produce the same Task-B-less input:
- operator permission restart:
run-loop.ts:417 - preflight mid-turn recovery:
attempt-normalization.ts:259 - overflow recovery:
overflow-context-recovery.ts:250, 333, 376, 413 - compacted retry:
activateInternalPrompt(CONTINUATION_PROMPT)inprepareCompactedTranscriptRetry(session-prompt-state.ts:305on this head), reached fromoverflow-context-recovery.ts:378andtimeout-context-recovery.ts:122
I did not drive these with the Codex harness, so I am not claiming each one is reachable there. I'm listing them so the scope is an explicit choice. If option (b) above is taken, all of them are covered at once. If the prompt-side approach stays, making the request part of every internal continuation inside session-prompt-state.ts would cover them with one change instead of a flag per caller.
4. Stale invariant comment
attempt-recovery.ts:390 still says "never resubmit the original user request" (added in #139397). The request is now resubmitted inside the internal prompt, though it is not persisted. The comment should say that, so the next reader does not treat this PR as a violation.
Relation to the sibling PRs
| #165540 | #165593 (this) | #165626 | |
|---|---|---|---|
| Change | Codex history keeps the admitted message on internal prompts | Transient retry prompt carries the request | Codex turn/start -32001 replays the original prompt |
| Production fenced path, Task B | no change (measured) | restored | not applicable: returns retry() before continueFromCurrentTranscript |
| Current-turn progress visible to the retry | no | no | not applicable (turn never accepted) |
git merge-tree vs main and pairwise |
clean | clean | clean |
#165626 is orthogonal and composes with this PR. If #165540 and this PR both land, the receipt-less path shows Task B twice (once in history, once in the prompt).
Carry the current request and settled attempt snapshots through the optional harness continuation contract. Codex projects completed work alongside its admission-fenced history; later plugin refreshes retain the same facts. Builds on #165593 by @Baumus. Regression and fresh-machine Gateway fault injection cover overloads before work and after a completed read. Fixes #165463 Co-authored-by: Baumus <[email protected]>
|
Thank you @Baumus. Your fix and tests were the starting point for #166868, merged as be4c0b1 with you credited as co-author. That PR restores the current request on same-model overload retries and also carries the failed attempt's completed tool results through an optional host-owned continuation, so the retry neither answers the previous task nor re-runs completed tools. Closing this one as superseded by #166868. |
…6868) Carry the current request and settled attempt snapshots through the optional harness continuation contract. Codex projects completed work alongside its admission-fenced history; later plugin refreshes retain the same facts. Builds on openclaw#165593 by @Baumus. Regression and fresh-machine Gateway fault injection cover overloads before work and after a completed read. Fixes openclaw#165463 Co-authored-by: Baumus <[email protected]>
Related: #165463
Alternative to #165540 for the observed fenced-history case.
What Problem This Solves
Fixes: after a transient same-model retry, an agent can answer an earlier task because the rebuilt model input no longer contains the current user request.
User Impact
The retry receives the current request and can continue the active task. A missing request fails visibly. The retry still avoids persisting another user turn or replaying settled tools.
Why This Change Was Made
PR #165540 changes the Codex renderer so it retains the admitted user message if that message reaches projected history. The observed retry had a different input: projected history ended at the earlier task, and the current prompt was only the generic continuation instruction.
The source explains the gap: the Codex history reader passes the admission receipt into a fenced read, and the SQLite context read limits rows to before the admitted turn. #165540's test supplies Task B directly in a fake assembly and returns no admission receipt, so it does not exercise this fenced case. This is a source-level explanation of the observed missing input, not a completed isolated live fault-injection reproduction.
This PR puts the original request in the shared transient retry prompt, independent of whether projected history contains the admitted row. If #165540 also lands, Codex may see Task B twice; maintainers should choose one approach or deduplicate the combined path.
Evidence
The sanitized live report records two cases: an overload before any output, and one after on-topic progress plus a read-only tool call. In both, the first model input contained Task B; the retry input contained no Task B and the agent answered Task A. Task A/B are placeholders; no private task content, transcript, identity, path, session ID, endpoint, or credential is included here.
After-fix live observation from a natural overload on the installed release with the equivalent one-file hotfix (read-only analysis; raw logs are withheld):
The first attempt had no completed action to replay. This shows request retention and a completed real Codex retry for the before-output case. It does not establish that the final answer was semantically on-task, or prove recovery after partial progress. No private prompt, transcript, identity, path, session ID, endpoint, or credential is published.
The complete focused prompt-state and recovery test files passed (2 Vitest shards, 86.86 s), including the corrected output-limit assertion and the mocked after-progress overload case. Formatting, lint, and TypeScript core checks passed. A controlled, injected live overload after the fix has not been run.