feat: add timeout and max_turns parameters to AgentDefinition

Add timeout (in seconds) and max_turns parameters to AgentDefinition
to allow configuring subagent execution limits. This prevents subagents
from hanging indefinitely and enables better control over agent behavior.
This commit is contained in:
Claude 2025-12-09 03:31:37 +00:00
parent ccff8ddf48
commit 956c8f7403
No known key found for this signature in database

View file

@ -47,6 +47,8 @@ class AgentDefinition:
prompt: str
tools: list[str] | None = None
model: Literal["sonnet", "opus", "haiku", "inherit"] | None = None
timeout: float | None = None # Timeout in seconds for subagent execution
max_turns: int | None = None # Maximum turns for this agent
# Permission Update types (matching TypeScript SDK)