Commit Graph

3 Commits

Author SHA1 Message Date
Aaron Ring
9f84b8c266 Exec approvals: improve batching text + retries 2026-01-26 22:27:22 -08:00
Aaron Ring
340e947d49 feat(exec-approvals): batch approval for rapid-fire commands
When an agent issues multiple commands requiring approval in rapid
succession, users previously had to approve each one individually.
This adds smart batching that collects requests and presents them as a
single message listing all pending commands:

- Initial 1.5s window collects rapid-fire commands
- Extended 10s window when session already has pending approvals
- Maximum 30s cap prevents indefinite batching
- `/approve-batch <batch-id> allow-once|deny` command works on all channels

On Telegram, the batched message includes "Approve All (N)" / "Deny All"
inline buttons. Other channels receive the same grouped text and can use
the `/approve-batch` command manually.

Also fixes a command-routing bug where `/approve-batch` was intercepted
by the `/approve` handler due to prefix matching, causing batch buttons
to silently fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 22:27:22 -08:00
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