AgentRunConfig#
Understand request ownership, phases, and runtime limits. See the guide.
- class zett_agent.agent.AgentRunConfig(session_id=None, request_id=None, parent_session_id=None, cache_key=None)[source]#
Identify a conversation and optionally one request within it.
- session_id#
Conversation identifier, reused across turns. None or an empty value is replaced by a new UUIDv7 when the runtime starts.
- Type:
str | None
- request_id#
Optional application correlation ID for this invocation. It is not an idempotency key; reusing it does not deduplicate messages.
- Type:
str | None
- parent_session_id#
Parent conversation when running a delegated child. Must differ from session_id.
- Type:
str | None
- cache_key#
Prompt cache routing key declared to the provider. None reuses session_id, which keeps every step of one conversation on the same cached prefix; set it to route several conversations onto one prefix instead.
- Type:
str | None
- Raises:
ValueError – If an identity is empty or a session references itself.
- Parameters:
session_id (str | None)
request_id (str | None)
parent_session_id (str | None)
cache_key (str | None)
Examples
A root conversation needs only a session ID:
config = AgentRunConfig(session_id="chat-42")
A delegated agent identifies its parent separately:
child = AgentRunConfig( session_id="review-42", request_id="request-7", parent_session_id="chat-42", )
Note
request_idis correlation data, not an idempotency key. Reusing it does not suppress a second message or model call.See also
SQLiteSessionStoragefor persisted session identity, andSubAgentDefinitionfor child-session setup.