Skip to content

Commit 8ced825

Browse files
tode-rlclaude
andcommitted
Merge origin/main into feature/ts-pr-765-port
Resolved conflicts in src/runloop_api_client/resources/axons/axons.py by: - Keeping auto-reconnection logic from feature branch (ReconnectingStream) - Adding support for user-provided after_sequence parameter from main - Initial stream uses user's after_sequence, reconnections use last received sequence - Both sync and async subscribe_sse methods now properly support both features Changes from origin/main (v1.15.0): - Updated version to 1.15.0 - Added axon_subscribe_sse_params type - Updated benchmark_runs and related tests Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2 parents b596e71 + 4c1f7e1 commit 8ced825

13 files changed

Lines changed: 105 additions & 24 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.14.1"
2+
".": "1.15.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 116
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c33fa67077f6f9cc8cb6d82a71657693f7288e1eff48b7b94099f2f11966b67b.yml
3-
openapi_spec_hash: 4329105152eb16bc5d2063038603ea61
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-77cfebef736250545ee47fa63d2210f323f096f0cbff4194c4a460a4d0328fd3.yml
3+
openapi_spec_hash: 33b5de41f43ca91cd3c745b048e68856
44
config_hash: 6649774d90af30c3559d6a242b6cb4b0

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 1.15.0 (2026-04-02)
4+
5+
Full Changelog: [v1.14.1...v1.15.0](https://github.com/runloopai/api-client-python/compare/v1.14.1...v1.15.0)
6+
7+
### Features
8+
9+
* **benchmark-runs:** add state filter and multi-value benchmark_id support to listBenchmarkRuns ([#8480](https://github.com/runloopai/api-client-python/issues/8480)) ([08e6a25](https://github.com/runloopai/api-client-python/commit/08e6a2543fbac1d20d2f8c1c51b34c989a622003))
10+
11+
12+
### Bug Fixes
13+
14+
* Add after_sequence param to axon subscribe ([#8497](https://github.com/runloopai/api-client-python/issues/8497)) ([454cce4](https://github.com/runloopai/api-client-python/commit/454cce48cf22ba3466f4063d58af4650b9b84322))
15+
316
## 1.14.1 (2026-04-01)
417

518
Full Changelog: [v1.14.0...v1.14.1](https://github.com/runloopai/api-client-python/compare/v1.14.0...v1.14.1)

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Methods:
109109
- <code title="get /v1/axons/{id}">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
110110
- <code title="get /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">list</a>(\*\*<a href="src/runloop_api_client/types/axon_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_view.py">SyncAxonsCursorIDPage[AxonView]</a></code>
111111
- <code title="post /v1/axons/{id}/publish">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">publish</a>(id, \*\*<a href="src/runloop_api_client/types/axon_publish_params.py">params</a>) -> <a href="./src/runloop_api_client/types/publish_result_view.py">PublishResultView</a></code>
112-
- <code title="get /v1/axons/{id}/subscribe/sse">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">subscribe_sse</a>(id) -> <a href="./src/runloop_api_client/types/axon_event_view.py">AxonEventView</a></code>
112+
- <code title="get /v1/axons/{id}/subscribe/sse">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">subscribe_sse</a>(id, \*\*<a href="src/runloop_api_client/types/axon_subscribe_sse_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_event_view.py">AxonEventView</a></code>
113113

114114
## Sql
115115

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "runloop_api_client"
3-
version = "1.14.1"
3+
version = "1.15.0"
44
description = "The official Python library for the runloop API"
55
dynamic = ["readme"]
66
license = "MIT"

src/runloop_api_client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "runloop_api_client"
4-
__version__ = "1.14.1" # x-release-please-version
4+
__version__ = "1.15.0" # x-release-please-version

src/runloop_api_client/resources/axons/axons.py

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
SqlResourceWithStreamingResponse,
1616
AsyncSqlResourceWithStreamingResponse,
1717
)
18-
from ...types import axon_list_params, axon_create_params, axon_publish_params
18+
from ...types import axon_list_params, axon_create_params, axon_publish_params, axon_subscribe_sse_params
1919
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
2020
from ..._utils import path_template, maybe_transform, async_maybe_transform
2121
from ..._compat import cached_property
@@ -261,6 +261,7 @@ def subscribe_sse(
261261
self,
262262
id: str,
263263
*,
264+
after_sequence: int | Omit = omit,
264265
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
265266
# The extra values given here take precedence over values defined on the client or passed to this method.
266267
extra_headers: Headers | None = None,
@@ -274,6 +275,9 @@ def subscribe_sse(
274275
Automatically reconnects on timeout, resuming from last received event.
275276
276277
Args:
278+
after_sequence: Sequence number after which to start streaming. Events with sequence > this
279+
value are returned. If unset, replay from the beginning.
280+
277281
extra_headers: Send extra headers
278282
279283
extra_query: Add additional query parameters to the request
@@ -292,16 +296,22 @@ def subscribe_sse(
292296
return self._get(
293297
path_template("/v1/axons/{id}/subscribe/sse", id=id),
294298
options=make_request_options(
295-
extra_headers=merged_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
299+
extra_headers=merged_headers,
300+
extra_query=extra_query,
301+
extra_body=extra_body,
302+
timeout=timeout,
303+
query=maybe_transform(
304+
{"after_sequence": after_sequence}, axon_subscribe_sse_params.AxonSubscribeSseParams
305+
),
296306
),
297307
cast_to=AxonEventView,
298308
stream=True,
299309
stream_cls=Stream[AxonEventView],
300310
)
301311

302312
def create_stream(last_sequence: str | None) -> Stream[AxonEventView]:
303-
# after_sequence is used internally for reconnection only
304-
sequence_int = int(last_sequence) if last_sequence is not None else None
313+
# Use user-provided after_sequence for initial stream, then use last_sequence for reconnections
314+
sequence_to_use = after_sequence if last_sequence is None else int(last_sequence)
305315
return self._get(
306316
path_template("/v1/axons/{id}/subscribe/sse", id=id),
307317
options=make_request_options(
@@ -310,7 +320,7 @@ def create_stream(last_sequence: str | None) -> Stream[AxonEventView]:
310320
extra_body=extra_body,
311321
timeout=timeout,
312322
query=maybe_transform(
313-
{"after_sequence": sequence_int},
323+
{"after_sequence": sequence_to_use},
314324
axon_subscribe_sse_params.AxonSubscribeSseParams,
315325
),
316326
),
@@ -337,6 +347,7 @@ def get_sequence(item: AxonEventView) -> str | None:
337347
)
338348

339349

350+
340351
class AsyncAxonsResource(AsyncAPIResource):
341352
@cached_property
342353
def sql(self) -> AsyncSqlResource:
@@ -560,6 +571,7 @@ async def subscribe_sse(
560571
self,
561572
id: str,
562573
*,
574+
after_sequence: int | Omit = omit,
563575
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
564576
# The extra values given here take precedence over values defined on the client or passed to this method.
565577
extra_headers: Headers | None = None,
@@ -573,6 +585,9 @@ async def subscribe_sse(
573585
Automatically reconnects on timeout, resuming from last received event.
574586
575587
Args:
588+
after_sequence: Sequence number after which to start streaming. Events with sequence > this
589+
value are returned. If unset, replay from the beginning.
590+
576591
extra_headers: Send extra headers
577592
578593
extra_query: Add additional query parameters to the request
@@ -591,25 +606,31 @@ async def subscribe_sse(
591606
return await self._get(
592607
path_template("/v1/axons/{id}/subscribe/sse", id=id),
593608
options=make_request_options(
594-
extra_headers=merged_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
609+
extra_headers=merged_headers,
610+
extra_query=extra_query,
611+
extra_body=extra_body,
612+
timeout=timeout,
613+
query=await async_maybe_transform(
614+
{"after_sequence": after_sequence}, axon_subscribe_sse_params.AxonSubscribeSseParams
615+
),
595616
),
596617
cast_to=AxonEventView,
597618
stream=True,
598619
stream_cls=AsyncStream[AxonEventView],
599620
)
600621

601622
async def create_stream(last_sequence: str | None) -> AsyncStream[AxonEventView]:
602-
# after_sequence is used internally for reconnection only
603-
sequence_int = int(last_sequence) if last_sequence is not None else None
623+
# Use user-provided after_sequence for initial stream, then use last_sequence for reconnections
624+
sequence_to_use = after_sequence if last_sequence is None else int(last_sequence)
604625
return await self._get(
605626
path_template("/v1/axons/{id}/subscribe/sse", id=id),
606627
options=make_request_options(
607628
extra_headers=merged_headers,
608629
extra_query=extra_query,
609630
extra_body=extra_body,
610631
timeout=timeout,
611-
query=maybe_transform(
612-
{"after_sequence": sequence_int},
632+
query=await async_maybe_transform(
633+
{"after_sequence": sequence_to_use},
613634
axon_subscribe_sse_params.AxonSubscribeSseParams,
614635
),
615636
),
@@ -636,6 +657,7 @@ def get_sequence(item: AxonEventView) -> str | None:
636657
)
637658

638659

660+
639661
class AxonsResourceWithRawResponse:
640662
def __init__(self, axons: AxonsResource) -> None:
641663
self._axons = axons

src/runloop_api_client/resources/benchmark_runs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def list(
8686
limit: int | Omit = omit,
8787
name: str | Omit = omit,
8888
starting_after: str | Omit = omit,
89+
state: str | Omit = omit,
8990
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9091
# The extra values given here take precedence over values defined on the client or passed to this method.
9192
extra_headers: Headers | None = None,
@@ -108,6 +109,8 @@ def list(
108109
109110
starting_after: Load the next page of data starting after the item with the given ID.
110111
112+
state: Filter by state
113+
111114
extra_headers: Send extra headers
112115
113116
extra_query: Add additional query parameters to the request
@@ -131,6 +134,7 @@ def list(
131134
"limit": limit,
132135
"name": name,
133136
"starting_after": starting_after,
137+
"state": state,
134138
},
135139
benchmark_run_list_params.BenchmarkRunListParams,
136140
),
@@ -342,6 +346,7 @@ def list(
342346
limit: int | Omit = omit,
343347
name: str | Omit = omit,
344348
starting_after: str | Omit = omit,
349+
state: str | Omit = omit,
345350
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
346351
# The extra values given here take precedence over values defined on the client or passed to this method.
347352
extra_headers: Headers | None = None,
@@ -364,6 +369,8 @@ def list(
364369
365370
starting_after: Load the next page of data starting after the item with the given ID.
366371
372+
state: Filter by state
373+
367374
extra_headers: Send extra headers
368375
369376
extra_query: Add additional query parameters to the request
@@ -387,6 +394,7 @@ def list(
387394
"limit": limit,
388395
"name": name,
389396
"starting_after": starting_after,
397+
"state": state,
390398
},
391399
benchmark_run_list_params.BenchmarkRunListParams,
392400
),

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
from .mcp_config_update_params import McpConfigUpdateParams as McpConfigUpdateParams
8383
from .network_policy_list_view import NetworkPolicyListView as NetworkPolicyListView
8484
from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView
85+
from .axon_subscribe_sse_params import AxonSubscribeSseParams as AxonSubscribeSseParams
8586
from .benchmark_job_list_params import BenchmarkJobListParams as BenchmarkJobListParams
8687
from .benchmark_run_list_params import BenchmarkRunListParams as BenchmarkRunListParams
8788
from .devbox_send_std_in_result import DevboxSendStdInResult as DevboxSendStdInResult
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import TypedDict
6+
7+
__all__ = ["AxonSubscribeSseParams"]
8+
9+
10+
class AxonSubscribeSseParams(TypedDict, total=False):
11+
after_sequence: int
12+
"""Sequence number after which to start streaming.
13+
14+
Events with sequence > this value are returned. If unset, replay from the
15+
beginning.
16+
"""

0 commit comments

Comments
 (0)