From f81d55d7ea7f0ef6a9d5b0b7f01d0baa06ee5b54 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 4 Apr 2026 18:28:14 +0100 Subject: [PATCH] docs: refresh native approval routing refs --- docs/channels/discord.md | 15 ++++++++++++--- docs/plugins/sdk-channel-plugins.md | 2 ++ docs/tools/exec-approvals.md | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/channels/discord.md b/docs/channels/discord.md index b4eaca35e3a..db7f2b8a9a7 100644 --- a/docs/channels/discord.md +++ b/docs/channels/discord.md @@ -944,8 +944,8 @@ Default slash command settings: - - Discord supports button-based exec approvals in DMs and can optionally post approval prompts in the originating channel. + + Discord supports button-based approval handling in DMs and can optionally post approval prompts in the originating channel. Config path: @@ -967,7 +967,16 @@ Default slash command settings: - remote-mode support via `gateway.remote.*` when applicable - URL overrides are override-safe: CLI overrides do not reuse implicit credentials, and env overrides use env credentials only - Exec approvals expire after 30 minutes by default. If approvals fail with unknown approval IDs, verify approver resolution and feature enablement. + Approval resolution behavior: + + - IDs prefixed with `plugin:` resolve through `plugin.approval.resolve`. + - Other IDs resolve through `exec.approval.resolve`. + - Discord does not do an extra exec-to-plugin fallback hop here; the id + prefix decides which gateway method it calls. + + Exec approvals expire after 30 minutes by default. If approvals fail with + unknown approval IDs, verify approver resolution, feature enablement, and + that the delivered approval id kind matches the pending request. Related docs: [Exec approvals](/tools/exec-approvals) diff --git a/docs/plugins/sdk-channel-plugins.md b/docs/plugins/sdk-channel-plugins.md index 76a5acb2781..05d82714129 100644 --- a/docs/plugins/sdk-channel-plugins.md +++ b/docs/plugins/sdk-channel-plugins.md @@ -67,6 +67,8 @@ Most channel plugins do not need approval-specific code. - If a channel can infer stable owner-like DM identities from existing config, use `createResolvedApproverActionAuthAdapter` from `openclaw/plugin-sdk/approval-runtime` to restrict same-chat `/approve` without adding approval-specific core logic. - If a channel needs native approval delivery, keep channel code focused on target normalization and transport hooks. Use `createChannelExecApprovalProfile`, `createChannelNativeOriginTargetResolver`, `createChannelApproverDmTargetResolver`, `createApproverRestrictedNativeApprovalCapability`, and `createChannelNativeApprovalRuntime` from `openclaw/plugin-sdk/approval-runtime` so core owns request filtering, routing, dedupe, expiry, and gateway subscription. - Native approval channels must route both `accountId` and `approvalKind` through those helpers. `accountId` keeps multi-account approval policy scoped to the right bot account, and `approvalKind` keeps exec vs plugin approval behavior available to the channel without hardcoded branches in core. +- Preserve the delivered approval id kind end-to-end. Native clients should not + guess or rewrite exec vs plugin approval routing from channel-local state. - `createApproverRestrictedNativeApprovalAdapter` still exists as a compatibility wrapper, but new code should prefer the capability builder and expose `approvalCapability` on the plugin. For hot channel entrypoints, prefer the narrower runtime subpaths when you only diff --git a/docs/tools/exec-approvals.md b/docs/tools/exec-approvals.md index cd71b44dd64..acd4b5b6612 100644 --- a/docs/tools/exec-approvals.md +++ b/docs/tools/exec-approvals.md @@ -544,6 +544,8 @@ Shared behavior: - Slack approvers can be explicit (`execApprovals.approvers`) or inferred from `commands.ownerAllowFrom` - the requester does not need to be an approver - the originating chat can approve directly with `/approve` when that chat already supports commands and replies +- native Discord approval buttons route by approval id kind: `plugin:` ids go + straight to plugin approvals, everything else goes to exec approvals - native Telegram approval buttons follow the same bounded exec-to-plugin fallback as `/approve` - when native `target` enables origin-chat delivery, approval prompts include the command text - pending exec approvals expire after 30 minutes by default