Repository navigation
fix: restore Discord metadata reads in official plugin installs - #147658
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: blocked before merge. Reviewed September 14, 2026, 5:23 AM ET / 09:23 UTC (Revision 3). ClawSweeper reviewWhat this changesRestores seven existing Discord metadata reads for verified official plugin installations, documents their access restrictions, and adds registered-provider HTTP regression coverage. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused fix: current main still excludes the seven metadata reads, and the merged prerequisite does not supersede it. No actionable introduced defect was found. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s shared message dispatcher authorizes agent requests before handing them to Discord. Discord then applies account and destination policies, performs REST requests, and returns metadata under the originating caller’s active authority. flowchart TD
A[Agent metadata request] --> B[Shared message dispatcher]
C[Verified plugin registration] --> B
B --> D[Discord account and destination checks]
D --> E[REST requests with lifetime checks]
E --> F[Metadata result]
B --> G[Reject unauthorized or stale request]
E --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +11, Tests +480, Docs +7. Total +498 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing Discord policy owners and ship the coordinated action opt-in with integrated package-loading and upgrade qualification. Do we have a high-confidence way to reproduce the issue? Yes, from source: an official external Discord registration requesting role-info or sibling-channel permissions falls outside main’s six-action allowlist and reaches the exact-current rejection. This read-only review did not execute tests. Is this the best way to solve the issue? Yes. Extending both existing opt-in lists reaches the established Discord handlers without duplicating access policy or granting authority to unverified adapters. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d99619cc4e68. LabelsLabel 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 (2 earlier review cycles)
|
93f554c to
7d073b9
Compare
|
Fixed: official Discord plugin installations can read bot permissions and guild metadata with the existing access and lifetime checks. |
…claw#147658) Restore bot-permission and guild metadata reads for verified official Discord plugins while preserving existing access and lifetime checks. Refs openclaw#115367.
Related: #115367
Builds on #143341, now merged into
main.What Problem This Solves
Agents using the official Discord plugin installed through npm or ClawHub can see metadata actions in the message tool, but allowed requests are rejected with an exact-current-conversation error before Discord can apply its configured access rules. This affects permission inspection, member and role information, emoji and channel lists, voice status, and scheduled-event lists. For example, inspecting the bot's permissions in an allowed sibling channel fails even though the bundled plugin supports that request.
User Impact
Restores the existing
permissions,member-info,role-info,emoji-list,channel-list,voice-status, andevent-listreads for verified official installations. Results retain their existing shapes, including guild roles, bounded emoji output, member presence when available, and a normal absent result for unknown voice state.Permission inspection still requires an allowed channel. Guild metadata still requires a guild allowed by the selected account's current configuration and unrestricted or wildcard channel access. Only direct operators retain the filtered-results relaxation for
channel-list. The existing coordinated core/plugin release requirement applies; this adds no setting, migration, or new Discord capability.Why This Change Was Made
Discord's explicit
readAuthorityActionslist covered its original six conversation reads. Qualifying the seven existing metadata reads through that list and the host's allowed read set lets their established provider gates run in verified official installations. Requiring both declarations keeps a shared action name from silently opting another adapter into more authority, including Matrix's mixedpermissionsaction.The existing read-authority mechanism retains the originating caller and registration through awaited work, queued requests, retries, and final results or errors. Provider code, account/requester/origin checks, token and action gates, and destination policies keep their existing owners. Revocation prevents subsequent requests and rejects stale completion; it cannot undo a request already sent. Message mutations, moderation, uploads, voice participation, event creation, and presence changes are outside this patch.
Two equivalent dispatcher simplifications reuse its prepared context and inline a single-use origin normalizer to satisfy the existing file-size guard.
Evidence
The new registered-provider regression suite validates advertised, schema-valid inputs and exercises the actual Discord handlers and REST client against a loopback HTTP server. All seven ordinary requests failed at the host gate before the change and now return their expected metadata using GET requests only.
All 45 integration cases passed, covering action/token denial, guild and channel restrictions, missing or mismatched origin/account context, unverified and legacy registrations, direct-versus-delegated channel listing, unknown voice state, current-channel emoji resolution, and stale results/errors/retries. Permission revocation after channel lookup prevents later bot-permission requests. Shared-runner controls return channel permissions with GETs only and reject seven user-alias forms, including an allowlisted numeric user, before any provider request.
The existing Discord/Slack HTTP authority suite, registered dispatcher/security cases, Discord provider behavior, REST fencing, emoji-cache/voice controls, and target/reaction-owner tests passed. The complete changed gate passed again on the rebased head, including core, extension and test type graphs, formatting, lints, docs and boundary guards. Its exact-head 80-case preflight and 395 additional source cases also passed. Independent review and the focused alias-test review found no actionable P0–P2 issues.
Fresh core and Discord packages built from the rebased head passed 57 scenarios each after native npm and canonical ClawHub installation (114 total), including all seven advertised reads, configured denials, registration/caller revocation, and stale successes, errors and retries. The probe uses existing compiled exports verified against the core tarball and real installer/loader records. The ClawHub audit verifies the complete package/artifact/download request sequence and native integrity checks. Fixture processes joined cleanly and source/artifact hashes remained unchanged. The build used a private
2026.9.5release fixture through the canonical release-version and package helpers; it did not publish a release.Shared compatibility qualification in fix: restore context reads for installed official Discord and Slack plugins #143341 passed four expected old-core API rejections and both actual published
2026.9.3/2026.9.4update drivers. Those runs preserved configuration, plugin and workspace records and passed four existing reads after upgrade. The receipt applies to the unchanged prerequisite contracts; the Discord-specific installed scenarios above establish this patch’s consumer behavior.The focused regression can be run with:
Both commits are now rebased onto the merged prerequisite on
main; the four affected files are byte-identical to the earlier tested patch. Fresh integrated loading/build proof passed on this head, and its current ClawSweeper review is Platinum with no actionable code or security findings. Hosted CI completed with one unrelated Docker helper assertion failure and its aggregate failure. The same assertion was reproduced on the main baseline with identical consumed inputs; #148118 owns that repair. Current HTTP evidence uses synthetic credentials and provider responses; it is not authenticated Discord or production rollout evidence.