Skip to content

fix(channels): resolve registered plugins before agent workspace - #124709

Merged
altaywtf merged 3 commits into
openclaw:mainfrom
Leon-SK668:leon/directory-plugin-resolution-20260817
Aug 22, 2026
Merged

altaywtf merged 3 commits into
openclaw:mainfrom
Leon-SK668:leon/directory-plugin-resolution-20260817

Conversation

@Leon-SK668

@Leon-SK668 Leon-SK668 commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #124679

What Problem This Solves

openclaw directory could not use an explicitly selected, already registered channel plugin in a multi-agent installation. The shared installable-channel resolver tried to choose a default agent workspace before checking the active channel registry, so AgentSelectionRequiredError aborted directory lookups even though no workspace discovery or installation was needed.

Why This Change Was Made

The directory CLI now explicitly opts into resolving an exact registered channel before workspace-scoped catalog work. Other users of the shared resolver, including channel login and logout, keep their existing catalog/install snapshot sequence. Unregistered plugins remain on the explicit-owner path.

User Impact

Users with multiple configured agents can run directory commands such as openclaw directory self --channel telegram when that channel is already registered. Unregistered workspace plugins still require an explicit system-agent owner before discovery or installation.

Evidence

  • Real CLI proof on Node 24.15.0 used an isolated temporary state/config with agents.ownership="explicit", two agents with no default owner, and the repo IRC plugin loaded through plugins.load.paths; no live account, credential, or network connection was used.
  • OPENCLAW_STATE_DIR=<temp> OPENCLAW_CONFIG_PATH=<temp>/openclaw.json pnpm openclaw directory groups list --channel irc --json exited 0 and returned the configured #proof-room group through the real plugin directory adapter.
  • The same command with --channel missing-proof-channel exited 1 with Multiple agents are configured, but this operation has no explicit owner, proving unresolved plugins still use the workspace-owner gate.
  • Current-main reconciliation: merge head d879c3d520204c4cbfcdf4d02f4c729370a22a5b combines business head 19286d4b7aa6410f8065e74da22beee619007d47 with frozen upstream/main 47399310a08e67c926875a3da8252467585dac6e. The PR-owned delta remains the same four files (+117/-2) while preserving main's explicit agentId workspace resolver and the directory-only registered-plugin fast path.
  • Node 24.15.0: node scripts/run-vitest.mjs src/commands/channel-setup/channel-plugin-resolution.test.ts (8/8 passed) and node scripts/run-vitest.mjs src/cli/directory-cli.test.ts src/cli/channel-auth.test.ts (45/45 passed).
  • Focused oxfmt passed on all four changed files. Focused oxlint passed with config/tsconfig/oxlint.core.json; git diff --check 47399310a08e67c926875a3da8252467585dac6e..HEAD passed.
  • Fresh local autoreview on the reconciled head reported no accepted/actionable findings and judged the patch correct (confidence 0.98).
  • Prior exact-head GitHub CI completed on fe6d29ae9c0b7907f2b7fc21e88620181f3bab19 without failures. Exact merge-head CI started in run 32094322651; this body records the immediate post-push snapshot and does not claim a terminal result.

AI Assistance

AI assistance was used for source analysis, implementation, tests, real CLI validation, and PR drafting. The contributor reviewed the final diff and validation evidence.\n\n### Identity refresh (2026-08-20)\n\n- Metadata-only history rewrite: new head a7c783ed51ab8c1d7e8ee23d209a96c5370ec9db; all rewritten commits now use Leon-SK668 <[email protected]> for both author and committer. Commit trees, messages, timestamps, parent structure, and the PR business diff are unchanged.\n- No product code or proof claim changed in this refresh. Existing focused tests/CI/review evidence remains behaviorally applicable to the unchanged tree; this new head is available for the normal exact-head checks.\n

@clawsweeper

clawsweeper Bot commented Aug 16, 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 commands Command implementations size: S labels Aug 16, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 8:35 AM ET / 12:35 UTC.

ClawSweeper review

