Repository navigation
fix(gateway): park the service on older agent database schemas - #194599
Merged
Merged
Conversation
Classify older agent persistence schemas as required state migrations so existing worker transport and startup handling park supervised services with offline Doctor guidance.
Contributor
|
🦞👀 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. |
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
Recognize state-migrations refusals in raw session inspection so all-agent imports can continue with unrelated legacy targets. Keep newer-schema refusals terminal and cover both paths with frozen schema fixtures.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 8, 2026
…law#194599) An agent database on an older schema is now reported as a required state migration, so the managed service is parked with the existing "run openclaw doctor --fix" guidance instead of restart-looping the Gateway. The session-SQLite import still defers such a target and processes the others (fixes openclaw#194580). Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]>
maplel
pushed a commit
to maplel/openclaw
that referenced
this pull request
Nov 24, 2026
…law#194599) An agent database on an older schema is now reported as a required state migration, so the managed service is parked with the existing "run openclaw doctor --fix" guidance instead of restart-looping the Gateway. The session-SQLite import still defers such a target and processes the others (fixes openclaw#194580). Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> (cherry picked from commit 8bea0c1) Release adaptation: Classify only older canonical agent schemas as existing state-migrations maintenance; Doctor continues deferring matching targets. Keep newer schema refusal/media migration identity. No schema/version/data migration changes; retain focused Gateway parking, committed reader and Doctor regressions. Later cancellation-owner and unrelated Doctor repairs are not prerequisites. Follow-up dispositions: 410c0dd refactor(infra): read SQLite cancellation from its scope owner (openclaw#200179); 8cd7d87 chore(ci): drop retired test-lines allocation records (1/3) (openclaw#197655); 0e966cc fix: avoid agent database stalls after worker retirement (openclaw#194484); ef47e2e fix(doctor): defer update session-entry inspection when snapshot space runs out (openclaw#196370); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685) Validation: Source baseline old-schema error was generic SqliteSchemaMismatchError and did not trigger service maintenance parking. Matching existing maintenance codec and Doctor catch reviewed; exact regression group queued. diff check passed. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f61a73edfda73dc6452f3e0e534cb9e891c05ae6) (cherry picked from commit 4e8445923f2522eb6b42ab705e15624a1a674a39)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #194580
What Problem This Solves
A managed Gateway can repeatedly restart when an older agent database requires offline migration, including after a direct global npm replacement.
User Impact
The existing maintenance handler parks the macOS LaunchAgent and exits 78 with stop →
openclaw doctor --fix→ start guidance. Existing systemd and Windows supervisor handling treats that exit as terminal. Operators still need to perform the offline repair.Direct all-agent session imports continue importing unrelated legacy history when another owned database needs schema repair. Newer-schema databases still stop the import without changing the other sources.
Why This Change Was Made
The older-agent-version refusal now raises the existing
StartupMaintenanceRequiredErrorwith kindstate-migrations. Existing worker serialization and nested-error handling preserve this kind. Doctor's raw-entry inspection explicitly defers that same kind when schema-repair deferral is enabled. Current-schema admission and the existing startup warning remain unchanged; no transport or schema change is needed.Evidence
f4668bd0e161; 187 focused tests and broad CI passed atbc61f8197c45before this Doctor follow-up.bc61f8197c45because schema 25 aborts preparation. With the fix, the old database stays byte-identical while another agent's history is imported. The newer-schema control already passed on that base and still refuses import with legacy sources unchanged.doctor-session-sqlite.targets.test.tsanddoctor-session-entry-state.test.ts: 31 tests passed, 77.95 seconds including cold worker preparation. Summed case time: targets 14.97 seconds, entry-state 21.05 seconds; the two new cases total 4.65 seconds.git diff --checkpass. Local touched-file typechecking stopped before compilation because the declaration owner rejects borrowed dependencies. Current-head CI passed one756675ef42f: 47 successful jobs, 27 scope skips, 1,639 seconds wall time. Production/test types, baseline/test-line ratchets, lint, Node tests, artifact build/checks, and all PostgreSQL conformance shards passed. The CI, dependency, and security review contexts are green; no CI repair or rerun was needed.bc61f8197c45, P0–P2: scoped clean, no actionable findings. Local ClawSweeper is unavailable; the prior hosted review covers the earlier head only.