Repository navigation
fix(plugins): native commands execute the selected plugin - #121544
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 9:59 PM ET / August 11, 2026, 01:59 UTC. ClawSweeper reviewWhat this changesThe PR carries the plugin command selected for a native Discord, Telegram, or Slack menu through execution, avoiding a later global command-name rematch across plugin-registry reloads. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for explicit maintainer review: no concrete P0–P2 defect surfaced, but this is a protected maintainer PR that creates a durable Plugin SDK contract and changes reload lifecycle behavior. Priority: P2 Review scores
Verification
How this fits togetherChannel plugins build native command menus from the active plugin registry, then pass inbound command turns into the shared reply pipeline. This change preserves the selected plugin owner through that handoff and coordinates registry replacement with channel-account restarts. flowchart LR
A[Plugin registry] --> B[Native command catalog]
B --> C[Selected command decision]
C --> D[Discord Telegram Slack handler]
D --> E[Shared reply pipeline]
E --> F[Selected plugin execution]
A --> G[Registry reload]
G --> H[Restart affected channel accounts]
H --> B
Decision needed
Why: The PR intentionally expands a public SDK surface and defines upgrade-sensitive plugin lifecycle semantics; repository policy requires explicit maintainer ownership for that contract. Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA redacted Telegram Desktop capture of a colliding command before and after reload would directly demonstrate the user-visible selected-owner guarantee. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm the focused SDK contract, then merge only after exact-head CI and a final maintainer review confirm the selected-owner and account-reload semantics; no safe net-neutral replacement is established because the new owner boundary needs explicit dispatch and lifecycle state. Do we have a high-confidence way to reproduce the issue? Yes from source, at medium confidence: current main constructs native catalogs then later resolves plugin commands through mutable normalized-name matching; final-head execution was not available locally. Is this the best way to solve the issue? Yes, provisionally: carrying the finalized catalog decision is cleaner than re-matching command text, but maintainers must accept the resulting public SDK lifecycle contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 58a538767c4c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (15 earlier review cycles; latest 8 shown)
|
bc45769 to
ac23392
Compare
c25cffd to
cc21801
Compare
|
@clawsweeper re-review Maintainer decision recorded in the PR body: approve The exact head is |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
0b28cc0 to
d14b293
Compare
50ce938 to
d5dfd37
Compare
|
Merged via squash.
|
…21544) * fix(plugins): preserve selected command identity * test(telegram): use scoped command registries * test(telegram): isolate command runtime fixtures * test(telegram): warm native command runtime * refactor(plugins): keep command metadata private * fix(plugins): accept synchronous command handlers * fix(plugins): scope command drain bypass to live execution * test(telegram): use scoped command registry fixtures * test(telegram): isolate native menu runtime fixtures * test(telegram): isolate login session store * test(telegram): surface login flow failures * test(telegram): preload native login module * test(telegram): scope native command registries * fix(plugins): complete command dispatch contracts * fix(plugins): break command dispatch import cycles * fix(plugins): stabilize command dispatch contracts * fix(channels): keep plugin dispatch options internal * fix(plugins): keep command dispatch carrier opaque * test(channels): align delivery adapter fixtures * test(delivery): align custody ownership coverage * test(delivery): align latest queue reconciliation * test(channels): drop obsolete delivery wrappers * fix(plugins): rebind channel reload starts * fix(plugins): scope command catalog reloads * fix(ci): align current runtime contracts * chore(plugin-sdk): refresh API baseline
What Problem This Solves
Fixes an issue where a native command shown by Discord, Telegram, or Slack could execute a different plugin command than the one selected for that channel's command catalog. This could happen when normalized names or provider aliases collided, discovery order differed, channel scopes excluded one candidate, or the active plugin registry changed between catalog construction and invocation.
Why This Change Was Made
The command catalog now returns a closed decision: either an opaque dispatch capability bound to the selected plugin registration and registry generation, or an explicit non-plugin winner. Discord, Telegram, Slack, and core reply dispatch carry that decision through to execution instead of reconstructing command text and rematching a global registry.
The focused
openclaw/plugin-sdk/plugin-command-runtimesurface keeps plugin identity private while sharing candidate metadata and registry-bound execution. Channel plugins explicitly retain a finalized plugin-command catalog, and the Gateway records that fact at the exact account task that owns its handlers. Registry replacement therefore pre-stops and restarts only those accounts, leaves native-disabled siblings untouched, binds replacement starts to the newly active registry, and drains admitted command executions before cleanup. Existing shipped command APIs remain compatibility wrappers around the canonical runtime.Maintainer contract decision: this focused subpath is accepted as the durable third-party channel-plugin interface. Opaque dispatch identity, exact registry-generation binding, explicit catalog retention, and retirement semantics are intentional compatibility guarantees; the generic reply pipeline carries only the closed ownership decision through a dependency-free leaf contract.
User Impact
Native commands now execute the same plugin owner that won menu and interaction planning. Built-in commands, skills,
/login, provider aliases, and channel-scoped exclusions cannot accidentally fall through to a differently scoped plugin. Plugin reload preserves in-flight command ownership, restarts only accounts retaining registry-bound handlers, and cannot revive a retired generation through inherited request scope.Evidence
d5dfd3744f55cfad3a198ece72323ed8b4b4708f.50ce9380411427318403525ef05b867651443db3passed: https://github.com/openclaw/openclaw/actions/runs/31450631414. This is retained as historical proof and is not final-head CI.7bb22191d8abd6fed4c160963ee57451d65d1fc1.git diff --checkpassed.memory-dreaming-sweepQA scenario passed after config reload; Telegram returned ready on the replacement registry instead of remaining in recovery with a retired-generation error.AI-assisted; the implementation, public SDK commitment, proof, and remaining gap were reviewed and understood before submission.