Repository navigation
fix: avoid bundled plugin discovery after selecting a message channel - #147492
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: needs maintainer review before merge. Reviewed September 13, 2026, 7:34 PM ET / 23:34 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR preserves the selected channel adapter’s destination aliases throughout message routing, avoiding conflicting defaults and unnecessary bundled-plugin discovery. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: fetched main and the latest release retain the faulty discovery fallback. No blocking correctness or security finding was identified, and the prior review has no unresolved findings. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s message tool and Gateway translate message-action arguments into channel destinations. Selected plugin metadata guides normalization before existing account, conversation, and dispatch checks run. flowchart TD
A[Message tool or Gateway request] --> B[Selected channel metadata]
B --> C{Adapter already selected?}
C -->|Yes| D[Use selected aliases or known absence]
C -->|No| E[Discover bootstrap aliases]
D --> F[Normalize destination]
E --> F
F --> G[Validate account and conversation]
G --> H[Dispatch channel action]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +41, Tests +120. Total +161 across 12 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep destination interpretation with the selected adapter and reserve bootstrap discovery for callers that have not selected one. Do we have a high-confidence way to reproduce the issue? Yes, from source: a selected send adapter with a roomId alias can have that destination overlooked and an account default inserted, causing normalization to reject conflicting targets. Tests were inspected but not executed during this read-only review. Is this the best way to solve the issue? Yes. Carrying the existing selected metadata, including known absence, repairs the shared owner boundary without adding another registry, configuration option, or public plugin API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 88112a840a43. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Fixed: message routing preserves the selected channel's target aliases without rediscovering bundled plugins. |
…openclaw#147492) Preserve the selected channel's target aliases without rediscovering bundled plugins during message routing.
What Problem This Solves
Message routing can discard target-alias metadata after selecting a channel adapter. A missing alias specification from that adapter was treated as a reason to look up bundled metadata, while some target-presence checks consulted the bootstrap adapter even when selected aliases were available.
That mixes two sources of truth. An installed adapter can have different aliases from the bundled adapter with the same channel ID. Its native destination can be overlooked, or an unrelated bundled field can be interpreted as a destination. In the Gateway send regression, overlooking the selected alias causes an account-default target to be inserted; normalization then rejects the conflicting destinations. The fallback also loads bundled plugin code unnecessarily: a source-checkout Slack read with
limit=1spent most of its time in this discovery path.User Impact
Message actions consistently use the selected adapter's destination metadata. Selected aliases are recognized, an adapter's known absence of aliases stays absent, and account defaults or session-derived destinations are used only when appropriate. Poll-echo and group-reply routing use the catalog captured by the tool.
Callers that have not selected an adapter or captured a catalog retain bootstrap discovery. Account validation, cross-context checks, and final dispatch authority remain in their existing owners; this change does not add plugin grants or change read-authority lifetime, configuration, persistence, or the public SDK contract.
Why This Change Was Made
The selected adapter or captured catalog already owns this information. The internal alias helpers now distinguish an alias specification, known absence (
null), and no selection (undefined). Only the last state permits bootstrap discovery.That same fact is carried through normalization, target-presence and resource checks, session destination recovery, poll-echo/group-reply handling, and the Gateway's default-target decision. Core legacy aliases and cheap screening of standard message parameters remain intact. No new registry or cache is introduced.
The regression fixtures also declare aliases on the selected adapter. In particular, the shared
list-pinsfixture previously declaredchatIdonly in its bootstrap mock; correcting that fixture preserves its existing dispatch assertion without restoring the faulty fallback.Evidence
7a7549b1aadand pass after this repair. They cover selected aliases and absence, resource-versus-delivery handling, canonical session destination recovery, a retained poll catalog after registry replacement, and Gateway default-target conflicts. Existing controls cover unselected discovery, conflicting targets, implicit-target exclusions, opaque resource IDs for direct operators, and poll account/route/expiry boundaries.node scripts/run-vitest.mjs src/infra/outbound/message-action-*.test.ts --reporter=dotpassed all 479 action tests after the fixture correction.2dea84a9518, Testbox passednode scripts/check-changed.mjs --base 7a7549b1aad,pnpm build, andpnpm test:contracts:channels. Final-head CI is green, including build, type, lint, guard, and contract checks. Independent review found no blocking issues; ClawSweeper reviewed that exact head as Platinum.The native timing comparison ran the message tool, caller wrapper, dispatcher, and bundled Slack adapter against a synthetic HTTP server on the same Linux VM, with Node 24.19.0 and pnpm 12.3.4. Both revisions completed the
limit=1read.These are instrumented source-checkout fixture measurements, not installed-user latency estimates. The comparison used a local HTTP fixture, not an external Slack service.