Skip to content

fix(update): restore agent-store discovery in the target-release schema preflight - #167035

Merged
steipete merged 1 commit into
mainfrom
upd/upd-schema-preflight-agent-stores
Oct 8, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-schema-preflight-agent-stores

Conversation

@steipete

@steipete steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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 updateCommand regression 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: startupSettled does not join background integrity inspection, so the one-second poll sometimes observed agent-database-inspection-pending. The fixture now awaits its existing admission owner's pendingPreparation promise before the unchanged corruption assertions; no timeout increase, retry, or production seam.

Evidence

  • Reproduced all three reported failures at original main 594335a38e5acc60d75b44d98a3d2f5331958f66 (3 failed, 15 passed). The regression-introducing merge's parent, 1eb5970ff9724b88cd058bc347dee4f68dbc9612, passed all 18.
  • The new CLI regression failed before the fix because the refusal omitted agent paths, then passed with real current-schema configured, retired, and registered-custom stores. The original schema-preflight.test.ts assertions remain unchanged; all 18 passed three times (wrapper wall 54.30 s, 34.19 s, 50.80 s).
  • Ran the 43-file union of the production-basename importer search and requested sibling suites. Four existing Windows-only cases were skipped on macOS. The initial Gateway race was repaired at its completion owner. Both corruption cases passed 20 repetitions each; the original four-file Gateway group passed three times, 142 tests each (157.90 s, 167.08 s, 211.50 s wall).
  • After incorporating the concurrently landed production fix, reran all 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.
  • One-worker CLI cost: node scripts/run-vitest.mjs src/cli/update-cli.target-schema.test.ts --maxWorkers=1 passed 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.
  • Existing slow proof was retained under the campaign ruling: the unchanged CI-selection tooling file took 161.254 s (largest case 32.772 s, broad repository graph selection). The initial Gateway recovery case took 45.167 s and an existing CLI plugin-convergence case took 41.641 s while exercising full lifecycle fixtures. No timeout increases or retries were added.
  • P1 Codex autoreview was attempted; the isolated service returned HTTP 401 Unauthorized and no verdict. Continuing under the campaign exception; lead review of this head remains required before landing.
  • node scripts/check-changed.mjs passed on final base 017842386a7f48bf10bdfc7029d627125fe8689e, 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; upstream 017842386a7f48bf10bdfc7029d627125fe8689e fixes 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes size: S labels Oct 8, 2026
@steipete
steipete marked this pull request as ready for review October 8, 2026 07:40
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 3:46 AM ET / 07:46 UTC.

ClawSweeper review

What this changes

This PR adds agent-store downgrade-refusal coverage, waits for background inspection in Gateway corruption tests, and documents the existing update safeguards.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused coverage with credible reported regression runs, but proof remains an in-process harness rather than execution of the shipped CLI.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The supplied repository state identifies a maintainer-authored PR, and the introduced patch changes no production behavior. Reported validation exercises updateCommand with real SQLite and Gateway admission fixtures in-process; it is supporting test evidence, not a shipped-CLI demonstration. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes
Reason: The production repair has landed, but command-level coverage guards complete downgrade diagnostics and prevents mutation after refusal. The fixture wait preserves meaningful corruption checks.

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
Reviewed head: 3fc382e56e413cc47a6ed146fb87b2173e14e588

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported CLI regression invokes updateCommand inside Vitest rather than the shipped CLI executable; its historical failing run was not independently replayed in this read-only review.
Agent review details

How this fits together

Before 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness. Added test files: 2.

Security

None.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Tests +46, Docs +4. Total +50 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 52 6 +46
Docs 1 5 1 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 57 7 +50

Labels

Label changes:

  • add P3: The remaining branch is regression coverage, documentation, and fixture reliability work; the production defect is already repaired on main.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: The remaining branch is regression coverage, documentation, and fixture reliability work; the production defect is already repaired on main.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

@steipete
steipete merged commit 0a2c5ee into main Oct 8, 2026
176 of 181 checks passed
@steipete
steipete deleted the upd/upd-schema-preflight-agent-stores branch October 8, 2026 07:49
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant