**Problem**: Task "create a gitea repo" completed 86 messages but returned generic fallback "Task completed (86 messages, $0.71)" with no actual work done. Zero tool calls tracked, zero assistant messages captured. **Debug additions**: 1. Log message type for first 5 messages and every 20th message to see what message types we're receiving from Agent SDK 2. Log ResultMessage contents: has_result, assistant_msgs count, tool_calls count to understand what was captured 3. Log tools used (if any) to verify tool tracking is working **Next**: Restart bot and retry failing task. Check logs to see: - What message types are actually being received (expecting AssistantMessage) - Whether tool_use blocks are present in content - Why tool_names list is empty despite work being done Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
32 KiB
32 KiB