Skip to content

Add pause/resume support for threads #8

@alexknowshtml

Description

@alexknowshtml

Summary

Allow users to pause message processing in a thread by typing natural language commands like "pause" or "stop".

How Andy Does It

This is language-based, handled by Claude, not the Discord bot directly.

  1. User types "pause" or "stop" in thread
  2. Claude (via Andy Core) recognizes the intent
  3. Andy Core sets thread to paused state
  4. When bot sends next message to Andy Core, response includes { status: 'paused' }
  5. Bot reacts with ⏸️ emoji
  6. While paused, messages are held (not processed)
  7. User types "resume" or "continue"
  8. Claude tells Andy Core to resume
  9. Response includes { status: 'resumed', processingPending: N }
  10. Bot reacts with ▶️ and processes held messages

Implementation Options for Cord

Option A: Simple keyword detection (bot-side)

  • Bot checks for "pause", "stop", "wait" keywords
  • Stores paused state in SQLite paused_threads table
  • While paused, messages are held in a queue
  • "resume", "continue", "go" resumes processing
  • Pros: Self-contained, no Claude involvement
  • Cons: Less flexible, might trigger on unrelated messages

Option B: Claude-driven (matches Andy)

  • Pass all messages to Claude
  • Claude decides if it's a pause/resume command
  • Returns special response format to indicate state change
  • Pros: Natural language understanding
  • Cons: Costs tokens even for pause commands

Recommended: Option A

For an open-source generic tool, simple keyword detection is more predictable.

Schema Addition

CREATE TABLE paused_threads (
    thread_id TEXT PRIMARY KEY,
    paused_at TEXT NOT NULL
);

CREATE TABLE held_messages (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    thread_id TEXT NOT NULL,
    message_content TEXT NOT NULL,
    user_id TEXT NOT NULL,
    username TEXT NOT NULL,
    created_at TEXT NOT NULL
);

Keywords

  • Pause: "pause", "stop", "wait", "hold"
  • Resume: "resume", "continue", "go", "unpause"

Priority

Lower - nice to have for long-running threads

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions