Skip to content

fix(plugins): keep inventory available without a system owner - #123378

Merged
fuller-stack-dev merged 6 commits into
openclaw:mainfrom
fuller-stack-dev:fix/plugin-control-plane-owner-graceful-v2
Aug 14, 2026
Merged

fuller-stack-dev merged 6 commits into
openclaw:mainfrom
fuller-stack-dev:fix/plugin-control-plane-owner-graceful-v2

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where plugin inventory, registry refresh, and install post-processing failed when an explicit multi-agent installation had no configured system owner. A local plugin could be copied into managed storage and then removed by compensation because ambient reporting tried to select an agent workspace.

Why This Change Was Made

Plugin control-plane inventory now uses one ownership resolver: preserve an explicit workspace, otherwise prefer agents.defaults.systemAgent.agentId, retain sole/legacy compatibility, and omit workspace discovery when no owner can be proved. Ownerless results still inventory bundled, managed, and global plugins, carry an actionable workspace-scope-omitted warning, and never select the first roster entry.

The persisted installed-plugin index records the exact selected workspace_dir in one same-version nullable TEXT column. This fences cached workspace plugins from another owner while allowing a later system-owner configuration to refresh and self-heal workspace discovery. No schema-version bump is required.

User Impact

Operators can list, refresh, and install shared-scope plugins before assigning a system owner. Human and JSON output make the partial workspace scope visible. Configuring a system owner later restores that owner's workspace plugins on the next refresh. Explicit workspace callers and sole/legacy installations keep their existing behavior.

Evidence

  • Current-main red at f66a2c6a2944: ownerless plugins list --json and plugins registry --refresh --json both exit 1 with owner selection. Local install copies the plugin, then exits 1, removes the managed directory, and persists empty install/plugin records.
  • Source-blind built-CLI validation: 10 reachable contracts passed, 0 failed, including reversed roster order, system-owner changes, sole/legacy ownership, global managed inventory, persisted-scope fencing, self-heal, and idempotent refresh. The two conditional explicit-workspace mutation probes are not exposed by the public CLI.
  • Focused Vitest: 19 files passed; 445 tests passed and 1 skipped.
  • pnpm build: passed, including 35 built plugin control-plane module checks, SDK exports, and Control UI build.
  • pnpm tsgo:core, pnpm db:kysely:check, pnpm lint:kysely, type-aware focused oxlint, oxfmt, and git diff --check: passed.
  • Exact CI regression follow-up: schema maintenance (19 tests) and built-CLI Doctor persistence (1 test) passed; follow-up autoreview was clean at 0.99.
  • Autoreview: clean; no accepted/actionable findings.

Production delta: +214/-46 (net +168). Test and test-support delta: +418/-25. The production growth owns the central resolution/diagnostic contract and the persisted cross-agent scope fence; the redundant persisted scope column was removed before publication.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. 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 Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 9:17 PM ET / August 14, 2026, 01:17 UTC.

ClawSweeper review

What this changes

The PR makes plugin inventory and managed-plugin operations return shared-scope results with a warning when an explicit multi-agent installation has no configured system owner.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 4 items remain

Keep open for human maintainer review: this MEMBER-authored, maintainer-labeled PR has detailed command-level proof, but the review sandbox failed before any local source, history, scoped-policy, or exact-head diff inspection could run. Likely related people: fuller-stack-dev (low-confidence routing from the PR discussion and commits).

Priority: P2
Reviewed head: cd4e86486e976d14492cccea5a226a30b9d54421
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The supplied runtime proof is useful, but unavailable local inspection prevents an independent exact-head patch-quality verdict.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR discussion contains detailed after-fix built-CLI and SQLite upgrade evidence, including ownerless partial inventory and later system-owner self-heal; private paths are represented only as temporary fixtures.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR discussion contains detailed after-fix built-CLI and SQLite upgrade evidence, including ownerless partial inventory and later system-owner self-heal; private paths are represented only as temporary fixtures.
Evidence reviewed 3 items Review infrastructure failure: The required read-only repository inspection could not start: the sandbox rejected pwd && rg --files -g 'AGENTS.md' -g 'SKILL.md' with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; source, history, and scoped-policy claims are therefore not independently verified.
Contributor runtime proof: The maintainer-authored PR comment reports an exact-head built-CLI ownerless multi-agent run, lazy addition of workspace_dir TEXT, system-owner self-heal, idempotent refresh, and explicit-workspace preservation.
Persisted-scope surface: Provided PR metadata identifies a nullable workspace_dir addition to the installed-plugin index and workspace-scope invalidation logic, making upgrade behavior compatibility-sensitive.
Findings None None.
Security None None.

How this fits together

Plugin control-plane commands assemble bundled, managed, global, and workspace plugins for CLI and management operations. Agent configuration determines whether workspace-scoped discovery can safely enrich that shared inventory and persisted index.

flowchart LR
  Config[Agent configuration] --> Resolver[Workspace ownership resolver]
  Explicit[Explicit workspace argument] --> Resolver
  Resolver --> Decision{Owner proven?}
  Decision -->|yes| Workspace[Workspace plugin discovery]
  Decision -->|no| Shared[Shared plugin inventory]
  Workspace --> Index[Persisted plugin index]
  Shared --> Warning[Partial-scope warning]
  Index --> CLI[CLI and management results]
  Warning --> CLI
Loading

Decision needed

Question Recommendation
Does the exact current head preserve existing workspace-scoped plugin inventories while safely returning a warned shared-scope result for ownerless explicit multi-agent installations? Verify exact-head upgrade behavior: Review the current head’s resolver callers and run the documented old-database, ownerless, owner-selection, and explicit-workspace scenarios before merge.

Why: This PR changes compatibility-sensitive workspace selection and persisted index state, and this review worker could not independently inspect the source or exact merged head.

Before merge

  • Resolve merge risk (P1) - The read-only review environment failed before independent exact-head source, history, scoped-AGENTS, and upgrade-path inspection; do not treat this review as an approval.
  • Resolve merge risk (P1) - Changing ambient workspace selection plus a persisted plugin-index scope can affect existing multi-agent inventories after upgrade, despite the supplied positive CLI evidence.
  • Complete next step (P2) - The MEMBER-authored, maintainer-labeled PR needs an exact-head human compatibility review because this worker’s read-only repository inspection could not execute.
Agent review details

Security

None.

PR surface

Source +168, Tests +392, Generated +1. Total +561 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 15 214 46 +168
Tests 17 417 25 +392
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 1 0 +1
Other 0 0 0 0
Total 33 632 71 +561

Review metrics

Metric Value Why it matters
Production versus test delta production +168 net; tests and test support +393 net (PR-reported) The sizeable production growth implements resolver, diagnostics, and persisted-scope behavior and needs exact-head owner-boundary review.
Persisted index surface 1 nullable SQLite column added The new workspace scope field changes how cached plugin inventory is associated across upgrades.

Stored data model

Persistent data-model change detected: database schema: src/state/openclaw-state-db.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, serialized state: src/plugins/installed-plugin-index-store.test.ts, serialized state: src/state/openclaw-state-db.generated.d.ts, serialized state: src/state/openclaw-state-db.test.ts, vector/embedding metadata: src/plugins/management-service.owner-routing.test.ts, and 3 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Verify the persisted-scope upgrade path (recommended)
    Before merge, confirm on the exact head that legacy indexes, ownerless inventories, and later system-owner selection refresh without retaining another workspace’s plugins.
  2. Pause pending exact-head review
    Do not merge until a reviewer can independently inspect the final resolver and SQLite compatibility path.

Technical review

Best possible solution:

Have a maintainer with a working checkout verify the exact head’s ownerless, explicit-workspace, sole/legacy, and upgrade/self-heal paths before deciding whether to merge.

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

Unclear. The PR supplies a concrete ownerless multi-agent built-CLI scenario, but the review sandbox failed before it could inspect or run the current checkout.

Is this the best way to solve the issue?

Unclear. A single ownership resolver and scope-aware persisted index appear directionally appropriate, but exact-head callers and sibling runtime behavior were not available for independent comparison.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 4fcac7415d52.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR discussion contains detailed after-fix built-CLI and SQLite upgrade evidence, including ownerless partial inventory and later system-owner self-heal; private paths are represented only as temporary fixtures.

