Repository navigation
fix(agents): require human provenance for internal restart recovery - #160130
Conversation
Forward-port the unknown-provenance correction from 0862237 and the positive human fixture correction from beab1d9. Missing or invalid input provenance cannot inherit human authority from an earlier turn, including when a final reply is prepared. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 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 changes before merge. Reviewed September 28, 2026, 1:08 AM ET / 05:08 UTC. ClawSweeper reviewWhat this changesThe branch requires explicit human input provenance before resuming an internal agent turn after a Gateway restart, adds recovery cases, and clarifies the Gateway documentation. Merge readiness⛔ Needs changes before merge - 1 item remains Current main still permits the reported internal restart-recovery path. The related merged fixture fix targeted the release branch, so this PR remains useful; source review found no discrete patch defect. Priority: P0 Review scores
Verification
How this fits togetherAfter a restart, OpenClaw reads a persisted session claim and its transcript to decide whether an interrupted agent turn can resume. Unverified internal work is tombstoned; eligible work is dispatched through the Gateway. flowchart LR
A[Gateway restart] --> B[Saved session claim]
B --> C[Transcript input provenance]
C --> D{Recovery allowed?}
D -->|Yes| E[Resume agent turn]
D -->|No| F[Tombstone claim]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +69, Docs +2. Total +75 across 4 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. Technical reviewBest possible solution: Keep the persisted latest-input provenance as the recovery authority check, refuse unverified internal claims before dispatch, and preserve the existing channel, Control UI, and child-completion recovery paths. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source maps missing or invalid provenance to a source that bypasses the internal-ingress tombstone condition; the PR body reports failing pre-fix recovery cases, which this review did not run. Is this the best way to solve the issue? Yes. The patch changes the existing provenance classifier at the recovery boundary and covers both refusal and permitted resume through the recovery-store fixture. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 02e1ac8391f8. 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
|
|
CI note: run 36380218725 failed one unrelated shard ( ClawSweeper P2 (test cost): deferred; the expanded harness file's cost is dominated by the existing suite setup. |
|
Test cost (ClawSweeper P2): |
…penclaw#160130) Restart recovery resumes an internal-ingress run only with verified external_user provenance; missing or unknown provenance no longer inherits human evidence. Forward-port of release/2026.9.7 0862237 (provenance correction) and beab1d9 (openclaw#159642 fixture). Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Main-session restart recovery resumes an internal-ingress run only when the latest input carries human evidence. The provenance reader mapped every non-special kind (missing, invalid/unknown, and
external_useralike) to a generic "other" source, which the recovery store treats like human input. A restart claim whose latest input had missing or invalid provenance was therefore resumed as if a human had sent it.This correction was made on the abandoned
release/2026.9.7branch during review of 0862237 (fixture follow-up beab1d9, #159642) and never reached main; this forward-ports it before that branch is deleted.Summary
readMainSessionRecoveryCheckpointrecognizes only verifiedexternal_userprovenance as human; missing or unknown provenance maps to no source, so the existing tombstone path handles it.external_userprovenance.docs/gateway/restart-recovery.mdstates that recovery requires verified human provenance.Evidence
main-session-harness-completion.test-harness.ts("requires human evidence for internal recovery") reproduced all four missing/invalid provenance failures on unchanged main and pass with the fix; 229 related tests passed.pnpm check:changed: production types, all test-type shards and the coercion guard passed locally before a host-load interruption; full result is on this PR's CI.