Repository navigation
fix(update): prevent retained plugin stores from blocking activation - #174973
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThe PR limits agent-schema verification to agent-owned databases while retaining plugin stores in backup and rollback checks. Example: A disabled Voice Call plugin retains voice-calls/state/openclaw.sqlite at shared schema 26 while the candidate requires agent schema 28.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current managed-update failure using existing inventory ownership, with no introduced correctness defect found; required CI remains unresolved. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe managed updater combines candidate schema versions with database inventory facts to determine activation readiness and rollback compatibility. flowchart TD
A[Managed update] --> B[Candidate database inventory]
B --> C[Agent ownership and registrations]
B --> D[Database schema versions]
C --> E[Activation verifier]
D --> E
E --> F[Finalization and rollback decision]
Technical reviewBest possible solution: Land the inventory-based classification repair while preserving active-agent validation, retained-store contents, and rollback inventory. Do we have a high-confidence way to reproduce the issue? Current-main discovery includes retained plugin shared stores, and the activation predicate compares their versions against the agent schema; the linked report supplies a matching live failure, while this read-only review executed no target code. Is this the best way to solve the issue? Using inventory ownership fixes the shared classification boundary without plugin-specific exclusions or schema changes, while retaining registered, configured, environment-selected, and held-agent behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7807f20085de. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +14, Tests +98, Docs +4, Other +1. Total +117 across 6 files. Added test files: 1. View PR surface stats
Review metrics
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 October 16, 2026, 10:22 PM ET / October 17, 2026, 02:22 UTC. |
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]>
deb9ea6 to
e88f537
Compare
…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]>
What Problem This Solves
Fixes updates failing during activation when retained plugin databases are mistaken for agent databases, leaving the Gateway stopped.
Fixes #174913. Supersedes #174523, thanks @vishnusenthil-16.
User Impact
Updates can activate while default or configured plugin shared-state stores are retained, including when their plugin is disabled. Their data stays in the backup and rollback inventory. Actual agent databases still require the candidate agent schema, and the primary shared database still requires the shared-state schema.
Why This Change Was Made
The activation verifier treated almost every inventoried SQLite file as an agent database. It now consumes the inventory's existing agent ownership and registration facts instead of maintaining path-specific exclusions. Explicit agent-directory overrides and the held deleted-agent exemption remain covered. Core contains no plugin-id special case.
Release-note context: update activation now preserves retained plugin shared-state stores without comparing them to the agent schema; fixes #174913, with thanks to @vishnusenthil-16 for #174523. The contributor branch was read only; this implementation was written against main.
Production: +19/-5, net +14 lines. The necessary growth carries existing inventory facts and preserves unregistered environment-selected agent databases; the two special-case store exclusions are removed. Tests: +334/-237, net +97; test routing: +2; docs: +4. Existing schema cases moved into a separate file to keep test time bounded. No schema, dependency, or configuration changes.
Evidence
src/cli/update-cli/update-command-migrated.ts:80–88;git log -S 'entry !== shared'traces the predicate tob37936459a68. The previous held-agent fix from fix(update): allow held deleted-agent databases to keep older schemas #172975 remains intact.Agent database migration did not finish … expected schema 28, found 25. Coverage includes enabled and disabled plugins, plus both explicit agent-directory environment overrides.core-test-cli-updatetest-type graph, scoped core/script oxlint, six-file oxfmt, andgit diff --checkpassed. Madge: 0 cycles. Fullcheck:changedwas not run: its SQLite inventory step was omitted under the lane's local gate budget; PR CI supplies the broad proof.status: ok, durable runstatus: succeeded, 380491 ms, from2026.10.4to the canonical same-schema fixture2026.10.5-first-hop.0. Candidate Doctor, lint, config, plugin, recovery, and Gateway-startup checks passed. Both retained stores were explicitly snapshotted. Both remained at shared schema 26 (agent schema 28) with their sentinel rows and exact SHA-256 hashes unchanged. The replacement Gateway passed RPC health and/readyz, then was stopped cleanly; no proof Gateway remains running.Live commands and environment limits
All commands used an isolated
HOME,OPENCLAW_STATE_DIR, configuration path, profile, npm prefix, and temporary directory under this worktree's.artifacts/l1660/. The Gateway listened on the verified-free loopback port 57264. The artifact came from this patch, with the native package helper and canonical same-schema fixture helper; nothing was published to npm.Native macOS service installation refused the isolated home by design, so this is a foreground live update, not a native-service restart proof. Native continuation is covered by the focused tests. The nested npm bin symlink initially selected the enclosing dirty checkout and stopped before installation; invoking the actual installed package entry point selected npm correctly. The first package check found missing SDK declarations/UI assets from the runtime-only test build; generating them made the full tarball integrity check pass. npm's lifecycle policy was satisfied by the explicit rebuild above.
The successful update recorded advisory warnings for the intentionally unavailable disabled plugin, isolated native service management, deferred inspections, the synthetic token fixture, and Darwin process inspection (
unterminated Darwin environment, retaining the updater runtime). Those warnings did not turn the update into a failure. Raw logs are not attached because they include host paths and automatically generated diagnostic context.