What this changes

The PR lets directory commands use an already loaded channel plugin before workspace-scoped plugin discovery.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: this is a focused, correct candidate fix for the linked multi-agent directory failure; exact-head CI is still incomplete.

Priority: P1
Reviewed head: 50718fbf1bb30e5cc3168745e8fefc4bba3b66b9

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused owner-boundary repair with direct CLI evidence and targeted fallback coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR provides redacted after-fix terminal output from the real CLI and a matching unloaded-plugin negative case.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR provides redacted after-fix terminal output from the real CLI and a matching unloaded-plugin negative case.
Evidence reviewed 7 items Current-main failure path: Current main resolves the default agent workspace before checking the active channel plugin, so an explicit multi-agent configuration can fail before an already active plugin is considered.
Scoped repair: The branch checks only the loaded registry before workspace resolution, and only the directory CLI opts into that behavior.
Caller isolation: Channel login/logout retain the shared resolver’s prior workspace/catalog sequence because they do not pass the new directory-only option.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw directory --help

Result: PASS (completed)

pnpm openclaw directory --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-124709-TNePQL/target$ pnpm openclaw directory --help
$ node scripts/run-node.mjs directory --help
pnpm openclaw directory --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 97.95 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.6s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 11.5s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 3654ms (slowest: built plugin control-plane loads 2648ms)
│
◇

OpenClaw 2026.8.1 (50718fb) — All your chats, one OpenClaw.

Usage: openclaw directory [options] [command]

Lookup contact and group IDs (self, peers, groups) for supported chat channels

Options:
  -h, --help  Display help for command

Commands:
  groups      Group directory
  peers       Peer directory (contacts/users)
  self        Show the current account user

Examples:
  openclaw directory self --channel slack
    Show the connected a
… output truncated …

Assertions:

  • PASS expect_output: Lookup contact and group IDs

How this fits together

Directory commands select a channel plugin and invoke its directory adapter for identity or group lookups. The shared resolver normally needs an agent workspace for catalog and installation work; this change bypasses that work only for an already active plugin.

flowchart LR
  A[Directory command with channel] --> B[Directory resolver]
  B --> C{Loaded channel plugin?}
  C -->|yes| D[Directory adapter]
  C -->|no| E[Agent workspace and catalog]
  E --> F[Scoped plugin or installation]
  F --> D
  D --> G[Identity or group output]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed; the current exact-head checks are still incomplete.
Agent review details

Security

None.

PR surface

Source +22, Tests +93. Total +115 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 24 2 +22
Tests 2 93 0 +93
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 117 2 +115

Review metrics

Metric Value Why it matters
Production versus test LOC production +21, tests +93 The modest production growth creates one caller-gated ordering mode and has focused regression coverage for both fast and fallback paths.

Technical review

Best possible solution:

Retain the directory-only loaded-registry preflight and merge after exact-head checks complete successfully.

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

Yes—current main resolves an agent workspace before the active-plugin lookup; a multi-agent configuration without a default owner reaches the reported failure.

Is this the best way to solve the issue?

Yes—the shared resolver owns the ordering, while the directory-only opt-in preserves workspace discovery and installation for unloaded plugins and login/logout.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: Without this repair, multi-agent operators can be blocked from the directory command family despite selecting an already active channel.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR provides redacted after-fix terminal output from the real CLI and a matching unloaded-plugin negative case.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides redacted after-fix terminal output from the real CLI and a matching unloaded-plugin negative case.

Evidence

What I checked:

