Skip to content

fix(update): retained Voice Call stores block activation - #174523

Closed
vishnusenthil-16 wants to merge 3 commits into
openclaw:mainfrom
vishnusenthil-16:fix/update-shared-store-schema
Closed

vishnusenthil-16 wants to merge 3 commits into
openclaw:mainfrom
vishnusenthil-16:fix/update-shared-store-schema

Conversation

@vishnusenthil-16

@vishnusenthil-16 vishnusenthil-16 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Related: #174913

Related: #173676

What Problem This Solves

Git updates can pass candidate rehearsal, then fail activation and leave the Gateway stopped when a retained Voice Call shared-state database is present.

PR #173676 added discovery of that store, but the activation check still incorrectly treats it as an agent database. An affected 2026.10.4 update reported voice-calls/state/openclaw.sqlite; expected schema 27, found 25 and state-migrated-no-rollback, even though the database was a valid shared-state store at schema 25.

User Impact

The updated verifier accepts retained default and configured Voice Call stores, including when the plugin is disabled. It still rejects incomplete active-agent migrations and checks the primary shared-state schema. Database contents, schemas, configuration, and rollback checks are unchanged.

An updater process that was started from an older installation keeps its previously loaded verifier. Its first update to a version containing this fix can therefore still encounter the old failure; this change takes effect when the fixed updater runs in a new process.

Why This Change Was Made

Reuse resolveStatePortRoots, the same resolver used by database discovery, to exclude shared-state stores from the agent-schema predicate. Retained stores stay in the snapshot and rollback inventory under the existing opaque-capture contract. This adds no schema metadata, migration, or worker-protocol change.

Evidence

  • Reproduced through the real schema reader and activation verifier using fresh synthetic SQLite stores: primary shared state alone passed; adding the default Voice Call shared store produced the observed agent-schema error.
  • Three regression cases failed before the fix and passed afterward: default store, configured voice-call store, and configured @openclaw/voice-call store, with plugins disabled.
  • node scripts/run-vitest.mjs src/cli/update-cli/update-command-migrated.test.ts --maxWorkers=1: 35/35 passed after conflict resolution, including existing incomplete-agent, pending-deletion, and rollback checks. Vitest duration: 60.28 seconds; wrapper shard including runtime preparation: 112.52 seconds.
  • pnpm build passed after conflict resolution (2m 30.3s).
  • Core and updater-test typechecks, targeted type-aware lint, formatting, and git diff --check passed.
  • Independent review found no actionable issues. The production change is five added lines; tests add 51 lines.

Conflict resolution at a2fa6235c7e preserves main's resolveClientCredentialStorePath exclusion alongside the retained shared-store exclusion. The PR remains a five-line production change plus 51 test lines relative to merged main.

Real managed update proof (native macOS)

Ran two actual openclaw update --tag <local-tarball> --yes --json operations using a separately installed npm prefix, a fresh named profile, synthetic configuration/session data, a unique loopback port, and a real launchd LaunchAgent. No mocked update, restart, RPC, or schema-inspection results.

  1. Published 2026.10.3 CLI → patched 2026.10.4: succeeded / finished, 144.535 s; launchd PID 7867 → 10802. The candidate-admission path adopted the update driver. Gateway build identity, RPC, /readyz HTTP 200, and the durable conversation were verified afterward.
  2. Stopped only the disposable Gateway and confirmed its PID exited. Seeded a valid retained voice-calls/state/openclaw.sqlite with role global, schema/user version 25, while the candidate agent schema is 27. Plugins remained disabled. A fresh patched CLI then updated to the same candidate relabeled 2026.10.5-first-hop.0 using the repository's fixture stamper to force a real second activation: succeeded / finished, 150.200 s; launchd PID 11850 → 13655. RPC/build identity, /readyz, conversation content, Gateway settings, and workspace settings passed afterward.
  3. The retained Voice Call database passed SQLite integrity checks and had the same full-file SHA-256 before and after: 0288318a3ba15d9573087d77b7f0f5d50a9bb940d82d4db1cbe8330b4458655e. Its sentinel row and schema stayed unchanged. The disposable service was then removed; the existing live Gateway kept the same PID throughout.
Sanitized results from the real CLI and durable update ledger
published entry: openclaw --profile <proof> update --tag <candidate.tgz> --yes --json
runId: aa606163-b1cf-4624-a19d-8807f8dadcc8
status: ok; durable status: succeeded; phase: finished
before.version: 2026.10.3; after.version: 2026.10.4
serviceRestartSafe: true; serviceRunning: true; versionMatch: true
channelsReady: true; readyz: true; settled: true; pluginErrors: []

fresh patched entry: openclaw --profile <proof> update --tag <stamped-candidate.tgz> --yes --json
runId: 569bcd72-4e7e-4b49-9825-117e2c30c920
status: ok; durable status: succeeded; phase: finished
before.version: 2026.10.4; after.version: 2026.10.5-first-hop.0
serviceRestartSafe: true; serviceRunning: true; versionMatch: true
channelsReady: true; readyz: true; settled: true; pluginErrors: []

