Skip to content

fix(discord): allow guarded channel permission management - #18

Draft
finn-atlas wants to merge 1 commit into
jai:fix/cosmo-queued-thread-2026-10-29from
finn-atlas:repair/discord-channel-permission-actions-20261108
Draft

finn-atlas wants to merge 1 commit into
jai:fix/cosmo-queued-thread-2026-10-29from
finn-atlas:repair/discord-channel-permission-actions-20261108

Conversation

@finn-atlas

@finn-atlas finn-atlas commented Nov 8, 2026 •

Copy link
Copy Markdown

Related: AI-934 — Expose guarded Discord channel permission actions for Cosmo

Source report: Discord thread

What Problem This Solves

Fixes: Cosmo cannot clear a Discord channel permission overwrite when the supported message tool does not expose the guarded permission mutation implemented by the Discord runtime.

User Impact

User impact: Authorized Discord operators can set or remove channel permission overwrites through the message tool without enabling wildcard inbound routing. Existing requester, ManageRoles, role-hierarchy, action-gate, and account checks remain in force.

Why This Change Was Made

The runtime already owns channelPermissionSet and channelPermissionRemove, including its authorization checks, but the public action vocabulary, schema, dispatch policy, target mapping, Discord discovery, and adapter dispatcher omit them. This change wires those existing guarded operations through as channel-permission-set and channel-permission-remove.

This ports the diagnosis and public wiring from openclaw/openclaw#124962 by Jialong(Bruce) Li, rebased onto Cosmo's deployed fork. The regression coverage is expanded at the public boundary.

Evidence

  • Reproduced on deployed revision cd436f0c05c36e354104b14d9ac34c79f27581c8: the incident room retains the Sentinel role's explicit ViewChannel deny (1024), while the message action vocabulary has no permission-write action.
  • Confirmed the selected finn Discord account intentionally disables its wildcard channel entry. Guild-wide metadata reads and non-allowlisted category reads remain blocked; this PR does not change that configuration.
  • 299 focused tests passed, covering public dispatch, trusted and rejected callers, runtime authorization, schema scoping, and target mapping.
  • 347 shared channel contract tests passed.
  • 3,336 Discord extension tests passed.
  • pnpm tsgo:core, pnpm tsgo:extensions, and pnpm tsgo:extensions:test passed.
  • oxfmt --check and git diff --check passed.
  • Commit 813ba652b5d8b34ce6b46b4d2600a720db20eb2d has a verified SSH signature from the provisioned FINN Atlas identity.
  • GitHub's Real behavior proof and dispatch checks passed. The fork's auto-response, label, and label-issues workflows fail before checkout because jai/OpenClaw has no GitHub App private-key input configured; no product test failed in those jobs.
  • Independent autoreview did not produce a report because the configured Codex reviewer returned HTTP 401. This PR stays draft until a valid independent review is completed.

Risk and Rollback

This exposes permission mutations under the existing Discord channels action gate. A trusted Discord requester still needs channel-scoped ManageRoles, and role targets remain subject to hierarchy checks. Invalid target types fail before a provider request.

Rollback: revert this commit, rebuild the prior deployed revision, restore the previous OpenClaw symlink, and restart only after confirming Cosmo has no active work. If the approved live overwrite change has already been applied, restore Sentinel to allow=0, deny=1024.

Port the public message-action wiring from openclaw#124962 onto the deployed fork while preserving the existing Discord authorization gates and adding public-boundary regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant