Repository navigation
fix(agents): continue timeout recovery from compacted transcript - #124000
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 12:09 AM ET / 04:09 UTC. ClawSweeper reviewWhat this changesThe PR makes timeout-triggered transcript compaction prepare the compacted session’s continuation prompt before retrying an embedded agent turn. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still retries timeout compaction without invoking the prompt-state continuation transition. The patch routes that recovery through the existing owner and adds an entrypoint regression test; no code finding was identified, but its stated Codex contract could not be independently inspected because the required sibling checkout is unavailable. Priority: P2 Review scores
Verification
How this fits togetherEmbedded agent runs persist session prompt state and retry after failures. When high context pressure triggers compaction, the retry must continue the adopted transcript rather than submit the original user request again. flowchart LR
A[User turn] --> B[Embedded agent run]
B --> C[Prompt timeout]
C --> D[Transcript compaction]
D --> E[Prompt-state continuation]
E --> F[Retry attempt]
F --> G[Final response]
Decision needed
Why: The PR explicitly relies on that external runtime contract, and repository policy requires the acting reviewer to inspect it directly; this read-only host lacks the sibling checkout needed to do so. Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +3. Total +17 across 7 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 one prompt-state-owned continuation transition for every successfully adopted compacted transcript, with exactly one adoption per overflow recovery, after the pinned Codex interaction contract is checked on an equipped review host. Do we have a high-confidence way to reproduce the issue? Yes—current main’s timeout path omits the existing continuation transition, and the PR-head boundary test directly asserts the resulting retry prompt after a persisted user turn and successful compaction. Is this the best way to solve the issue? Unclear—the owner-boundary repair is the narrowest OpenClaw solution and matches overflow recovery, but the PR’s explicit Codex contract rationale still needs direct source verification. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 45a575769240. 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
|
|
Rank-up move applied: I personally inspected the required sibling
That contract confirms the host-side invariant: after OpenClaw adopts a successful compacted transcript, resending the original persisted prompt would create another user instruction. The retry must use the prompt-state owner's continuation prompt. The PR body links these exact public source ranges. No skip is needed for this rank-up move, and no code change follows from the verification. |
|
Land-ready proof for head
Focused proof command: Changed gate command was path-scoped to the seven PR files through Known proof gaps: none for this bounded host-owned invariant. No live external provider is required; the defect and repair are deterministic at the embedded run-loop/model-boundary composition. |
|
Merged via squash.
|
Closes #123989
AI-assisted change; the patch and proof were reviewed end to end.
What Problem This Solves
Fixes an issue where an embedded agent turn that timed out under high context pressure could successfully compact its session and then receive the original persisted user request again. The model could restart completed work, repeat expensive tools, or duplicate side effects instead of continuing from the compacted transcript.
Why This Change Was Made
Timeout recovery now uses the session prompt-state owner's existing compacted-transcript continuation transition, which overflow recovery already uses. The shared recovery input carries that owner once, and overflow recovery no longer adopts the same compacted successor a second time.
The repair is internal and deliberately leaves timeout/cancel/tool-execution/run-budget exclusions, hooks, token accounting, retry caps, final payload projection, provider routing, protocols, configuration, persistence shape/schema, public APIs, and security boundaries unchanged.
Sibling Codex source was inspected at
57f42a81131ccf5933e7ec5dc659c381eeb5d72b:turn/startsubmits supplied input as a fresh user operation: https://github.com/openai/codex/blob/57f42a81131ccf5933e7ec5dc659c381eeb5d72b/codex-rs/app-server/src/request_processors/turn_processor.rs#L512-L565This confirms the host must send a continuation after adopting the compacted transcript; resending the original prompt would create another user instruction.
Production LOC:
+3/-3(net0) | Tests:+22/-5(net+17)User Impact
Agents recovering from a high-context prompt timeout now continue the work already represented in the compacted transcript. Users should no longer see the original request replayed or completed work repeated by this recovery path.
Evidence
Baseline:
origin/mainat295f2c0212fd759fabd5e80cecfd00fc324bb441PR head:
5c8f9defc84ba6df6ffdc6795eec762c160bddfcBefore fix, retaining the new boundary regression while removing only the four production hunks produced:
Red Testbox: https://github.com/openclaw/openclaw/actions/runs/31862701555
After fix:
hello, and verifies one visible final payload.oxfmtpassed all seven files.check:changedpassed core/core-test types, changed-file lint (0 findings), dependency/plugin/storage/webhook/pairing guards, dead-code, and runtime import cycles (0 cycles).0.97.Green Testbox / changed gate: https://github.com/openclaw/openclaw/actions/runs/31862811933
No changelog edit: release generation owns
CHANGELOG.md.