retained store, before == after:
role: global; userVersion: 25; schemaVersion: 25
sentinel: voice-calls-preserved-174523
integrity_check: ok
sha256: 0288318a3ba15d9573087d77b7f0f5d50a9bb940d82d4db1cbe8330b4458655e

Scope and reproducibility: this exercises the native macOS npm-package managed-update path and shared finalization verifier, not every Git-only activation branch. The retained store is added between hops; the first hop does not claim an already-loaded old verifier is repaired. The old-driver limitation above still applies. No provider inference or external channel traffic was used.

The candidate was built from the resolved tracked tree that became merge commit a2fa6235c7e; build metadata still names its pre-merge parent 0f875b33f91a because the build preceded the merge commit. Candidate tarball SHA-256: 080fdfdee5e5bc9b5893a8c0ce4fd972c1a46e3861d3aaba8df2bdcea5e17d01. The second tarball changes fixture version metadata, not the fix.

Packaging caveat: the canonical tarball checker initially found a missing dist/windows-security-helper.exe referenced by bundled @openclaw/fs-safe code. The exact helper from the installed @openclaw/[email protected] dependency was staged into local build output, then canonical packaging and integrity checks passed. No source change or checker exclusion was used; Windows behavior is not claimed. An initial Docker attempt was discarded after cgroup OOM kills; only the completed native macOS runs above are counted as behavior proof.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@vishnusenthil-16
vishnusenthil-16 marked this pull request as ready for review October 16, 2026 18:10
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Oct 16, 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. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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 Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Exclude retained Voice Call shared-state databases from agent-schema verification during update activation.

Example: A disabled Voice Call plugin retains voice-calls/state/openclaw.sqlite at schema 25 while the candidate agent schema is 27.

  • Before: Activation reports an incomplete agent migration and can leave the Gateway stopped.
  • After: Activation accepts the retained shared store while continuing to verify active agent databases.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with shipped-entry-point proof and useful regression coverage; exact-head CI has an unresolved Matrix conformance failure.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Sanitized native macOS CLI output exercises published-driver admission and a fresh patched updater activating with the retained schema-25 store; durable completion, Gateway readiness, preserved settings and conversation, and unchanged database bytes resolve the prior proof request, with the already-loaded older-driver limitation explicitly retained.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Updates can fail activation and leave the Gateway stopped solely because an unused Voice Call shared database is retained.
Reason: The patch restores correct database-family classification without adding configuration, schemas, or a competing owner.

Regression provenance

Regression provenance — verified: source commit 17e833bc9895 by Peter Steinberger; canonical PR #173676 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

This PR fixes a current-main activation bug with a focused change and sufficient managed-update proof; the failing PostgreSQL check still needs CI attribution.

Priority: P1
Reviewed head: a2fa6235c7e16f71e01d2f45feb2cc30f11609e7

Before merge

None.

Findings

None.

Agent review details

How this fits together

The updater inventories databases, runs candidate migration and activation, then checks schema readiness and rollback compatibility before completing the update.

flowchart TD
  A[Update CLI] --> B[Database discovery]
  B --> C[Candidate migration and activation]
  C --> D[Schema verification]
  E[Shared store resolver] --> B
  E --> D
  D --> F[Completion or recovery]
Loading

Technical review

Best possible solution:

Use the discovery owner's shared-store paths to classify activation entries while preserving primary-state, active-agent, and rollback checks.

Do we have a high-confidence way to reproduce the issue?

Current-main discovery includes retained Voice Call shared stores, and activation compares them against the agent schema; the supplied before/after regression results corroborate this path without executing target code during review.

Is this the best way to solve the issue?

The existing resolver provides a small, consistent repair at the activation classifier, with no duplicate discovery policy or change to persisted data.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4579af08ce8a.

Provenance checked

  • Agent readiness verification keeps the original intent (b379364: Prevent candidate restart with unfinished agent migrations after activation Doctor failure.)
  • Retained shared-store discovery keeps the original intent (17e833b: Include retained and configured Voice Call shared databases in port, backup, and update inventory even when disabled.)
  • Held-store and rollback handling keeps the original intent (a72e9a3: Accept deliberately held deleted-agent stores during activation while retaining rollback verification.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b379364 adds src/cli/update-cli/update-command-migrated.ts:71 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b37936459a68; files: src/cli/update-cli/update-command-migrated.ts)

PR surface

Source +5, Tests +51. Total +56 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 51 0 +51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 56 0 +56

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: An ordinary managed update can reject a valid retained database and leave the Gateway unavailable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-16T18:26:53.494Z sha 0f875b3 :: needs real behavior proof before merge. :: none

Reviewed October 16, 2026, 3:09 PM ET / 19:09 UTC (Revision 2).

@vishnusenthil-16

Copy link
Copy Markdown
Contributor Author

@clawsweeper please reevaluate this PR at a2fa6235c7e16f71e01d2f45feb2cc30f11609e7. The conflicts are resolved, preserving main’s client-credential exclusion, and the real behavior proof is now complete.

