Skip to main content
Teams add coordination complexity. When something goes wrong, you need to trace execution across the leader and all members.

Debug Mode

Enable debug mode to see the messages sent to the model, tool calls, delegation patterns, and metrics.
Three ways to enable debug mode: Set debug_level=2 for more detailed logs:

What to Look For

When debugging, check:

Common Failure Modes

Leader Delegates to Wrong Member

The leader picks members based on their role. If delegation is wrong:
  1. Check that roles clearly describe what each member does
  2. Make roles distinct (avoid overlap)
  3. Add instructions to the team leader

Member Fails Silently

If a member fails, the leader may synthesize a response without that member’s output. Enable show_members_responses=True to see what each member returned:

Infinite Delegation Loop

The leader keeps delegating without producing a final response. This usually means:
  1. Instructions are unclear about when to stop
  2. Members are returning incomplete results
Add explicit stopping criteria to instructions:

High Token Usage

Multi-agent coordination burns tokens. A 4-member team can easily use 10x the tokens of a single agent. Check token usage in debug output or metrics:
To reduce tokens:
  • Use fewer members
  • Keep member responses concise
  • Use mode=TeamMode.route (or respond_directly=True) to skip synthesis

Interactive CLI

Test multi-turn conversations with the built-in CLI:
Use await team.acli_app() for async.

Tracing with AgentOS

For production debugging, connect your team to AgentOS to get:
  • Visual trace of all delegation and tool calls
  • Token usage breakdown by member
  • Session history and replay
  • Error tracking

Developer Resources