Skip to content

Commit df1b59a

Browse files
feat(api): add schedules to runs
1 parent 578be41 commit df1b59a

File tree

8 files changed

+35
-55
lines changed

8 files changed

+35
-55
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-d3907596f0e1b561fd86deb46529fca2a4802a992a35e2a9c51440451f4e9811.yml
3-
openapi_spec_hash: 5636d38917d7664a237f4096c1338304
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-71da0fb8e959241d9767c5a4879871711b501bd0d6cef087fbb7047a0b86791e.yml
3+
openapi_spec_hash: 8b0828210e5b33f36fc88093dbf066f1
44
config_hash: 07820b17df23cbea39cb77fa05292538

src/warp_agent_sdk/resources/agent/runs.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,8 @@ def list(
9292
environment_id: str | Omit = omit,
9393
limit: int | Omit = omit,
9494
model_id: str | Omit = omit,
95-
schedule_id: str | Omit = omit,
96-
skill_spec: str | Omit = omit,
9795
source: RunSourceType | Omit = omit,
9896
state: List[RunState] | Omit = omit,
99-
updated_after: Union[str, datetime] | Omit = omit,
10097
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10198
# The extra values given here take precedence over values defined on the client or passed to this method.
10299
extra_headers: Headers | None = None,
@@ -126,17 +123,11 @@ def list(
126123
127124
model_id: Filter by model ID
128125
129-
schedule_id: Filter runs by the scheduled agent ID that created them
130-
131-
skill_spec: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")
132-
133126
source: Filter by run source type
134127
135128
state: Filter by run state. Can be specified multiple times to match any of the given
136129
states.
137130
138-
updated_after: Filter runs updated after this timestamp (RFC3339 format)
139-
140131
extra_headers: Send extra headers
141132
142133
extra_query: Add additional query parameters to the request
@@ -162,11 +153,8 @@ def list(
162153
"environment_id": environment_id,
163154
"limit": limit,
164155
"model_id": model_id,
165-
"schedule_id": schedule_id,
166-
"skill_spec": skill_spec,
167156
"source": source,
168157
"state": state,
169-
"updated_after": updated_after,
170158
},
171159
run_list_params.RunListParams,
172160
),
@@ -275,11 +263,8 @@ async def list(
275263
environment_id: str | Omit = omit,
276264
limit: int | Omit = omit,
277265
model_id: str | Omit = omit,
278-
schedule_id: str | Omit = omit,
279-
skill_spec: str | Omit = omit,
280266
source: RunSourceType | Omit = omit,
281267
state: List[RunState] | Omit = omit,
282-
updated_after: Union[str, datetime] | Omit = omit,
283268
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
284269
# The extra values given here take precedence over values defined on the client or passed to this method.
285270
extra_headers: Headers | None = None,
@@ -309,17 +294,11 @@ async def list(
309294
310295
model_id: Filter by model ID
311296
312-
schedule_id: Filter runs by the scheduled agent ID that created them
313-
314-
skill_spec: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")
315-
316297
source: Filter by run source type
317298
318299
state: Filter by run state. Can be specified multiple times to match any of the given
319300
states.
320301
321-
updated_after: Filter runs updated after this timestamp (RFC3339 format)
322-
323302
extra_headers: Send extra headers
324303
325304
extra_query: Add additional query parameters to the request
@@ -345,11 +324,8 @@ async def list(
345324
"environment_id": environment_id,
346325
"limit": limit,
347326
"model_id": model_id,
348-
"schedule_id": schedule_id,
349-
"skill_spec": skill_spec,
350327
"source": source,
351328
"state": state,
352-
"updated_after": updated_after,
353329
},
354330
run_list_params.RunListParams,
355331
),

src/warp_agent_sdk/types/agent/artifact_item.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
from ..._utils import PropertyInfo
88
from ..._models import BaseModel
99

10-
__all__ = ["ArtifactItem", "PlanArtifact", "PlanArtifactData", "PullRequestArtifact", "PullRequestArtifactData"]
10+
__all__ = ["ArtifactItem", "PlanArtifact", "PlanArtifactPlan", "PullRequestArtifact", "PullRequestArtifactPullRequest"]
1111

1212

13-
class PlanArtifactData(BaseModel):
13+
class PlanArtifactPlan(BaseModel):
1414
document_uid: str
1515
"""Unique identifier for the plan document"""
1616

@@ -22,16 +22,16 @@ class PlanArtifactData(BaseModel):
2222

2323

2424
class PlanArtifact(BaseModel):
25-
artifact_type: Literal["PLAN"]
25+
artifact_type: Literal["plan"]
2626
"""Type of the artifact"""
2727

2828
created_at: datetime
2929
"""Timestamp when the artifact was created (RFC3339)"""
3030

31-
data: PlanArtifactData
31+
plan: PlanArtifactPlan
3232

3333

34-
class PullRequestArtifactData(BaseModel):
34+
class PullRequestArtifactPullRequest(BaseModel):
3535
branch: str
3636
"""Branch name for the pull request"""
3737

@@ -40,13 +40,13 @@ class PullRequestArtifactData(BaseModel):
4040

4141

4242
class PullRequestArtifact(BaseModel):
43-
artifact_type: Literal["PULL_REQUEST"]
43+
artifact_type: Literal["pull_request"]
4444
"""Type of the artifact"""
4545

4646
created_at: datetime
4747
"""Timestamp when the artifact was created (RFC3339)"""
4848

49-
data: PullRequestArtifactData
49+
pull_request: PullRequestArtifactPullRequest
5050

5151

5252
ArtifactItem: TypeAlias = Annotated[

src/warp_agent_sdk/types/agent/run_item.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .run_source_type import RunSourceType
1111
from ..ambient_agent_config import AmbientAgentConfig
1212

13-
__all__ = ["RunItem", "RequestUsage", "StatusMessage"]
13+
__all__ = ["RunItem", "RequestUsage", "Schedule", "StatusMessage"]
1414

1515

1616
class RequestUsage(BaseModel):
@@ -23,6 +23,21 @@ class RequestUsage(BaseModel):
2323
"""Cost of LLM inference for the run"""
2424

2525

26+
class Schedule(BaseModel):
27+
"""
28+
Information about the schedule that triggered this run (only present for scheduled runs)
29+
"""
30+
31+
cron_schedule: str
32+
"""Cron expression at the time the run was created"""
33+
34+
schedule_id: str
35+
"""Unique identifier for the schedule"""
36+
37+
schedule_name: str
38+
"""Name of the schedule at the time the run was created"""
39+
40+
2641
class StatusMessage(BaseModel):
2742
message: Optional[str] = None
2843
"""Human-readable status message"""
@@ -47,7 +62,6 @@ class RunItem(BaseModel):
4762
- INPROGRESS: Run is actively being executed
4863
- SUCCEEDED: Run completed successfully
4964
- FAILED: Run failed
50-
- CANCELLED: Run was cancelled by user
5165
"""
5266

5367
task_id: str
@@ -79,6 +93,12 @@ class RunItem(BaseModel):
7993
request_usage: Optional[RequestUsage] = None
8094
"""Resource usage information for the run"""
8195

96+
schedule: Optional[Schedule] = None
97+
"""
98+
Information about the schedule that triggered this run (only present for
99+
scheduled runs)
100+
"""
101+
82102
session_id: Optional[str] = None
83103
"""UUID of the shared session (if available)"""
84104

src/warp_agent_sdk/types/agent/run_list_params.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class RunListParams(TypedDict, total=False):
2929
cursor: str
3030
"""Pagination cursor from previous response"""
3131

32-
environment_id: str
32+
environment_id: Annotated[str, PropertyInfo(alias="environmentId")]
3333
"""Filter runs by environment ID"""
3434

3535
limit: int
@@ -38,12 +38,6 @@ class RunListParams(TypedDict, total=False):
3838
model_id: str
3939
"""Filter by model ID"""
4040

41-
schedule_id: str
42-
"""Filter runs by the scheduled agent ID that created them"""
43-
44-
skill_spec: str
45-
"""Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")"""
46-
4741
source: RunSourceType
4842
"""Filter by run source type"""
4943

@@ -52,6 +46,3 @@ class RunListParams(TypedDict, total=False):
5246
5347
Can be specified multiple times to match any of the given states.
5448
"""
55-
56-
updated_after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
57-
"""Filter runs updated after this timestamp (RFC3339 format)"""

src/warp_agent_sdk/types/agent/run_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__all__ = ["RunState"]
66

7-
RunState: TypeAlias = Literal["QUEUED", "PENDING", "CLAIMED", "INPROGRESS", "SUCCEEDED", "FAILED", "CANCELLED"]
7+
RunState: TypeAlias = Literal["QUEUED", "PENDING", "CLAIMED", "INPROGRESS", "SUCCEEDED", "FAILED"]

src/warp_agent_sdk/types/agent_run_response.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ class AgentRunResponse(BaseModel):
1919
- INPROGRESS: Run is actively being executed
2020
- SUCCEEDED: Run completed successfully
2121
- FAILED: Run failed
22-
- CANCELLED: Run was cancelled by user
2322
"""

tests/api_resources/agent/test_runs.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,11 @@ def test_method_list_with_all_params(self, client: WarpAPI) -> None:
7575
created_before=parse_datetime("2019-12-27T18:11:19.117Z"),
7676
creator="creator",
7777
cursor="cursor",
78-
environment_id="environment_id",
78+
environment_id="environmentId",
7979
limit=1,
8080
model_id="model_id",
81-
schedule_id="schedule_id",
82-
skill_spec="skill_spec",
8381
source="LINEAR",
8482
state=["QUEUED"],
85-
updated_after=parse_datetime("2019-12-27T18:11:19.117Z"),
8683
)
8784
assert_matches_type(RunListResponse, run, path=["response"])
8885

@@ -213,14 +210,11 @@ async def test_method_list_with_all_params(self, async_client: AsyncWarpAPI) ->
213210
created_before=parse_datetime("2019-12-27T18:11:19.117Z"),
214211
creator="creator",
215212
cursor="cursor",
216-
environment_id="environment_id",
213+
environment_id="environmentId",
217214
limit=1,
218215
model_id="model_id",
219-
schedule_id="schedule_id",
220-
skill_spec="skill_spec",
221216
source="LINEAR",
222217
state=["QUEUED"],
223-
updated_after=parse_datetime("2019-12-27T18:11:19.117Z"),
224218
)
225219
assert_matches_type(RunListResponse, run, path=["response"])
226220

0 commit comments

Comments
 (0)