Repository navigation
fix(update): restore agent-store discovery in the target-release schema preflight - #167035
Conversation
Follow up on #166963 and hourly run 37733136524. The production discovery guard is already restored on main by cfee851 (#161057). Exercise updateCommand with current-schema configured, retired, and registered custom stores against v2026.7.1-2, and document the refusal boundary. Join background admission in the Gateway corruption fixture instead of racing its one-second polling deadline. Local proof and changed checks pass; independent P1 review was unavailable with HTTP 401 under the campaign exception.
|
🦞👀 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. Reviewed October 8, 2026, 3:46 AM ET / 07:46 UTC. ClawSweeper reviewWhat this changesThis PR adds agent-store downgrade-refusal coverage, waits for background inspection in Gateway corruption tests, and documents the existing update safeguards. Review scores
ProductKind: Test only · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: the production fix is already on main, but this PR adds useful command-level regression coverage and repairs a Gateway test race. No actionable patch defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherBefore installing an update, OpenClaw compares the target release’s database support with existing shared and agent stores. Incompatible stores produce a refusal before installation or Gateway shutdown. flowchart TD
A[Requested update release] --> B[Update command]
C[Shared and agent databases] --> D[Schema preflight]
B --> D
D --> E{Compatible with target?}
E -->|No| F[Name incompatible stores and refuse]
E -->|Yes| G[Continue update preparation]
Technical reviewBest possible solution: Retain the existing production guard and land the focused regression, documentation, and owner-based fixture wait through normal exact-head gates. Do we have a high-confidence way to reproduce the issue? Not applicable to the remaining test/documentation patch: current source already contains the production repair, and the PR reports a failing historical regression followed by passing runs. Is this the best way to solve the issue? Yes: exercising the command with real stores protects the refusal boundary, and awaiting the existing admission owner removes the fixture race without changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a06612710e67. Provenance checked
TestingProof path: in-process harness. Added test files: 2. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +46, Docs +4. Total +50 across 3 files. View PR surface stats
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 |
…ry at the CLI boundary (openclaw#167035) openclaw#166963 made the target-release schema preflight return before agent-store discovery; openclaw#161057 (1991553) restored the production path concurrently. This adds a CLI-boundary regression so a downgrade target that cannot read the agent databases stays refused, and replaces a polling wait in the agent-database startup test with the inspection promise.
What Problem This Solves
The target-release schema preflight stopped discovering agent stores after #166963: hourly run 37733136524, job 113166818696, reported three missing-store failures. The shared-state refusal remained, but configured, retired, and registered custom agent refusals disappeared.
User Impact
Updates to an older target must name every incompatible agent store before installation or service mutation. State newer than the inspecting build must still produce one actionable refusal, and status reads must preserve database bytes, mtimes, and sidecars.
Why This Change Was Made
The early return confused the target release's schema limit with the inspecting build's ability to read the registry. The production condition is already on main in cfee851 (#161057). This PR adds a real
updateCommandregression with current-schema SQLite stores and a v2026.7.1-2 target, plus the corresponding update documentation.The importer run also exposed an existing Gateway test race:
startupSettleddoes not join background integrity inspection, so the one-second poll sometimes observedagent-database-inspection-pending. The fixture now awaits its existing admission owner'spendingPreparationpromise before the unchanged corruption assertions; no timeout increase, retry, or production seam.Evidence
594335a38e5acc60d75b44d98a3d2f5331958f66(3 failed, 15 passed). The regression-introducing merge's parent,1eb5970ff9724b88cd058bc347dee4f68dbc9612, passed all 18.schema-preflight.test.tsassertions remain unchanged; all 18 passed three times (wrapper wall 54.30 s, 34.19 s, 50.80 s).openclaw-database-preflight*.test.ts,schema-preflight.test.ts,status.readonly.test.ts,doctor-maintenance.finish-revalidation.test.ts, the full CLI target-schema suite, and the Gateway group: 306 passed across 18 files, 757.97 s wall. Main had removed three unrelated Gateway cases, so this group contained 139 tests.node scripts/run-vitest.mjs src/cli/update-cli.target-schema.test.ts --maxWorkers=1passed all 27; 176.09 s Vitest / 211.81 s wrapper, including 13.617 s for the new regression. This existing integration suite exercises command admission and service/install non-mutation through real SQLite; shared command and worker startup dominate the added case. CI seconds are pending publication.node scripts/check-changed.mjspassed on final base017842386a7f48bf10bdfc7029d627125fe8689e, including both test typecheck graphs, all dead-export scans, and changed-file lint. The focused real CLI regression passed again there (12.259 s case, 70.26 s wrapper). An inherited unused export initially blocked the rebased check; upstream017842386a7f48bf10bdfc7029d627125fe8689efixes it. The tested files and preflight owner are unchanged between that base and the 306-test proof base.All proof ran locally with isolated state. Production LOC in this PR: +0/-0 (guard already on main); tests: +52/-6; docs: +5/-1. No schema or dependency changes and no new options. Auto-merge remains off.