Skip to content

Commit 33cf04c

Browse files
feat: Add parent_run_id filter to List runs endpoint
1 parent 6720ea9 commit 33cf04c

File tree

7 files changed

+39
-3
lines changed

7 files changed

+39
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-a29592b2ba26cba9d89b95969d66506f49c08e140b76ce4aea4189e5c1dccc06.yml
3-
openapi_spec_hash: 27a5de1f891104d5e47904ad8e4b4bd1
4-
config_hash: 40327fb76b7cce7b97f23de9b8d48efb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-96b15c5805e3554bc9eba7055a9b018fc3304f9b149f2c1f27e4cf4d6a1996d7.yml
3+
openapi_spec_hash: b99e78f4bfe7de8864c15a803bb0bb0b
4+
config_hash: 60052b2c1c0862014416821aba875574

src/oz_agent_sdk/resources/agent/agent.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def get_artifact(
193193
def run(
194194
self,
195195
*,
196+
agent_identity_uid: str | Omit = omit,
196197
attachments: Iterable[agent_run_params.Attachment] | Omit = omit,
197198
config: AmbientAgentConfigParam | Omit = omit,
198199
conversation_id: str | Omit = omit,
@@ -215,6 +216,9 @@ def run(
215216
runs. Behavior is identical to POST /agent/run.
216217
217218
Args:
219+
agent_identity_uid: Optional agent identity UID to use as the execution principal for the run. This
220+
is only valid for runs that are team owned.
221+
218222
attachments: Optional file attachments to include with the prompt (max 5). Attachments are
219223
uploaded to cloud storage and made available to the agent.
220224
@@ -256,6 +260,7 @@ def run(
256260
"/agent/runs",
257261
body=maybe_transform(
258262
{
263+
"agent_identity_uid": agent_identity_uid,
259264
"attachments": attachments,
260265
"config": config,
261266
"conversation_id": conversation_id,
@@ -417,6 +422,7 @@ async def get_artifact(
417422
async def run(
418423
self,
419424
*,
425+
agent_identity_uid: str | Omit = omit,
420426
attachments: Iterable[agent_run_params.Attachment] | Omit = omit,
421427
config: AmbientAgentConfigParam | Omit = omit,
422428
conversation_id: str | Omit = omit,
@@ -439,6 +445,9 @@ async def run(
439445
runs. Behavior is identical to POST /agent/run.
440446
441447
Args:
448+
agent_identity_uid: Optional agent identity UID to use as the execution principal for the run. This
449+
is only valid for runs that are team owned.
450+
442451
attachments: Optional file attachments to include with the prompt (max 5). Attachments are
443452
uploaded to cloud storage and made available to the agent.
444453
@@ -480,6 +489,7 @@ async def run(
480489
"/agent/runs",
481490
body=await async_maybe_transform(
482491
{
492+
"agent_identity_uid": agent_identity_uid,
483493
"attachments": attachments,
484494
"config": config,
485495
"conversation_id": conversation_id,

src/oz_agent_sdk/resources/agent/runs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def retrieve(
8787
def list(
8888
self,
8989
*,
90+
ancestor_run_id: str | Omit = omit,
9091
artifact_type: Literal["PLAN", "PULL_REQUEST", "SCREENSHOT", "FILE"] | Omit = omit,
9192
created_after: Union[str, datetime] | Omit = omit,
9293
created_before: Union[str, datetime] | Omit = omit,
@@ -119,6 +120,9 @@ def list(
119120
to `sort_by=updated_at` and `sort_order=desc`.
120121
121122
Args:
123+
ancestor_run_id: Filter runs by ancestor run ID. The referenced run must exist and be accessible
124+
to the caller.
125+
122126
artifact_type: Filter runs by artifact type
123127
124128
created_after: Filter runs created after this timestamp (RFC3339 format)
@@ -182,6 +186,7 @@ def list(
182186
timeout=timeout,
183187
query=maybe_transform(
184188
{
189+
"ancestor_run_id": ancestor_run_id,
185190
"artifact_type": artifact_type,
186191
"created_after": created_after,
187192
"created_before": created_before,
@@ -307,6 +312,7 @@ async def retrieve(
307312
def list(
308313
self,
309314
*,
315+
ancestor_run_id: str | Omit = omit,
310316
artifact_type: Literal["PLAN", "PULL_REQUEST", "SCREENSHOT", "FILE"] | Omit = omit,
311317
created_after: Union[str, datetime] | Omit = omit,
312318
created_before: Union[str, datetime] | Omit = omit,
@@ -339,6 +345,9 @@ def list(
339345
to `sort_by=updated_at` and `sort_order=desc`.
340346
341347
Args:
348+
ancestor_run_id: Filter runs by ancestor run ID. The referenced run must exist and be accessible
349+
to the caller.
350+
342351
artifact_type: Filter runs by artifact type
343352
344353
created_after: Filter runs created after this timestamp (RFC3339 format)
@@ -402,6 +411,7 @@ def list(
402411
timeout=timeout,
403412
query=maybe_transform(
404413
{
414+
"ancestor_run_id": ancestor_run_id,
405415
"artifact_type": artifact_type,
406416
"created_after": created_after,
407417
"created_before": created_before,

src/oz_agent_sdk/types/agent/run_list_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515

1616
class RunListParams(TypedDict, total=False):
17+
ancestor_run_id: str
18+
"""Filter runs by ancestor run ID.
19+
20+
The referenced run must exist and be accessible to the caller.
21+
"""
22+
1723
artifact_type: Literal["PLAN", "PULL_REQUEST", "SCREENSHOT", "FILE"]
1824
"""Filter runs by artifact type"""
1925

src/oz_agent_sdk/types/agent_run_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515

1616
class AgentRunParams(TypedDict, total=False):
17+
agent_identity_uid: str
18+
"""
19+
Optional agent identity UID to use as the execution principal for the run. This
20+
is only valid for runs that are team owned.
21+
"""
22+
1723
attachments: Iterable[Attachment]
1824
"""
1925
Optional file attachments to include with the prompt (max 5). Attachments are

tests/api_resources/agent/test_runs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def test_method_list(self, client: OzAPI) -> None:
7171
@parametrize
7272
def test_method_list_with_all_params(self, client: OzAPI) -> None:
7373
run = client.agent.runs.list(
74+
ancestor_run_id="ancestor_run_id",
7475
artifact_type="PLAN",
7576
created_after=parse_datetime("2019-12-27T18:11:19.117Z"),
7677
created_before=parse_datetime("2019-12-27T18:11:19.117Z"),
@@ -215,6 +216,7 @@ async def test_method_list(self, async_client: AsyncOzAPI) -> None:
215216
@parametrize
216217
async def test_method_list_with_all_params(self, async_client: AsyncOzAPI) -> None:
217218
run = await async_client.agent.runs.list(
219+
ancestor_run_id="ancestor_run_id",
218220
artifact_type="PLAN",
219221
created_after=parse_datetime("2019-12-27T18:11:19.117Z"),
220222
created_before=parse_datetime("2019-12-27T18:11:19.117Z"),

tests/api_resources/test_agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def test_method_run(self, client: OzAPI) -> None:
112112
@parametrize
113113
def test_method_run_with_all_params(self, client: OzAPI) -> None:
114114
agent = client.agent.run(
115+
agent_identity_uid="agent_identity_uid",
115116
attachments=[
116117
{
117118
"data": "U3RhaW5sZXNzIHJvY2tz",
@@ -272,6 +273,7 @@ async def test_method_run(self, async_client: AsyncOzAPI) -> None:
272273
@parametrize
273274
async def test_method_run_with_all_params(self, async_client: AsyncOzAPI) -> None:
274275
agent = await async_client.agent.run(
276+
agent_identity_uid="agent_identity_uid",
275277
attachments=[
276278
{
277279
"data": "U3RhaW5sZXNzIHJvY2tz",

0 commit comments

Comments
 (0)