-
Notifications
You must be signed in to change notification settings - Fork 188
Description
Problem:
When a session goes into waiting or idle state (e.g., asking a permission question or needing user input), the only way to surface this to the user is through the conductor heartbeat. This consumes AI tokens for what is essentially a mechanical task: "session X is waiting, here's what it said, forward the reply back."
Current workaround:
Users have to build a standalone notifier script that polls agent-deck list --json, reads session output, posts to Slack, tracks thread→session mappings, and routes replies back. This duplicates logic the bridge already partially has.
Proposed feature:
Add a native "session notifier" mode to the bridge (or as a new lightweight daemon) that:
- Polls for waiting/idle sessions — periodically checks non-conductor sessions via agent-deck list --json or even just implement next item leaving polls outside
- Posts output to Slack/Telegram — reads last output with session output -q and forwards it directly, tagged with session name
- Routes replies back — when the user replies in a Slack thread (or replies to a Telegram message), maps it back to the originating session and sends via session send
- Supports numbered choices — detects patterns like 1. Option A / 2. Option B in session output and renders them as interactive buttons (Slack Block Kit / Telegram inline keyboard). Button tap sends the number back to the session.
- Deduplicates — tracks posted outputs by hash to avoid spamming the same message
Key point: This should work with zero AI token consumption. It's pure CLI polling + messaging API. The conductor remains available for complex decisions and orchestration, but routine "session needs input" cases bypass it entirely.
Why native: The bridge already has Slack/Telegram connections, heartbeat loop, and session CLI wrappers. Adding this as a bridge mode (e.g., notify_idle_sessions = true in config.toml) would be ~100 lines of code in the right place vs. users reinventing it externally.