Files
ajarbot/llm_interface.py
Jordan Ramos dd5beb11c2 Improve timeout error handling with actionable feedback
**Problem**: User frustrated that 10-minute timeout returned unhelpful
generic message "task may be too complex" when task "create a repo for
the dhcp course" timed out after 80 messages.

**Solution**: Enhanced timeout error to provide:
- Progress info (message count, last tool used)
- Complexity indicator (# of different tools)
- Actionable suggestions (break into sub-tasks, use delegate_task)

**Changes**:
- Track _last_message_count and _last_tool_names as instance vars
  (survive timeout unlike local vars in canceled async function)
- Update tracking variables in message loop
- Build multi-line error message with progress summary and suggestions
- Use chr(10) for newlines to avoid string literal corruption

**Impact**: Users now get helpful guidance instead of generic error when
complex tasks timeout, including suggestion to use new delegate_task tool
for parallel work.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-01 14:25:20 -07:00

32 KiB