Skip to content

[P0] Prompt delivery verification — capture-pane after send-keys #1

@OneStepAt4time

Description

@OneStepAt4time

Problem

tmux send-keys is fire-and-forget. ~20% of prompts don't arrive because:

  • Enter key race condition (500ms delay helps but doesn't guarantee)
  • CC might be in a state that doesn't accept input (permission prompt, thinking)
  • No way to verify the prompt actually appeared in CC's input

Expected Behavior

After sending a prompt via send-keys, Aegis should verify delivery by:

  1. capture-pane after a short delay
  2. Check if the sent text appears in the pane output
  3. Retry if not found (up to 3 attempts with increasing delay)
  4. Return delivery status in the API response

Files to modify

  • src/tmux.ts — add verifyDelivery() method
  • src/session.ts — use verification in sendMessage()
  • src/server.ts — return delivery status in POST /send response

Acceptance Criteria

  • After send-keys, capture-pane verifies the text appeared
  • Retry logic (3 attempts, exponential backoff)
  • API returns { delivered: true/false }
  • Tests for verification logic
  • Delivery rate >99% (from current ~80%)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions