Repository navigation
fix(state): register placement move target_machine_class as additive column - #125583
Conversation
…column Databases that created worker_session_placement_moves before target_machine_class reached startup with the table but without the column. Strict shared-state repair rejected that shape, so the gateway crash-looped before feature-owned first use could add it. Register the bare nullable column in the lazy-additive registry. The table remains optional, but the column derives into startup repair so an existing table gains it before canonical validation.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 12:28 AM ET / 04:28 UTC. ClawSweeper reviewWhat this changesThe PR registers Regression provenancePossible regression — probable (failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the patch correctly moves the missing nullable column into the shared startup-repair registry, so an existing placement-move table can be repaired before strict schema validation blocks Gateway readiness. No blocking correctness finding. Priority: P1 Review scores
Verification
How this fits togetherThe shared state SQLite database is repaired and validated before the Gateway becomes ready. The additive-column registry both permits recognized older shapes and drives in-place startup repair of existing tables. flowchart LR
A[Existing state database] --> B[Startup repair preflight]
B --> C[Additive column registry]
C --> D[In-place column repair]
D --> E[Canonical schema validation]
E --> F[Gateway readiness]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +33. Total +38 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep the shared lazy-additive registry as the single startup repair owner for this bare nullable column, preserving the optional-table behavior while repairing older existing tables before validation. Do we have a high-confidence way to reproduce the issue? Yes — the added regression scenario constructs a current-version database with the pre-column placement-move table, then exercises startup repair; this read-only review did not execute it. Is this the best way to solve the issue? Yes — the registry is the common source for both maintenance compatibility and startup column repair, while the feature-local ensure is reached too late after strict startup validation fails. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9de3ca5fc93d. 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
|
…column (openclaw#125583) worker_session_placement_moves.target_machine_class was in the canonical state schema and the feature lazy ensureColumn path but not in CLAW_LAZY_ADDITIVE_STATE_COLUMN_DEFINITIONS, so a global state DB that already had the lazily-created table failed the strict startup schema check (column definitions differ) and the gateway crash-looped. Register it as lazy-additive so startup repair adds the column in place, like the sibling worker_session_placements entries.
Summary
worker_session_placement_moves.target_machine_classwas added to the canonical state schema (and to the feature's lazyensureColumnpath) but not toCLAW_LAZY_ADDITIVE_STATE_COLUMN_DEFINITIONS. A global state database that already contains the lazily-createdworker_session_placement_movestable (created before the column shipped) therefore fails the strict startup schema check withSQLite schema is incomplete or noncanonical … column definitions differ for worker_session_placement_moves→Failed migrating shared state database schema→ the gateway refuses ready and crash-loops. Databases without the table are unaffected.worker_session_placements/worker_environmentsentries. Behavior otherwise unchanged; the optional table may still be absent.Field report
Observed 2026-08-18 on a source-built gateway at
c75d4dc9after updating from863f19b7: state DB had the pre-column table (worker environments had been used); six consecutive startup refusals until the column was added manually with the gateway stopped. Three sibling deployments whose state DBs lacked the table booted cleanly on the same commit.Proof
git diff --check, format:check, oxlint,tsgo,check:test-types; focused vitestsrc/state/openclaw-state-db.test.ts+src/state/openclaw-database-maintenance.test.ts(170 tests) pass. The new regression test (repairs target machine class in a pre-column placement move table) fails without the registry entry and passes with it.Review
ClawSweeper local review (gpt-5.6-terra, high) on
915b2acf:overallCorrectness: "patch is correct",reviewFindings: [], security no concerns, no maintainer decision. Its only next step ("refresh the branch and wait for exact-head CI") is a freshness move; per our drift policy the branch is only rebased when CONFLICTING, and merge waits on exact-headopenclaw/ci-gate. Two runs of the review harness ended with an "invalid structured output" classification while the underlying decision JSON was complete — tooling, not a code issue.