Repository navigation
fix: avoid false restart failure during startup migrations - #105544
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a29b942e3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6400c50d05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 11:35 PM ET / July 13, 2026, 03:35 UTC. Summary PR surface: Source +111, Tests +273. Total +384 across 10 files. Reproducibility: yes. at high confidence through the fixed 60-second source path and a controlled installed systemd service whose real migration lease remained active beyond that boundary; the exact original operator dataset was not replayed. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the canonical lease-aware readiness behavior after refreshing it onto current main, while retaining the service-running guard, finite migration extension, caller-sized post-migration settle window, repaired service-context reread, and a clearly bounded outer update watchdog. Do we have a high-confidence way to reproduce the issue? Yes at high confidence through the fixed 60-second source path and a controlled installed systemd service whose real migration lease remained active beyond that boundary; the exact original operator dataset was not replayed. Is this the best way to solve the issue? Yes. Consuming the existing canonical migration lease in the shared managed-restart readiness owner is narrower and more maintainable than teaching the updater or individual migrations separate timeout exceptions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b43e832fcc80. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +111, Tests +273. Total +384 across 10 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4312b9cf94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Added the requested real installed-service proof to the PR body. Redacted behavior markers from exact head The clean-room run used an isolated systemd user service on CrabBox Azure lease @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Abner Shang <[email protected]>
Co-authored-by: Abner Shang <[email protected]>
|
Merged via squash.
|
…105544) * fix: wait for startup migrations on restart * fix: honor restart readiness caller context * fix: preserve restart service identity * fix: refresh readiness context after repair * fix: bound migration restart wait by wall clock Co-authored-by: Abner Shang <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
…105544) * fix: wait for startup migrations on restart * fix: honor restart readiness caller context * fix: preserve restart service identity * fix: refresh readiness context after repair * fix: bound migration restart wait by wall clock Co-authored-by: Abner Shang <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Operators updating or restarting OpenClaw could receive a readiness failure after about 60 seconds even though the gateway was still healthy and completing a legitimate startup migration.
Why This Change Was Made
Managed restart health now observes the canonical startup-migration lease, grants one bounded lease-TTL watchdog, then restores the caller's normal readiness window after migration releases. The current updater service passes its effective timeout to the restart subprocess, so the outer watchdog cannot preempt a valid migration wait. Installed service environment and port are refreshed after repair.
User Impact
Updates and managed restarts no longer report a false failure while a startup migration is actively progressing. Crashes, stopped processes, stale leases, plugin/channel/version mismatches, and ordinary non-migration timeouts retain prompt bounded failure.
Evidence
189498600bc6139e0bcb87f02ddf909a75263112.windows-launcher-encoding.test.ts, removed on current main. Hosted merge-tree tooling and Node shards passed.Installed systemd behavior proof
openclaw-proof-105544.servicethroughgateway install --wrapper.gateway restart --force --jsoncrossed the old deadline and exited 0 after 83 seconds. Lease acquired/released; unit active; public health check succeeded.The original operator migration dataset and full package-update handoff were not reproduced. The proof exercised the real installed systemd service, cross-process canonical SQLite lease, managed restart health, bounded success, prompt crash failure, and recovery.
AI-assisted: implementation and validation were completed with Codex; maintainers reviewed the resulting code and behavior.
Agent Transcript
Redacted codex session transcript