Repository navigation
fix(compaction): preserve active request provenance - #180214
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. |
740e30e to
9b9a4e8
Compare
|
Codex review: needs maintainer review before merge. What this changesPreserves the active human request and recorded input sources across compaction, fallback summaries, and repeated recovery. Example: “Review the patch; do not deploy it.” is followed by an inter-session “Worker update” before compaction.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a current compaction defect, and the reviewed head has no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe embedded runtime passes the admitted request boundary into AgentSession; core compaction and safeguards turn transcript history into a bounded summary and retained messages. flowchart TD
A[Admitted request] --> B[Embedded recovery runtime]
B --> C[AgentSession compaction]
D[Transcript and prior checkpoint] --> C
C --> E[Core preparation and safeguards]
E --> F[Persisted compaction checkpoint]
F --> G[Resumed model context]
Technical reviewBest possible solution: Carry the admitted request through existing compaction owners and reuse its bounded checkpoint after archival, preserving source labels and unprocessed input. Do we have a high-confidence way to reproduce the issue? Current-main source shows internal user-role observations can replace the active human request; supplied red/green results and persisted regressions identify the repeated-recovery failure without a reviewer-run reproduction. Is this the best way to solve the issue? The patch fixes selection at existing runtime and compaction owners, consolidates attribution, and reuses established persistence rather than adding another state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 187b16c78550. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +199, Tests +498, Docs +2, Other 0. Total +699 across 19 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (8 earlier review cycles)
Reviewed October 31, 2026, 5:01 AM ET / 09:01 UTC (Revision 9). |
9b9a4e8 to
65ddafe
Compare
65ddafe to
7c2284c
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
7c2284c to
60e64c8
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Addressed the accepted P1 on The new persisted regression reopens through the production semantic-window reader and performs two automatic recoveries. All three cases failed the old head at the reported Rebased onto |
|
🦞👀 Re-review progress:
|
027796a to
a9c3740
Compare
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Added live exact-head E2E evidence for The shipped CLI ran against private isolated state and a token-authenticated loopback Gateway with a real OpenAI Responses model on the embedded OpenClaw runtime. The model completed the original marked request, Gateway compaction retained its no-deploy constraint, a later live human steering turn completed, and a second Gateway compaction retained the checkpoint while selecting the newer request. Gateway history recorded two real model completions and two compactions with no pending inputs. I did not fabricate the remaining inter-session case: the Gateway correctly rejected CLI-exec input that would lose |
|
🦞👀 Re-review progress:
|
Problem
Compaction could replace the active human request with a later internal observation, or revive completed human work during an independent internal run. The first revision also rejected a second recovery after the production semantic-window reader archived the original admitted request.
Solution
This is an independent remediation related to #178477, with credit to @dmitryvostryakov for the original report and implementation. Request provenance remains separate from general model-quality concerns.
Verification
a085f281e904withinvalid_session: Compaction cannot find the admitted request.on the second recovery.a9c37408306168b27b2b777de4e9165e0c9eb76b, based on main3523ef6747820e3253442a633dc09888c4cdf5fe. Both commits are patch-identical to the published pre-rebase revision; no conflicts or new behavior changes.openai-responsesrequest togpt-6.1-solthrough an explicit embedded-runtime provider route.openclaw agent --localadmittedRQ-180214-EMBEDDED(review the patch and do not deploy it) and the live model returned exactlyACK-RQ-180214-EMBEDDED.openclaw sessions compactcrossed the production Gateway RPC and live summarizer path. It compacted 15,191 tokens and retained both the marker and the no-deploy request in the generated summary.RQ-180214-STEER; the live model returned exactlyACK-RQ-180214-STEER.Original Request, including the no-deploy constraint.chat.historyon the isolated Gateway recorded two successfulproof-openai/gpt-6.1-solmodel completions and two compaction records, with no pending inputs; the final session runtime wasopenclaw.SessionManager.openAsync(..., { compaction: true }), verifies the original request is absent from the semantic window, and completes a second automatic compaction. Human request survives internal updates; authoritative internal selection remains none; newer human steering supersedes the checkpoint request. Missing pending input still rejects.git diff --checkpassed on the rebased tree. The mock-export ratchet was the failing check in the prior CI run.sessions_sendattribution. That branch remains covered by the persisted production integration test above.Scope
Ready-for-review preparation only. Do not merge or backport.