Skip to content

name: Alert-to-action fixer loop description: forge-monitor warning/critical Telegram alerts carry a "Spawn fixer" inline button; one tap spawns a Fable session pre-loaded with the alert context and replies with the session URL. type: reference


Alert-to-action fixer loop

Shipped 2026-06-09 (bot feature batch item 6, commit a8be560).

Flow

  1. scripts/forge_monitor.py pages warning/critical: writes alert context to data/forge-monitor-alerts/<id>.json and calls scripts/forge_notify.sh with FORGE_NOTIFY_BUTTON="Spawn fixer|fixer:<id>".
  2. forge_notify.sh send_manager attaches the inline keyboard when that env var is set (generic: any caller can use Label|callback_data).
  3. Tap lands on the notify bot poller; forge_telegram_callbacks.py routes prefix fixer to scripts/forge_alert_fixer.py handle_callback.
  4. The handler forks a DETACHED child (forge_alert_fixer.py --spawn <id> --chat <chat>; no threads, no poll-loop blocking), answers the tap instantly, and the child runs forge_spawn_session.sh fable fixer-<id> <alert prompt> then sends the claude.ai/code URL to the chat.

Ops notes

  • Log: logs/alert-fixer.log. Alert contexts accumulate in data/forge-monitor-alerts/; tiny json files, prune opportunistically.
  • Verified end to end 2026-06-09: synthetic tap to live Fable session in 17s, URL delivered.
  • The spawned fixer's standing orders: diagnose root cause, fix only if safe and reversible, otherwise report with a recommendation.

[Claude Code]