Highcommunication

Infinite Handoff Loop

Agents repeatedly hand off tasks to each other without making progress, creating an endless loop.

Overview

How to Detect

Task bounces between agents indefinitely. No agent claims final ownership. Token usage spikes without output. System resources consumed without productive work.

Root Causes

No maximum handoff limits. Unclear agent responsibilities. Missing fallback assignment. Agents too willing to defer rather than attempt.

Test your agents against this failure mode
Try Playground

Deep Dive

Overview

Infinite handoff loops occur when agents keep transferring task responsibility without any agent completing the work. This is a form of livelock—the system is active but making no progress.

Common Loop Patterns

Ping-Pong Loop

Agent A → Agent B: "This needs specialist knowledge."
Agent B → Agent A: "I need more context from you."
Agent A → Agent B: "Here's context, now handle it."
Agent B → Agent A: "Still need specialist input."
[Repeats indefinitely]

Circular Delegation

Agent A → Agent B → Agent C → Agent A
Each thinks another agent should handle it.

Qualification Loop

Agent A: "Can you handle this?"
Agent B: "Maybe. Can you clarify X?"
Agent A: "Can you handle if I clarify X?"
Agent B: "Maybe. Can you also clarify Y?"
[Never reaches actual execution]

Root Causes

Unclear Ownership

No agent is designated as the "owner" who must either complete or escalate.

Overly Cautious Handoffs

Agents hand off too easily rather than attempting tasks at edge of capability.

Missing Termination Conditions

No limit on number of handoffs or time spent routing.

Symmetric Capabilities

Agents with similar capabilities keep deferring to each other.

Detection Mechanisms

Handoff Counting

if task.handoff_count > MAX_HANDOFFS:
    return force_assignment(task, last_agent)

Agent Repetition Detection

if current_agent in task.handoff_history[-3:]:
    # Same agent involved in recent handoffs
    trigger_loop_breaker()

Time-Based Detection

Task has been in routing state longer than expected execution time.

How to Prevent

Handoff Limits: Set maximum number of handoffs per task.

Ownership Rules: Designate clear task owners who must complete or explicitly escalate.

Loop Detection: Monitor handoff patterns for repetition.

Fallback Assignment: After N handoffs, force assignment to a designated handler.

Attempt-First Policy: Agents should attempt before handing off.

Want expert guidance on implementation?
Get Consulting

Real-World Examples

A support ticket bounced between routing, technical, and billing agents 47 times over 2 hours before a human noticed and intervened.