Ctrl+C handling

t-511·WorkTask·
·
·
Created3 weeks ago·Updated3 weeks ago

Dependencies

Description

Edit

Handle Ctrl+C gracefully:

  • During input: clear line (haskeline default)
  • During agent execution: cancel and return to prompt
  • Don't exit the interactive session

Timeline (5)

🔄[human]Open → InProgress3 weeks ago
🔄[human]InProgress → Done3 weeks ago
Complete[engineer]{"verified":true}3 weeks ago
💬[human]3 weeks ago

Implemented Ctrl+C handling using Haskeline's withInterrupt and handleInterrupt combinators.

Changes:

  • Modified replLoop in Omni/Agent.hs to wrap runAgent call in interrupt handlers
  • On Ctrl+C during execution: shows '[Interrupted - returning to prompt]' and continues session
  • During input prompt: Haskeline default behavior (clear line, return to prompt)
  • Conversation history is preserved on interrupt
  • Session does NOT exit on Ctrl+C

Manual testing required: 1. Test Ctrl+C at input prompt (should clear and return) 2. Test Ctrl+C during agent execution (should show interrupt message and continue) 3. Test Ctrl+C during tool execution 4. Test normal /quit command still works

Ready for manual verification.