Repository navigation
fix: start gateway after upgrading provider configuration - #200596
Conversation
Co-authored-by: daniel-lxs <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 58bf1c34-4048-40fa-bb3e-37c4e52c2018
|
🦞👀 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 maintainer review before merge. What this changesClose temporary database readers after upgrade configuration validation, before publishing or discarding the upgrade copy. Example: Upgrade v2026.11.5 state containing models.providers.openai without an API key.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This maintainer-authored PR fixes a current Gateway startup regression with a focused lifecycle repair; no actionable code defects were found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway bootstrap upgrades older state in a private copy, validates configuration, and publishes the result before runtime secrets preparation opens the database. flowchart TD
A[Gateway bootstrap] --> B[Copy and upgrade state]
B --> C[Validate configuration]
C --> D[Drain temporary database readers]
D --> E[Publish or discard copy]
E --> F[Open runtime state and prepare secrets]
Technical reviewBest possible solution: Retain the path-scoped finally cleanup through the existing database lifecycle owner. Do we have a high-confidence way to reproduce the issue? The linked report supplies concrete upgrade steps and SQLite error 1802, and source confirms provider metadata readers surviving publication; this read-only review executed no target code. Is this the best way to solve the issue? This is the smallest complete fix: release temporary readers before their database moves while retaining configuration validation, publication ordering, and the existing cleanup owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 22614d5b0e81. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests +81. Total +89 across 2 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 17, 2026, 9:10 AM ET / 14:10 UTC (Revision 2). |
|
Verified the latest-stable upgrade in a throwaway macOS 26.6.2 arm64 VM with Node 24.22.1. Installed published 2026.11.5, configured The tested source was
Reminder execution was not tested. The VM was destroyed and the one-shot launchd job was removed. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…00596) * Save workspace before refreshing its selected base Co-authored-by: daniel-lxs <[email protected]> * fix: start gateway after upgrading provider configuration Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 58bf1c34-4048-40fa-bb3e-37c4e52c2018 --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: daniel-lxs <[email protected]>
* Save workspace before refreshing its selected base Co-authored-by: daniel-lxs <[email protected]> * fix: start gateway after upgrading provider configuration Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 58bf1c34-4048-40fa-bb3e-37c4e52c2018 --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: daniel-lxs <[email protected]> (cherry picked from commit 9aed362) Co-authored-by: RomneyDa <[email protected]>
Fixes #200583
What Problem This Solves
After upgrading from 2026.11.4, the first Gateway start can fail with "required secrets are unavailable" and a SQLite disk I/O error when a model provider is configured. A provider entry is enough; an API key is not required.
User Impact
The Gateway can complete that first start without retaining a database connection to the removed upgrade copy. No configuration changes or new migration are required.
Why This Change Was Made
Config validation opens metadata readers on the upgrade copy. Renaming the database leaves those readers holding SQLite's old pathname. Close them through the existing database cleanup owner before the copy is published or removed, including when validation throws.
Evidence
eceb208abea1edafdc076f101330fb13b8392743. The two regressions cover provider entries with and without a key, real config validation, native readers, publication, WAL reopening, and the subsequent auth-store read. Only the Doctor schema-stamp operation is mocked.git diff --checkpassed. No changes outside this fix were needed.8d0f33f6b405, both regressions failed with SQLite 1802 without the fix and passed with it. A real Linux 2026.11.4-to-patched startup returned HTTP 200 from health, startup, and readiness endpoints. That live run was not repeated on the refreshed base; macOS and the full suite were not run.Focused verification commands
Co-authored with Dan.
Co-authored-by: daniel-lxs [email protected]
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by