Mohamed Boudra 5b53f4a7ce refactor: make sendPrompt non-blocking by default with optional maxWait
Change sendPrompt to return immediately by default instead of blocking, allowing the orchestrator to continue while agents process in the background. Add optional maxWait parameter for cases where waiting is needed.

Changes:
- sendPrompt now returns { didComplete, stopReason? } immediately if no maxWait
- Background promise handles completion and updates agent status via protocol
- Optional maxWait parameter races completion vs timeout, returns didComplete status
- Update send_agent_prompt MCP tool to expose maxWait parameter
- Agent continues processing in background even if maxWait expires
- Orchestrator can poll get_agent_status or get_agent_activity to check progress

This prevents orchestrator from blocking on long-running agent tasks while maintaining protocol-based completion tracking.

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2025-10-21 16:54:47 +02:00
Description
Languages
TypeScript 98.1%
JavaScript 1.3%
Shell 0.1%
Swift 0.1%