77from ..scope import Scope
88from ..._models import BaseModel
99from .run_state import RunState
10+ from ..error_code import ErrorCode
1011from ..user_profile import UserProfile
1112from .artifact_item import ArtifactItem
12- from .request_usage import RequestUsage
13- from .schedule_info import ScheduleInfo
1413from .run_source_type import RunSourceType
15- from .run_status_message import RunStatusMessage
1614from ..ambient_agent_config import AmbientAgentConfig
1715
18- __all__ = ["RunItem" , "AgentSkill" ]
16+ __all__ = ["RunItem" , "AgentSkill" , "RequestUsage" , "Schedule" , "StatusMessage" ]
1917
2018
2119class AgentSkill (BaseModel ):
@@ -37,6 +35,79 @@ class AgentSkill(BaseModel):
3735 """Human-readable name of the skill"""
3836
3937
38+ class RequestUsage (BaseModel ):
39+ """Resource usage information for the run"""
40+
41+ compute_cost : Optional [float ] = None
42+ """Cost of compute resources for the run"""
43+
44+ inference_cost : Optional [float ] = None
45+ """Cost of LLM inference for the run"""
46+
47+
48+ class Schedule (BaseModel ):
49+ """
50+ Information about the schedule that triggered this run (only present for scheduled runs)
51+ """
52+
53+ cron_schedule : str
54+ """Cron expression at the time the run was created"""
55+
56+ schedule_id : str
57+ """Unique identifier for the schedule"""
58+
59+ schedule_name : str
60+ """Name of the schedule at the time the run was created"""
61+
62+
63+ class StatusMessage (BaseModel ):
64+ """Status message for a run.
65+
66+ For terminal error states, includes structured
67+ error code and retryability info from the platform error catalog.
68+ """
69+
70+ message : str
71+ """Human-readable status message"""
72+
73+ error_code : Optional [ErrorCode ] = None
74+ """
75+ Machine-readable error code identifying the problem type. Used in the `type` URI
76+ of Error responses and in the `error_code` field of RunStatusMessage.
77+
78+ User errors (run transitions to FAILED):
79+
80+ - `insufficient_credits` — Team has no remaining add-on credits
81+ - `feature_not_available` — Required feature not enabled for user's plan
82+ - `external_authentication_required` — User hasn't authorized a required
83+ external service
84+ - `not_authorized` — Principal lacks permission for the requested operation
85+ - `invalid_request` — Request is malformed or contains invalid parameters
86+ - `resource_not_found` — Referenced resource does not exist
87+ - `budget_exceeded` — Spending budget limit has been reached
88+ - `integration_disabled` — Integration is disabled and must be enabled
89+ - `integration_not_configured` — Integration setup is incomplete
90+ - `operation_not_supported` — Requested operation not supported for this
91+ resource/state
92+ - `environment_setup_failed` — Client-side environment setup failed
93+ - `content_policy_violation` — Prompt or setup commands violated content policy
94+ - `conflict` — Request conflicts with the current state of the resource
95+
96+ Warp errors (run transitions to ERROR):
97+
98+ - `authentication_required` — Request lacks valid authentication credentials
99+ - `resource_unavailable` — Transient infrastructure issue (retryable)
100+ - `internal_error` — Unexpected server-side error (retryable)
101+ """
102+
103+ retryable : Optional [bool ] = None
104+ """Whether the error is transient and the client may retry by submitting a new run.
105+
106+ Only present on terminal error states. When false, retrying without addressing
107+ the underlying cause will not succeed.
108+ """
109+
110+
40111class RunItem (BaseModel ):
41112 created_at : datetime
42113 """Timestamp when the run was created (RFC3339)"""
@@ -103,7 +174,7 @@ class RunItem(BaseModel):
103174 request_usage : Optional [RequestUsage ] = None
104175 """Resource usage information for the run"""
105176
106- schedule : Optional [ScheduleInfo ] = None
177+ schedule : Optional [Schedule ] = None
107178 """
108179 Information about the schedule that triggered this run (only present for
109180 scheduled runs)
@@ -135,7 +206,7 @@ class RunItem(BaseModel):
135206 started_at : Optional [datetime ] = None
136207 """Timestamp when the agent started working on the run (RFC3339)"""
137208
138- status_message : Optional [RunStatusMessage ] = None
209+ status_message : Optional [StatusMessage ] = None
139210 """Status message for a run.
140211
141212 For terminal error states, includes structured error code and retryability info
0 commit comments