Skip to content

feat: master trigger pause toggle in /config menu #294

@nathanschram

Description

Summary

Add a master pause/resume toggle for the trigger system (crons + webhooks) accessible from the /config menu in Telegram. This gives users a quick way to temporarily disable all triggers without editing the TOML file.

Background

v0.35.1 introduced comprehensive trigger features:

Currently, triggers.enabled can only be toggled by editing untether.toml. During debugging, incident response, or when the bot is misbehaving, users need a faster way to pause all triggers.

Proposed UX

On the /config → 📡 Trigger page, add a "Triggers: paused / active" toggle above the existing all/mentions mode selector.

📡 Trigger mode

⏰ Triggers: active
  1 cron (daily-review, 9:00 AM daily)
  1 webhook (github-push)

[⏸ Pause triggers]  [← Back]

---
Respond to messages:
[✓ All]  [Mentions]
[Clear override]  [← Back]

When paused:

⏰ Triggers: ⏸ paused
  Crons and webhooks are temporarily disabled.

[▶️ Resume triggers]  [← Back]

Design decisions needed

  1. Persistence: Should the pause survive a restart?

    • Option A: In-memory only (lost on restart) — simpler, mirrors /at behaviour
    • Option B: Persisted to chat prefs — survives restart but adds state
    • Recommendation: Option A (in-memory) — triggers auto-resume on restart, which is the safe default
  2. Scope: Per-chat or global?

    • Option A: Global (pauses all triggers across all chats)
    • Option B: Per-chat (only pauses triggers targeting this specific chat)
    • Recommendation: Global — triggers are a system-wide concern and partial pauses would be confusing
  3. Interaction with /ping: When triggers are paused, /ping should show:

    🏓 pong — up 3d 14h 22m
    ⏸ triggers paused (1 cron, 1 webhook suspended)
    
  4. Interaction with cron scheduler: Paused crons skip their tick. run_once crons that would have fired during the pause are NOT consumed — they fire when resumed.

Implementation notes

  • TriggerManager already has an enabled field; add a runtime paused: bool that overrides it
  • Cron scheduler checks manager.paused before firing
  • Webhook server returns 503 when paused (not 404 — the routes still exist)
  • /ping indicator updated to show paused state
  • /config trigger page shows current pause state + trigger count

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions