Repository navigation
fix(claws): recover lifecycle state safely - #123254
giodl73-repo merged 7 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 11:37 PM ET / August 15, 2026, 03:37 UTC. ClawSweeper reviewWhat this changesThe PR serializes Claw and ordinary MCP configuration changes, refreshes Claw provenance between processes, and reconciles completed cron ownership before recovery. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open for maintainer review: current main still skips reconciliation for completed cron ownership, while this PR adds the missing safe recovery path. No concrete patch defect was found, but the intentional fail-closed recovery behavior, stale base, and pending exact-head checks need maintainer acceptance. Priority: P1 Review scores
Verification
How this fits togetherClaw lifecycle commands persist ownership of MCP servers and scheduled jobs, then coordinate with shared configuration and the Gateway. The resulting status determines whether an operator can safely retry, remove, or recreate a resource. flowchart LR
A[Claw lifecycle command] --> B[Persisted ownership]
B --> C[MCP lifecycle lease]
C --> D[Shared MCP configuration]
B --> E[Completed cron reconciliation]
E --> F[Gateway job inventory]
D --> G[Operator recovery result]
F --> G
Decision needed
Why: The protected maintainer label and the intentional recovery-contract change require an explicit maintainer merge judgment even though no patch defect was found. Before merge
Agent review detailsSecurityNone. PR surfaceSource +239, Tests +640, Docs +20. Total +899 across 19 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase and land only after exact-head CI is green, retaining the shared MCP facade lease and the explicit remove/add recovery contract for missing completed cron jobs. Do we have a high-confidence way to reproduce the issue? Yes: create a completed Claw cron reference, remove or drift its Gateway job, then retry on current main; current source skips reconciliation, while the PR returns a recorded conflict before cron.add. Is this the best way to solve the issue? Yes: placing the lease in the shared MCP mutation facade and reconciling completed cron state at its lifecycle owner covers ordinary writers and retries without a new Gateway protocol. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2ebaebd48473. 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
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The prior exact-head review hit |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c204155 to
f69dcea
Compare
f69dcea to
ac07903
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Maintainer scope decision: do not add a new Gateway conditional-create protocol in this PR. The exact-head P1 now points at the pending-reference creation path ( The branch-attributable recovery path was a completed ownership record whose scheduler job disappeared. Head Please assess merge readiness against that delta. A Gateway-owned create-if-absent contract can be handled as a separate owner-level change rather than expanding this lifecycle repair. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5
Co-authored-by: Copilot <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5
Co-authored-by: Copilot <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5
c89425d to
67258d1
Compare
|
Merged via squash.
|
* fix(claws): preserve runtime lifecycle state Co-authored-by: Copilot <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5 * fix(claws): harden lifecycle reconciliation Co-authored-by: Copilot <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5 * fix(mcp): serialize ownership mutations Co-authored-by: Copilot <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5 * test(mcp): prove lifecycle lease ordering * fix(claws): page cron recovery inventory * fix(claws): fail closed on missing cron ownership * refactor(claws): keep pending cron recovery unchanged --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Gio Della-Libera <[email protected]> Copilot-Session: 34377cd6-beac-4e49-8ab0-22cfaf8b54a5
What Problem This Solves
Fixes issues where Claw runtime ownership could become stale across processes, rejected or concurrent MCP mutations could leave incorrect provenance, and retries could trust completed MCP and cron resources after ownership changed.
Why This Change Was Made
The runtime refreshes provenance at each authority snapshot, serializes MCP ownership and config mutation per server name, restores provenance after known rejected writes, and reconciles completed MCP and cron references against current live definitions and ownership. Completed cron ownership that is missing from Gateway inventory fails closed and requires explicit remove/add recovery.
User Impact
Claw add, update, retry, rollback, and removal operations recover more reliably without silently widening tool authority, recreating completed owned resources, or deleting shared configuration. Initial and pending cron creation retain the existing Gateway convergence contract; this PR does not change Cron's owner API.
Evidence
493a3e46b3f2921269cfb0af5dfc86efb569ceaabecause the ordinary mutation enters the canonical config writer while the Claw lease is held, and passes on this PR head because it remains blocked until released5f50cf244732f5bb7090f274bdf1dc21095d3ed, a missing completed scheduler job proceeds towardcron.add; on this head it returnscron_reconcile_conflict, does not callcron.add, and preserves the completed ownership record for explicit removalcron.addgit diff --checkcodex review --base 621220aea9baa22b002be1f4cd10230be2767f3d: no actionable correctness defectsProof disposition
This maintainer-authored repair coordinates local ownership/config writers around a shared SQLite lease. The deterministic proof uses the canonical mutation function as the observation point. Completed cron recovery is tested at the Gateway adapter boundary. The pending-reference list-to-add behavior is unchanged from
main; this PR neither claims nor introduces a Gateway conditional-create protocol. It does not claim live provider, channel, or remote-service coverage. Exact-head hosted CI remains the integrated-environment gate.Exact-head proof
c89425d006b24d9d4ddd6cf2f417d2e7c1b92124cron.addis attemptedmain; atomic conditional create is outside this PR