Likely related people:

  • Marvinthebored: Current-main blame ties the workspace-first resolver and directory call site to this revision; older history was unavailable locally. (role: recent current-main code-path contributor; confidence: medium; commits: 575146a0a914; files: src/commands/channel-setup/channel-plugin-resolution.ts, src/cli/directory-cli.ts)

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-16T21:29:49.963Z sha fe6d29ae9c0b7907f2b7fc21e88620181f3bab19 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-16T21:34:49.784Z sha fe6d29ae9c0b7907f2b7fc21e88620181f3bab19 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-16T21:54:10.489Z sha fe6d29ae9c0b7907f2b7fc21e88620181f3bab19 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-16T22:55:48.715Z sha fe6d29ae9c0b7907f2b7fc21e88620181f3bab19 :: needs changes before merge. :: [P1] Use the loaded-only plugin lookup
  • reviewed 2026-08-17T01:54:11.764Z sha a01fbaf4463ddf0514519b07279339ef53c272e2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T01:44:54.710Z sha 19286d4b7aa6410f8065e74da22beee619007d47 :: needs changes before merge. :: none
  • reviewed 2026-08-18T03:39:02.690Z sha d879c3d520204c4cbfcdf4d02f4c729370a22a5b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-20T14:47:32.720Z sha a7c783ed51ab8c1d7e8ee23d209a96c5370ec9db :: needs maintainer review before merge. :: none

@Leon-SK668
Leon-SK668 force-pushed the leon/directory-plugin-resolution-20260817 branch 3 times, most recently from 3841ced to fe6d29a Compare August 16, 2026 21:24
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Aug 16, 2026
@Leon-SK668

Leon-SK668 commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor Author

CI regression repair pushed at fe6d29ae9c0b7907f2b7fc21e88620181f3bab19.

The registered-plugin fast path is now explicitly owned by the directory CLI. Other callers, including channel login/logout, retain the catalog/install snapshot sequence. The early registry read is also skipped unless that directory-only option is enabled.

Fresh proof after rebasing onto upstream/main (63a3a958f4f):

  • Node 24: node scripts/run-vitest.mjs src/commands/channel-setup/channel-plugin-resolution.test.ts src/cli/channel-auth.test.ts src/cli/directory-cli.test.ts (52/52)
  • focused oxlint + oxfmt: pass
  • git diff --check: pass
  • fresh autoreview: clean, no accepted/actionable findings (confidence 0.97)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Leon-SK668

Copy link
Copy Markdown
Contributor Author

Real multi-agent CLI proof is now added to the PR body.

Isolated proof config:

  • agents.ownership="explicit"
  • two agents, neither marked default
  • IRC plugin loaded through plugins.load.paths
  • one configured group, #proof-room
  • no live account, credential, or network connection

Actual repo CLI result for the registered plugin:

$ pnpm openclaw directory groups list --channel irc --json
[
  {
    "kind": "group",
    "id": "#proof-room",
    "name": "#proof-room"
  }
]
exit 0

Sibling negative proof with the same config:

$ pnpm openclaw directory groups list --channel missing-proof-channel --json
{
  "error": "Multiple agents are configured, but this operation has no explicit owner. Select an agent explicitly; CLI callers can pass --agent <id>, channels can add a binding, and ambient services can set their agentId target."
}
exit 1

Plugin provenance and temporary filesystem paths were redacted; neither affects the directory-owner behavior under test.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 16, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Aug 17, 2026
@Leon-SK668
Leon-SK668 force-pushed the leon/directory-plugin-resolution-20260817 branch from a01fbaf to 19286d4 Compare August 18, 2026 01:34
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 18, 2026
@Leon-SK668
Leon-SK668 force-pushed the leon/directory-plugin-resolution-20260817 branch from d879c3d to a7c783e Compare August 20, 2026 14:38
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 20, 2026
@altaywtf
altaywtf force-pushed the leon/directory-plugin-resolution-20260817 branch from a7c783e to 50718fb Compare August 22, 2026 12:29
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 22, 2026
@altaywtf
altaywtf merged commit 4f59053 into openclaw:main Aug 22, 2026
188 checks passed
@altaywtf

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 23, 2026
…nclaw#124709)

* fix(channels): resolve registered plugins before agent workspace

* fix(channels): scope registered plugin fast path to directory

* fix(channels): restrict directory fast path to loaded plugins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

[Bug]: openclaw directory unusable in multi-agent installs; AgentSelectionRequiredError advises a --agent flag that does not exist

2 participants