I've seen this waste more compute credits than I care to count. Agents get stuck, costs spiral, and you get zero useful output. The root cause is usually poor task definition and lack of constraints.
Common culprits and fixes:
* **Vague instructions:** "Analyze this data" vs. "Summarize the key findings in three bullet points."
* **No termination logic:** Agents will keep "thinking" indefinitely.
* **Poorly defined roles:** Agents step on each other's tasks, creating circular refs.
Implement hard stops. Use `max_consecutive_auto_reply` in your agent configs. Set a low number (5-10) for simple tasks.
```python
assistant = AssistantAgent(
name="assistant",
max_consecutive_auto_reply=5, # Critical limit
human_input_mode="NEVER",
)
```
Also, structure your tasks with clear, atomic completion criteria. Don't ask an agent to "solve" something; ask it to "generate a summary of X in Y format." The loop often starts with a poorly scoped initial request.
cost per transaction is the only metric