Repository navigation
fix(update): show migration warnings from the configured database - #203849
Conversation
|
🦞👀 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 changesThis PR reads migration warnings within the configured database scope and preserves independently completed status results. Example: PostgreSQL contains a pending sample plugin migration and a recovered session named agent:main:recovered.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete PostgreSQL status-reporting defect still present on current main, and review found no introduced correctness or security bug. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe update-status CLI combines configured database history, migration records, recovery manifests, and installation checks into text or JSON diagnostics. flowchart TD
A[Update status CLI] --> B[Configured database scope]
B --> C[Update history and recovery]
B --> D[Pending plugin migrations]
B --> E[Session warning reconciliation]
C --> F[Text or JSON status]
D --> F
E --> F
Technical reviewBest possible solution: Use the existing database-selection owner for every database-backed status reader while preserving independent results and read-only inspection. Do we have a high-confidence way to reproduce the issue? Source shows both warning readers outside the selected engine scope on main, and the supplied PostgreSQL regression exercises the resulting missing and stale warnings; this review ran no target code. Is this the best way to solve the issue? The repair addresses the scope error at its existing owner, preserves active-update wording and deadline behavior, and adds distinct PostgreSQL, failure-isolation, and stalled-reader coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3e7e1ce50fbe. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +25, Tests +180. Total +205 across 5 files. Added test files: 0. 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. 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 Reviewed November 22, 2026, 7:52 PM ET / November 23, 2026, 00:52 UTC. |
|
Merged via squash auto-merge.
|
…03849) (cherry picked from commit 3fade25) Adapt test context to retained history enrichment and existing PostgreSQL availability gate. Runtime source semantics unchanged. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit b38521c04474713ad6e02a1a9021749af5c1271e) (cherry picked from commit 6d6ad00d3a2f917a7da9282a284e7a7de6d69e87)
…ate acts on it (#201668) * fix(update): verify recorded data-at-risk marks before repair acts on them * fix(update): verify any unverified data-at-risk mark and honor receipts in handoff recovery * fix(update): recognize a Git release-mode service as its checkout's own * fix(update): check a recorded data-at-risk mark before the next update, including already-current runs * fix(update): lead data-at-risk refusals with triage and record them on the refused run * fix(update): keep data-at-risk refusals within the recorded warning limit * test(e2e): finish the seeded data-at-risk run with a terminal phase * fix(update): name the agent route in killed-update recovery refusals * fix(update): drop an unused import * test(update): expect the agent route in killed-update refusals * fix(update): verify the newest mark before restoration without comparing run ids * fix(update): address review: keep the Gateway down on any inconsistent mark, resolve all marks, harden release ownership * fix(update): break the admission-root import cycle and type the e2e schema read * fix(update): address rating findings: agent rollback leftovers, helper restart, blocking findings first, shared Git metadata * test(e2e): prove the next plain update resolves a mark with the Gateway running * fix(update): address rating round 2: refuse marks before Doctor, registry-based rollback check, handoff fallback, async history read * test(update): pick the repair run, not a settlement row, in the data-at-risk cell * fix(update): resolve live-writer marks after Doctor holds the state * fix(doctor): say a skipped stale-Gateway stop left the PID running * fix(update): address rating round 3: leftovers before deferrals, retained rollback files, refusal after Doctor fails finalization * docs(update): note retained rollback files and refusals after Doctor * fix(doctor): say a stale Gateway stop could not be confirmed when nothing shows it running * fix(update): address landing review: revert release-mode ownership, check leftovers first, handoff entry guard, durable rollback evidence * test(update): follow main's Git release link layout in the launcher refusal test * fix(update): treat uninspectable leftovers and unreadable databases as unchecked; true wording after Doctor Release adaptation: Retain the stable installed-recovery harness. Do not add main's installed Docker service cell, later retired by #203808, or Git release-launcher wording/test because stable uses the in-place Git updater. Keep the state-verification, next-update, repair and interrupted-handoff paths and their compatible regressions. Companion audit: #203486 is present-equivalent at 3081077 (preserved). #201978 is selected next in this lane. #203808 and #203966 involve the inapplicable installed service-cell layout; #203497 and #203194 change main's package/Git activation layout and are not applicable; #204017 depends on that release-install layout. #204077, #204043, #203555 and #203520 are independent authority, cleanup, helper-fixture and config-validation changes. #204151, #203917, #203849 and #203406 are separate guidance, cleanup or status changes, not required by the data-risk verifier. #203569 fixes a separate cron receipt fixture in the same Doctor suite; the touched stale-stop cases do not depend on it. (cherry picked from commit a28f211) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f8d4bc138ed2512c413cf96f66fe0eefb3b28d65)
What Problem This Solves
On PostgreSQL installations,
openclaw update statusreads migration warnings outside the database selection used for update history. Pending plugin migrations can disappear, while session migration warnings can remain visible after the underlying problem has been fixed.User Impact
Update status reports pending migrations from the configured database and suppresses resolved session warnings. If a warning source fails or stalls, the command still reports the other completed results. No configuration change or migration is required.
Why This Change Was Made
Start all database-backed status readers inside the existing update database scope. Keep their results independent so a slow warning reader cannot discard completed history, recovery details, or another warning source. Warning formatting still uses the observed active-update state.
Evidence
A real PostgreSQL regression failed on the original code: the pending plugin warning was absent and the resolved session warning remained. With this change, the same test passes, including read-only artifact checks and malformed-configuration handling.
Final commit
cb96c24a230e02606c77adbe049b97bb4eb20d8f: 53 tests passed (7 real PostgreSQL updater conformance tests and 46 status, deadline, snapshot, and read-only tests). Core and affected test type checks, targeted lint, formatting with Bun parity, andpnpm buildpassed. Independent local autoreview found no actionable P0–P2 issue.Proof ran on Blacksmith Testbox
tbx_01m82vz3yptnk3zh0mqpn18g1w(run); the wrapper verified the source tree and completed with exit 0. The build reports UI asset-budget warnings; UI source and budget inputs are unchanged by this PR. No live installation was updated.Coverage limit: the regression invokes the production status command in-process against PostgreSQL, not the shipped binary's argument parser. A latest-stable upgrade drill is outside this read-only diagnostic repair: installer, update execution, schema, and migration behavior are unchanged.
Focused commands
node scripts/test-database-conformance.mjs --engine postgres --connection <isolated-local-dsn> -- src/infra/database-engine/update-command.conformance.test.ts --maxWorkers=1node scripts/run-vitest.mjs src/cli/update-cli/status.test.ts src/cli/update-cli/status.deadline.test.ts src/cli/update-cli/status.snapshot.test.ts src/cli/update-cli/status.readonly.test.ts --maxWorkers=1OPENCLAW_TYPECHECKER=tsgo node scripts/run-tsgo.mjs -p tsconfig.core.json --incrementaltest/tsconfig/tsconfig.core.test.cli-update.jsonandtest/tsconfig/tsconfig.core.test.infra.json.scripts/run-oxlint.mjsandscripts/run-format.mts --checkon the five changed files.corepack pnpm build