Label justifications:

  • P2: The reported failure affects plugin control-plane operations in explicit multi-agent setups but is not an emergency runtime outage.
  • merge-risk: 🚨 compatibility: The PR changes ambient workspace selection and adds persisted plugin-index scope state used by existing installations.
  • merge-risk: 🚨 session-state: Cached plugin inventory is now fenced by the selected workspace, so upgrade and refresh semantics need verification.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR discussion contains detailed after-fix built-CLI and SQLite upgrade evidence, including ownerless partial inventory and later system-owner self-heal; private paths are represented only as temporary fixtures.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR discussion contains detailed after-fix built-CLI and SQLite upgrade evidence, including ownerless partial inventory and later system-owner self-heal; private paths are represented only as temporary fixtures.

Evidence

What I checked:

  • Review infrastructure failure: The required read-only repository inspection could not start: the sandbox rejected pwd && rg --files -g 'AGENTS.md' -g 'SKILL.md' with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; source, history, and scoped-policy claims are therefore not independently verified.
  • Contributor runtime proof: The maintainer-authored PR comment reports an exact-head built-CLI ownerless multi-agent run, lazy addition of workspace_dir TEXT, system-owner self-heal, idempotent refresh, and explicit-workspace preservation. (a4258a6b458f)
  • Persisted-scope surface: Provided PR metadata identifies a nullable workspace_dir addition to the installed-plugin index and workspace-scope invalidation logic, making upgrade behavior compatibility-sensitive. (src/plugins/installed-plugin-index-store.ts, cd4e86486e97)

Likely related people:

  • fuller-stack-dev: The PR commits and the supplied maintainer verification comment cover the workspace resolver, persisted index, and upgrade proof; local history could not be inspected. (role: PR author and exact-head verification reporter; confidence: low; commits: 2e3322e9d6ae, a4258a6b458f; files: src/plugins/control-plane-workspace.ts, src/plugins/installed-plugin-index-store.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Have a maintainer verify the exact-head resolver callers and persisted-index compatibility scenario before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-14T00:15:27.976Z sha a4258a6 :: needs maintainer review before merge. :: none

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Maintainer verification for the ClawSweeper review at exact head a4258a6b458fab05c40075b57294249f34e9d483:

  • Built and ran that exact head through pnpm openclaw; runtime postbuild verified 36 plugin control-plane modules.
  • Created a real pre-change database with the unmodified current-main CLI at f66a2c6a2944. PRAGMA table_info(installed_plugin_index) confirmed workspace_dir was absent.
  • Ran exact-head plugins list --json against that database with explicit main + gadget and no system owner. It completed with workspaceScope: "omitted", returned no Gadget workspace plugin, and emitted workspace-scope-omitted.
  • The same first open lazily added exactly one bare nullable column: workspace_dir TEXT, notnull=0, no default, no key.
  • Added agents.defaults.systemAgent.agentId: "gadget" and ran exact-head registry refresh twice. Both results selected /tmp/openclaw-red-f66/gadget-workspace, contained only gadget-upgrade-plugin from that workspace, and had no diagnostics. This proves upgrade self-heal and idempotence.
  • Imported the exact-head built runtime load-context module under an ownerless explicit multi-agent config while passing workspaceDir: "/tmp/explicit-runtime"; the resolved context returned that exact explicit workspace unchanged.
  • pnpm deadcode:full, 44 focused tests, and the second autoreview pass are green after the CI export cleanup.

Maintainer decision: the compatibility and persisted-scope boundaries are directly verified and acceptable for merge. The optional Rank-up transcript is intentionally skipped because public session-log insertion requires separate explicit approval; the PR body and this comment carry the reproducible command-level evidence instead.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 14, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Maintainer owner decision on reviewed head cd4e86486e976d14492cccea5a226a30b9d54421: accepted. I independently inspected the resolver, all control-plane callers, persisted-index fencing, same-version SQLite compatibility, and the remaining mutation boundary. Exact-head upgrade proof covers legacy DB open, ownerless warned inventory, later system-owner self-heal, idempotent refresh, and explicit workspace preservation; focused integration is 40/40, all 87 substantive CI checks and the required gate are green, and scripts/pr prepare-run passed without changing the reviewed tree. This completes the optional Rank-up maintainer verification; the compatibility/session-state risk is accepted for the documented graceful-degradation contract.

@fuller-stack-dev
fuller-stack-dev merged commit 08224cd into openclaw:main Aug 14, 2026
130 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/plugin-control-plane-owner-graceful-v2 branch August 14, 2026 02:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
…aw#123378)

* fix(plugins): degrade inventory without system owner

* fix(plugins): keep workspace resolver internals private

* fix(plugins): align workspace persistence compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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