Skip to content

Types

types

Shared enums, type aliases, and policy models used across Claw SDK.

This module defines the common types that multiple modules depend on: enums for timeout and budget policies, the EscalationPolicy model, and type aliases for JSON schemas.

TimeoutPolicy

Bases: StrEnum

Action to take when an agent or edge times out.

Attributes:

Name Type Description
ESCALATE

Route the timeout to an upstream agent for resolution.

RETRY_ONCE

Retry the timed-out operation exactly once.

TERMINATE

Stop execution on the affected edge immediately.

BudgetExceededPolicy

Bases: StrEnum

Action to take when a society exceeds its global budget.

Attributes:

Name Type Description
COMMIT_PARTIAL

Save whatever artifact state exists and return.

ROLLBACK

Revert all artifact state to pre-run values.

EscalationPolicy

Bases: BaseModel

Policy for escalating deadlocks or unresolvable situations.

Parameters:

Name Type Description Default
to

Name of the agent to escalate to (must exist in the society).

required
summary

Whether to include a summary of the situation in the escalation.

required
include_trace

Whether to include the full event trace in the escalation.

required

SocietyConfig

Bases: BaseModel

Global configuration for a Society's runtime behavior.

Parameters:

Name Type Description Default
max_llm_calls

Hard cap on total LLM calls across all agents.

required
max_wall_time

Hard cap on wall-clock time for the entire run.

required
on_budget_exceeded

Policy when any budget is hit.

required
agent_turn_timeout

Maximum time for a single agent turn.

required