Skip to content

Commit 7c90a03

Browse files
chore: sync from ark-apis b9da430849
Auto-generated SDK sync from ark-apis at b9da430849861945f4f885e6b5aff7a1df12b40e. Generated files are overwritten by the sync pipeline and should not be edited by hand. Sync-Source-Commit: 04ed53640a75ad65e15499f09bd33502d30fa1e2 Ark-APIs-Commit: b9da430849861945f4f885e6b5aff7a1df12b40e Release-Version: 0.17.0
1 parent 868ed53 commit 7c90a03

5 files changed

Lines changed: 44 additions & 3 deletions

File tree

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.0
1+
0.17.0

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "arkruntime"
7-
version = "0.16.0"
7+
version = "0.17.0"
88
description = "Ark runtime SDK for Python"
99
readme = "README.md"
1010
requires-python = ">=3.8"

‎src/arkruntime/types/session/session_stream_shim.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class ManagedAgentsStopReason(_DictCompatModel):
7777
"""
7878

7979
type: str = ""
80+
# Pending input event IDs when type is requires_action.
81+
event_ids: Optional[List[str]] = None
8082

8183

8284
class ManagedAgentsRetryStatus(_DictCompatModel):
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2026 ByteDance Ltd. and/or its affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
"""Synced from ark-apis by vendor-session; exercise the real stream decoder."""
5+
6+
import unittest
7+
8+
from arkruntime.types.session import ManagedAgentsStopReason, decode_session_event
9+
10+
11+
class StreamStopReasonTests(unittest.TestCase):
12+
def test_typed_pending_event_ids(self):
13+
self.assertIn("event_ids", ManagedAgentsStopReason.model_fields)
14+
for kind in ("session.status_idle", "session.thread_status_idle"):
15+
for ids in (["sevt-a", "sevt-b"], ["sevt-b"], []):
16+
payload = {
17+
"type": kind,
18+
"id": "sevt-idle",
19+
"stop_reason": {"type": "requires_action", "event_ids": ids},
20+
}
21+
if kind == "session.thread_status_idle":
22+
payload.update(session_thread_id="sthr-1", agent_name="agent")
23+
with self.subTest(kind=kind, ids=ids):
24+
event = decode_session_event(payload)
25+
self.assertIsInstance(event.stop_reason, ManagedAgentsStopReason)
26+
self.assertEqual(event.stop_reason.event_ids, ids)
27+
self.assertEqual(event.stop_reason["event_ids"], ids)
28+
self.assertEqual(event.model_dump(exclude_unset=True), payload)
29+
30+
def test_legacy_and_future_reasons(self):
31+
for kind in ("end_turn", "retries_exhausted", "future_reason"):
32+
with self.subTest(kind=kind):
33+
reason = ManagedAgentsStopReason(type=kind)
34+
self.assertIsNone(reason.event_ids)
35+
self.assertEqual(reason.model_dump(exclude_unset=True), {"type": kind})
36+
37+
38+
if __name__ == "__main__":
39+
unittest.main()

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)