Ran two actual CLI managed updates directly on macOS with a separate npm installation, fresh named profile, synthetic state, unique port, and real launchd service:

Check Published CLI → patched candidate Fresh patched CLI → stamped candidate
Version 2026.10.3 → 2026.10.4 2026.10.4 → 2026.10.5-first-hop.0
Durable result succeeded / finished succeeded / finished
Run ID aa606163-b1cf-4624-a19d-8807f8dadcc8 569bcd72-4e7e-4b49-9825-117e2c30c920
launchd PID 7867 → 10802 11850 → 13655
Update duration 144.535 s 150.200 s

Both used openclaw --profile <proof> update --tag <local-tarball> --yes --json. Both reported serviceRestartSafe, serviceRunning, versionMatch, channelsReady, readyz, and settled as true, with no plugin errors. Independent Gateway RPC/build-identity and /readyz HTTP 200 checks passed afterward. The durable conversation and Gateway/workspace settings survived.

Between hops, the disposable Gateway was stopped and its PID exit confirmed before adding the retained Voice Call database. Plugins stayed disabled. The database was a valid global shared store at schema/user version 25, while the expected agent schema was 27. The second update succeeded with that store present.

SQLite integrity checks passed, the sentinel voice-calls-preserved-174523 survived, and the full database SHA-256 was identical before and after:

0288318a3ba15d9573087d77b7f0f5d50a9bb940d82d4db1cbe8330b4458655e

The proof service and plist were removed afterward. The live Gateway was untouched and retained its original PID.

Scope/limitations:

  • This proves the native macOS npm-package managed-update path and shared finalization verifier, not every Git-only activation branch. The first hop used candidate admission/driver adoption. The retained store was added between hops, so this does not claim an already-loaded older verifier is repaired; that limitation remains documented.
  • The second candidate uses the repository’s fixture version stamper to force activation of the same patched code. No update/restart/RPC results were mocked.
  • The package was built from the resolved tree that became a2fa6235c7e; build metadata retains pre-merge parent 0f875b33f91a because the build preceded the merge commit. Candidate SHA-256: 080fdfdee5e5bc9b5893a8c0ce4fd972c1a46e3861d3aaba8df2bdcea5e17d01.
  • Packaging initially found a missing Windows helper referenced by bundled @openclaw/fs-safe code. Staging the exact helper from installed @openclaw/[email protected] into local build output made the canonical tarball integrity check pass. No source change or checker exclusion was used; Windows behavior is not claimed. Docker attempts were discarded after resource problems; only the completed native runs count as proof.

Also passed after conflict resolution: 35/35 updater tests, full build, core/updater-test typechecks, focused lint, formatting, and diff checks. Please reassess the “needs real behavior proof before merge” finding using these results.

@vishnusenthil-16

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
steipete added a commit that referenced this pull request Oct 17, 2026
Use the existing state inventory's agent ownership and registrations to
limit agent schema checks to agent databases. Keep retained plugin stores
in snapshot and rollback verification without imposing the agent schema.
Preserve explicit agent-directory overrides and held deleted-agent stores.

Add enabled/disabled default and configured plugin-store regressions,
and keep the schema inspection cases in their own bounded test file.

Fixes #174913
Supersedes #174523, thanks @vishnusenthil-16.

Co-authored-by: vishnusenthil-16 <[email protected]>
steipete added a commit that referenced this pull request Oct 17, 2026
…er activation (#174973)

Managed updates could fail after activation and leave the Gateway stopped because the post-activation verifier treated retained plugin shared-state stores (such as the Voice Call state database) as agent databases and required the agent schema. Verification now uses the inventory's existing ownership and registration facts to compare only real agent databases against the agent schema, keeping backup/rollback coverage and the held deleted-agent exemption. Live: an isolated managed update with retained plugin stores returned status ok, both stores stayed byte-identical, and the replacement Gateway passed health and readiness. Supersedes #174523, thanks @vishnusenthil-16.

Fixes #174913

Co-authored-by: vishnusenthil-16 <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

Thanks for this! We landed the fix in #174973 (76752e0), which supersedes this PR and credits you as co-author: post-activation verification now compares only real agent databases against the agent schema, so retained plugin shared-state stores no longer fail managed updates.

@steipete steipete closed this Oct 17, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…er activation (openclaw#174973)

Managed updates could fail after activation and leave the Gateway stopped because the post-activation verifier treated retained plugin shared-state stores (such as the Voice Call state database) as agent databases and required the agent schema. Verification now uses the inventory's existing ownership and registration facts to compare only real agent databases against the agent schema, keeping backup/rollback coverage and the held deleted-agent exemption. Live: an isolated managed update with retained plugin stores returned status ok, both stores stayed byte-identical, and the replacement Gateway passed health and readiness. Supersedes openclaw#174523, thanks @vishnusenthil-16.

Fixes openclaw#174913

Co-authored-by: vishnusenthil-16 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants