Skip to content

fix(update): show migration warnings from the configured database - #203849

Merged
vincentkoc merged 1 commit into
mainfrom
fix/update-status-migration-database-20261123
Nov 23, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/update-status-migration-database-20261123

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

On PostgreSQL installations, openclaw update status reads 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, and pnpm build passed. 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
  • PostgreSQL 17: node scripts/test-database-conformance.mjs --engine postgres --connection <isolated-local-dsn> -- src/infra/database-engine/update-command.conformance.test.ts --maxWorkers=1
  • node 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=1
  • OPENCLAW_TYPECHECKER=tsgo node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental
  • The same type-check wrapper for test/tsconfig/tsconfig.core.test.cli-update.json and test/tsconfig/tsconfig.core.test.infra.json.
  • Targeted scripts/run-oxlint.mjs and scripts/run-format.mts --check on the five changed files.
  • corepack pnpm build

@vincentkoc vincentkoc self-assigned this Nov 23, 2026
@clawsweeper

clawsweeper Bot commented Nov 23, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review November 23, 2026 00:36
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M labels Nov 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 23, 2026
@vincentkoc
vincentkoc enabled auto-merge (squash) November 23, 2026 00:50
@clawsweeper

clawsweeper Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Update status omits the pending plugin warning and retains the resolved transcript_missing warning.
  • After: Update status shows the pending plugin warning, suppresses the resolved transcript warning, and retains unresolved entry_invalid warnings.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-consistent, with useful regression coverage; required shipped-entry-point evidence remains absent from the supplied proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: PostgreSQL operators see missing pending-plugin warnings and session warnings that should have cleared.
Reason: This restores existing diagnostic contracts with no new option or persisted format; the maintainer-authored PR establishes direction.

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
Reviewed head: cb96c24a230e02606c77adbe049b97bb4eb20d8f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supply redacted shipped-CLI output demonstrating both PostgreSQL warning corrections, including a latest-stable upgrade with existing settings and data preserved.
Agent review details

How this fits together

The 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
Loading

Technical review

Best 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

  • Configured-engine status inspection keeps the original intent (945f6dd: Read PostgreSQL update history through the configured engine while preserving recovery inspection and bounded execution.)
  • Deadline and completed-result retention keeps the original intent (b9a72b5: Preserve completed history when optional enrichment stalls until the overall deadline.)
  • Migration warning presentation keeps the original intent (20bd4bd: Expose unfinished plugin migrations in update status without querying them during normal configuration reads.)
  • Recovery-set projection keeps the original intent (c7ee253: Inspect retained recovery evidence safely without restoring or modifying it; this PR relocates the existing projection unchanged.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +25, Tests +180. Total +205 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 91 66 +25
Tests 3 186 6 +180
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 277 72 +205

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Incorrect migration diagnostics affect PostgreSQL operators, but this report establishes no blocked update, lost data, or unavailable Gateway.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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:

  • P2: Incorrect migration diagnostics affect PostgreSQL operators, but this report establishes no blocked update, lost data, or unavailable Gateway.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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 execution lanes are retired.

Reviewed November 22, 2026, 7:52 PM ET / November 23, 2026, 00:52 UTC.

@vincentkoc
vincentkoc merged commit 3fade25 into main Nov 23, 2026
211 of 212 checks passed
@vincentkoc
vincentkoc deleted the fix/update-status-migration-database-20261123 branch November 23, 2026 01:02
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 23, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 23, 2026
…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)
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. cli CLI command changes size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant