Repository navigation
fix(update): record why the managed-service handoff was refused - #149202
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 15, 2026, 2:46 PM ET / 18:46 UTC (Revision 5). ClawSweeper reviewWhat this changesRecords managed-update handoff refusals so status, chat notices, and redacted failure reports retain the observed cause, including missing-updater recovery guidance. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful diagnostic fix absent from current main and the latest release. The earlier cancellation-settlement defect is addressed, and no new blocking code defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway hands managed updates to a separate helper while the existing Gateway keeps serving. Its update ledger supplies outcomes to status, chat notifications, and public failure reports. flowchart TD
A[Update request] --> B[Gateway handoff admission]
B --> C[Managed update helper]
B --> D[Recorded refusal facts]
C --> E[Cancellation settlement]
D --> E
E --> F[Update ledger]
F --> G[Status and chat notices]
F --> H[Redacted failure report]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +58, Tests +267, Docs +7. Total +332 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep refusal diagnostics with the existing ledger and helper settlement owners, preserving the serving Gateway and public redaction, and qualify the published-driver upgrade boundary. Do we have a high-confidence way to reproduce the issue? Yes, for diagnostic loss: current main's handoff exception path discards the observed cause from its result. The original users' service failures were not reproduced. Is this the best way to solve the issue? Yes: recording normalized facts at the refusal boundary and preserving them through existing settlement is a focused repair; no new data model or parallel recovery mechanism is needed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e7dde047904e. LabelsLabel 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 (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
e1f6e51 to
99dd428
Compare
Record the refusal before cancelling a started helper, and let its existing settlement owner preserve that reason and its failure facts. Keep cancellation in finally and preserve immutable terminal history. Refs #149161.
99dd428 to
66298b1
Compare
|
Merged via squash.
|
…claw#149202) * fix(update): record why the managed-service handoff was refused * fix(update): preserve refusal through helper cancellation Record the refusal before cancelling a started helper, and let its existing settlement owner preserve that reason and its failure facts. Keep cancellation in finally and preserve immutable terminal history. Refs openclaw#149161.
What Problem This Solves
Gateway-managed update failures could leave only
managed-service-handoff-failedandFailed phase requested: exit unknown, hiding the refusal the Gateway observed.Refs #149161, #144052, #142942.
User Impact
New handoff start and ownership-transfer failures retain their cause in the run ledger and RPC result. Status, chat, and reviewed failure reports consume the same recorded facts. The CLI's missing-updater report preserves its
openclaw doctorguidance.This improves diagnostics once the updated Gateway is running. It cannot reconstruct old reports or fix the underlying service failure. Configuration, schemas, retention, and immutable terminal history are unchanged.
Why This Change Was Made
The Gateway preserves typed refusal reasons and failure facts, normalizes plain errors into the existing fact format, and records them before cancelling a started helper. Cancellation still settles before the RPC returns and runs even if recording throws. The existing helper settlement owner preserves that recorded refusal instead of replacing it with a generic skipped cancellation.
Public redaction recognizes fixed handoff messages and closed helper-exit/timeout phrases; arbitrary suffixes remain private. Status projects the recorded cause alongside the existing outcome.
Reported by @Leoin1 (#149161), @373246784-design (#144052), and @flyintothesky (#142942). The last report concerns
target-metadata-preflight, so it is related diagnostic context rather than a verified handoff failure.Evidence
The original repair had eight failing-before Gateway regressions, failing-before CLI/public-report regressions, and 330 passing tests across 11 relevant suites. Its exact-head CI run 34988109580 passed.
The cancellation fixup adds two independent boundaries:
failed / managed-service-handoff-failedbecameskipped / managed-service-handoff-cancelled, even with recorded facts. It now preserves the failure and leaves the serving process untouched.node scripts/run-vitest.mjs src/gateway/server-methods/update-handoff-failure.test.ts src/gateway/server-methods/update.test.ts src/infra/update-managed-service-handoff-lifecycle.test.tspassed all 59 Gateway tests and 180 of 181 helper tests. The full run had one native-stop timing failure injoins a timed-out native request before releasing its source interval; that isolated case passed on both the exact pre-fix head and the repaired source. No timeout or assertion was weakened.The final focused command passed all five selected cases:
node scripts/run-vitest.mjs src/gateway/server-methods/update-handoff-failure.test.ts src/infra/update-managed-service-handoff-lifecycle.test.ts -t 'preserves the Gateway refusal|cancels managed admission|joins a timed-out native request'node scripts/check-changed.mjspassed for all seven fixup files, including production/test typechecking, lint, formatting, and repository guards.git diff --checkpassed.Independent review of the original repair is scoped-clean through P1; the final cancellation fixup is scoped-clean through P2. Exact-head CI run 35007916027 completed successfully for
66298b1df035fd93c777727bf563bd75ede69f41, includingopenclaw/ci-gate. Both patches are unchanged by range-diff after rebasing onto current main with the fixture repairs.Tests use isolated state and synthetic service-manager fixtures. No live Gateway was restarted and no published-driver/candidate upgrade cell was run. The refusal boundary precedes updater execution and requires the repaired Gateway/helper to be installed; this is not an end-to-end upgrade claim.
ClawSweeper review
Applied the P2 cancellation-settlement finding with Gateway ordering and real helper/SQLite regression proof. The requested data-model migration proof does not apply: redaction changes neither the schema nor stored-data compatibility. The published-driver/candidate request remains an explicit proof limitation above; the focused evidence covers refusal before an updater starts.