feat: Phase 2.7+3 — full integration, config update, systemd unit

- Wire all goroutines in main.go: watcher, quota monitor, account
  switcher, dispatcher, janitor, and 10s state flush loop
- Add missing sections to config.example.yaml: notifications,
  dispatcher, watcher, janitor
- Add scripts/claude-failover.service systemd unit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu 2026-04-15 00:15:06 +00:00
parent d4260f71b4
commit 28f82a66c8
5 changed files with 390 additions and 1 deletions

View file

@ -82,3 +82,35 @@ mcp_http:
bearer_token_env: CLAUDE_FAILOVER_BEARER
# Paths exposed (all read-only except explicitly listed mutating routes).
enable_trigger: true # allow /trigger/dispatch, /trigger/swap
# ---------------------------------------------------------------------------
# notifications
# ---------------------------------------------------------------------------
notifications:
telegram_token_env: TELEGRAM_BOT_TOKEN
telegram_chat_id_env: TELEGRAM_CHAT_ID
resend_api_key_env: RESEND_API_KEY
notify_email_env: CLAUDE_FAILOVER_NOTIFY_EMAIL
# ---------------------------------------------------------------------------
# dispatcher
# ---------------------------------------------------------------------------
dispatcher:
projects_dir: /home/ubuntu/projects
idle_timeout: 60m
prompt_timeout: 30s
max_dispatch_per_task: 3
# ---------------------------------------------------------------------------
# watcher
# ---------------------------------------------------------------------------
watcher:
interval: 30s
done_signal_dir: /tmp
idle_timeout: 60m
# ---------------------------------------------------------------------------
# janitor
# ---------------------------------------------------------------------------
janitor:
interval: 5m