fix(gateway): guard fast-path startup migrations#93118
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 12:12 PM ET / 16:12 UTC. Summary PR surface: Source +15, Tests +30. Total +45 across 2 files. Reproducibility: no. live managed-service upgrade reproduction was run in this read-only review, but the source path is high confidence: current main can skip CLI preflight on gateway run, then cron can cache an empty SQLite load. 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. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the existing-helper fast-path migration after maintainer acceptance of the startup migration side effect; add a service-level upgrade proof only if maintainers want lower release risk before merge. Do we have a high-confidence way to reproduce the issue? No live managed-service upgrade reproduction was run in this read-only review, but the source path is high confidence: current main can skip CLI preflight on gateway run, then cron can cache an empty SQLite load. Is this the best way to solve the issue? Yes, likely: reusing the existing idempotent doctor helper before gateway cron can load is narrower than duplicating migration logic in cron runtime or replacing the gateway fast path. The remaining question is maintainer acceptance of the startup side effect and proof gap. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 85a635368e2f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +15, Tests +30. Total +45 across 2 files. View PR surface stats
Acceptance criteria:
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
|
9862c52 to
c4a8329
Compare
c4a8329 to
8bb16f7
Compare
|
land-ready maintainer repair is pushed at Proof:
Known proof gaps: the full |
|
CI/proof addendum before landing:
Landing with the existing |
* fix(cron): run legacy cron store migration in gateway fast path * fix(cli): run gateway startup migrations * fix(gateway): guard startup migrations and config selection * fix(gateway): reconcile final startup environment * fix(gateway): preserve guarded startup env semantics * fix(gateway): guard service-mode recovery candidates * fix(config): reconcile normalized env precedence * fix(cli): clear replaced proxy signal handlers * fix(gateway): reject invalid final config * test(gateway): cover invalid future config reset guard * test(cli): remove unused recovery state
* fix(cron): run legacy cron store migration in gateway fast path * fix(cli): run gateway startup migrations * fix(gateway): guard startup migrations and config selection * fix(gateway): reconcile final startup environment * fix(gateway): preserve guarded startup env semantics * fix(gateway): guard service-mode recovery candidates * fix(config): reconcile normalized env precedence * fix(cli): clear replaced proxy signal handlers * fix(gateway): reject invalid final config * test(gateway): cover invalid future config reset guard * test(cli): remove unused recovery state
* fix(cron): run legacy cron store migration in gateway fast path * fix(cli): run gateway startup migrations * fix(gateway): guard startup migrations and config selection * fix(gateway): reconcile final startup environment * fix(gateway): preserve guarded startup env semantics * fix(gateway): guard service-mode recovery candidates * fix(config): reconcile normalized env precedence * fix(cli): clear replaced proxy signal handlers * fix(gateway): reject invalid final config * test(gateway): cover invalid future config reset guard * test(cli): remove unused recovery state
Summary
Why this shape
The original direct cron-repair call fixed the immediate symptom but left the gateway fast path bypassing the shared startup contract. Review found that the same split path could apply or act on config-derived startup state before validation and could retain superseded env/proxy state. This repair moves the behavior to the shared gateway startup boundary and makes the selected runtime state explicit before any config-dependent mutation.
Verification
src/cli/run-main.exit.test.ts: 132 passed.src/cli/gateway-cli/run.option-collisions.test.ts: 55 passed.git diff --check, privacy scan, and CLI bootstrap import guard: passed.Proof gaps: the full
src/config/io.best-effort.test.tsfile is blocked locally by the shared checkout missing@openclaw/llm-core; the standard build wrapper is blocked because this shell lackspnpm; Testbox is blocked becauseblacksmithis unavailable; default Crabbox selected Azure and is blocked by expired Azure CLI authentication. No live macOS LaunchAgent upgrade proof was run.Release note
Gateway foreground startup now runs guarded state/config migrations before loading scheduler state, so legacy cron jobs are available on the first post-upgrade gateway start instead of requiring a second restart or manual doctor command.
Fixes #93032