77from ..scope import Scope
88from ..._models import BaseModel
99from .run_state import RunState
10- from ..error_code import ErrorCode
1110from ..user_profile import UserProfile
1211from .artifact_item import ArtifactItem
12+ from .request_usage import RequestUsage
13+ from .schedule_info import ScheduleInfo
1314from .run_source_type import RunSourceType
15+ from .run_status_message import RunStatusMessage
1416from ..ambient_agent_config import AmbientAgentConfig
1517
16- __all__ = ["RunItem" , "AgentSkill" , "RequestUsage" , "Schedule" , "StatusMessage" ]
18+ __all__ = ["RunItem" , "AgentSkill" ]
1719
1820
1921class AgentSkill (BaseModel ):
@@ -35,79 +37,6 @@ class AgentSkill(BaseModel):
3537 """Human-readable name of the skill"""
3638
3739
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-
11140class RunItem (BaseModel ):
11241 created_at : datetime
11342 """Timestamp when the run was created (RFC3339)"""
@@ -174,7 +103,7 @@ class RunItem(BaseModel):
174103 request_usage : Optional [RequestUsage ] = None
175104 """Resource usage information for the run"""
176105
177- schedule : Optional [Schedule ] = None
106+ schedule : Optional [ScheduleInfo ] = None
178107 """
179108 Information about the schedule that triggered this run (only present for
180109 scheduled runs)
@@ -206,7 +135,7 @@ class RunItem(BaseModel):
206135 started_at : Optional [datetime ] = None
207136 """Timestamp when the agent started working on the run (RFC3339)"""
208137
209- status_message : Optional [StatusMessage ] = None
138+ status_message : Optional [RunStatusMessage ] = None
210139 """Status message for a run.
211140
212141 For terminal error states, includes structured error code and retryability info
0 commit comments