openclaw-vainplex/src/discord/monitor
Lucas Czekaj 483fba41b9
feat(discord): add exec approval forwarding to DMs (#1621)
* feat(discord): add exec approval forwarding to DMs

Add support for forwarding exec approval requests to Discord DMs,
allowing users to approve/deny command execution via interactive buttons.

Features:
- New DiscordExecApprovalHandler that connects to gateway and listens
  for exec.approval.requested/resolved events
- Sends DMs with embeds showing command details and 3 buttons:
  Allow once, Always allow, Deny
- Configurable via channels.discord.execApprovals with:
  - enabled: boolean
  - approvers: Discord user IDs to notify
  - agentFilter: only forward for specific agents
  - sessionFilter: only forward for matching session patterns
- Updates message embed when approval is resolved or expires

Also fixes exec completion routing: when async exec completes after
approval, the heartbeat now uses a specialized prompt to ensure the
model relays the result to the user instead of responding HEARTBEAT_OK.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: generic exec approvals forwarding (#1621) (thanks @czekaj)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-01-24 20:56:40 +00:00
..
allow-list.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
exec-approvals.test.ts feat(discord): add exec approval forwarding to DMs (#1621) 2026-01-24 20:56:40 +00:00
exec-approvals.ts feat(discord): add exec approval forwarding to DMs (#1621) 2026-01-24 20:56:40 +00:00
format.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
listeners.ts fix: unblock discord listener concurrency 2026-01-20 19:30:32 +00:00
message-handler.inbound-contract.test.ts fix: normalize session keys and outbound mirroring 2026-01-24 11:57:11 +00:00
message-handler.preflight.ts fix: enforce explicit mention gating across channels 2026-01-24 11:09:33 +00:00
message-handler.preflight.types.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
message-handler.process.test.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
message-handler.process.ts fix: stabilize typing + summary merge 2026-01-23 23:34:30 +00:00
message-handler.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
message-utils.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
native-command.ts fix: avoid Discord /tts conflict 2026-01-24 09:58:06 +00:00
provider.ts feat(discord): add exec approval forwarding to DMs (#1621) 2026-01-24 20:56:40 +00:00
reply-context.ts feat: make inbound envelopes configurable 2026-01-18 18:50:37 +00:00
reply-delivery.ts fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 2026-01-23 18:39:25 +00:00
system-events.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
threading.test.ts refactor: prune legacy group prefixes 2026-01-17 08:47:25 +00:00
threading.ts fix(discord): autoThread ack reactions + exec approval null handling (#1511) 2026-01-23 20:01:15 +00:00
typing.ts refactor: unify typing callbacks 2026-01-23 23:33:32 +00:00