Skip to content

runtime: guard transfer_task against cyclic and excessive nested delegation #3904

Description

@Sayt-0

Summary

Nested transfer_task delegation currently has no cycle detection or explicit depth limit. A cyclic configuration such as a -> b -> a can continue delegating indefinitely.

Expected behavior

Cyclic delegation should be rejected, and nested delegation should have a documented maximum depth or another explicit termination guard.

Acceptance criteria

  • Direct and indirect delegation cycles are rejected.
  • Valid acyclic multi-level delegation remains supported.
  • Excessive nesting stops with an actionable error.
  • Tests cover direct cycles, indirect cycles, and the configured depth boundary.
  • Foreground and background delegation paths are covered.

Metadata

Metadata

Assignees

Labels

area/agentFor work that has to do with the general agent loop/agentic features of the apparea/runtimeRuntime engine, agent loop execution, tool dispatch, loop detectionarea/toolsFor features/issues/fixes related to the usage of built-in and MCP tools

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions