Skip to content

Commit 97af3ee

Browse files
fix: correct SSE stream endpoint path to unified API (#92)
* fix: correct SSE stream endpoint path to unified API stream_execution_status used /api/v1/executions/{id}/stream instead of /api/v1/unified/executions/{id}/stream, causing 404 when the server only registers the unified endpoint. * chore: bump version to 3.3.1
1 parent 4de65b4 commit 97af3ee

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to the AxonFlow Python SDK will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.3.1] - 2026-02-11
9+
10+
### Fixed
11+
12+
- `stream_execution_status()` used incorrect endpoint path (`/api/v1/executions/{id}/stream``/api/v1/unified/executions/{id}/stream`), causing 404 errors when streaming execution status updates
13+
814
## [3.3.0] - 2026-02-10
915

1016
### Added

axonflow/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,7 +4469,7 @@ async def stream_execution_status(
44694469
) -> AsyncIterator[ExecutionStatus]:
44704470
"""Stream real-time execution status updates via Server-Sent Events (SSE).
44714471
4472-
Connects to GET /api/v1/executions/{execution_id}/stream and yields
4472+
Connects to GET /api/v1/unified/executions/{execution_id}/stream and yields
44734473
ExecutionStatus objects as they arrive. The stream ends when a terminal
44744474
status is received (completed, failed, cancelled, aborted, expired)
44754475
or when the connection is closed.
@@ -4497,7 +4497,7 @@ async def stream_execution_status(
44974497
msg = "Execution ID is required"
44984498
raise ValueError(msg)
44994499

4500-
url = f"{self._config.endpoint}/api/v1/executions/{execution_id}/stream"
4500+
url = f"{self._config.endpoint}/api/v1/unified/executions/{execution_id}/stream"
45014501

45024502
# Build headers for SSE
45034503
headers = dict(self._http_client.headers)

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 = "axonflow"
7-
version = "3.3.0"
7+
version = "3.3.1"
88
description = "AxonFlow Python SDK - Enterprise AI Governance in 3 Lines of Code"
99
readme = "README.md"
1010
license = {text = "MIT"}

tests/test_execution_stream.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def test_stream_basic(
7070

7171
sse_body = _build_sse_response(*events)
7272
httpx_mock.add_response(
73-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
73+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
7474
content=sse_body.encode(),
7575
headers={"Content-Type": "text/event-stream"},
7676
)
@@ -103,7 +103,7 @@ async def test_stream_server_error(
103103
from axonflow.exceptions import AxonFlowError
104104

105105
httpx_mock.add_response(
106-
url="https://test.axonflow.com/api/v1/executions/nonexistent/stream",
106+
url="https://test.axonflow.com/api/v1/unified/executions/nonexistent/stream",
107107
status_code=404,
108108
content=b'{"error": "Execution not found"}',
109109
)
@@ -125,7 +125,7 @@ async def test_stream_sse_comments_ignored(
125125
sse_body = f": keep-alive\n\n\n\ndata: {json.dumps(event)}\n\n"
126126

127127
httpx_mock.add_response(
128-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
128+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
129129
content=sse_body.encode(),
130130
headers={"Content-Type": "text/event-stream"},
131131
)
@@ -149,7 +149,7 @@ async def test_stream_invalid_json_skipped(
149149
sse_body = f"data: {{invalid json}}\n\ndata: {json.dumps(valid_event)}\n\n"
150150

151151
httpx_mock.add_response(
152-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
152+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
153153
content=sse_body.encode(),
154154
headers={"Content-Type": "text/event-stream"},
155155
)
@@ -180,7 +180,7 @@ async def test_stream_failed_terminal(
180180

181181
sse_body = _build_sse_response(*events)
182182
httpx_mock.add_response(
183-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
183+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
184184
content=sse_body.encode(),
185185
headers={"Content-Type": "text/event-stream"},
186186
)
@@ -208,7 +208,7 @@ async def test_stream_cancelled_terminal(
208208

209209
sse_body = _build_sse_response(*events)
210210
httpx_mock.add_response(
211-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
211+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
212212
content=sse_body.encode(),
213213
headers={"Content-Type": "text/event-stream"},
214214
)
@@ -256,7 +256,7 @@ async def test_stream_with_steps(
256256

257257
sse_body = _build_sse_response(event)
258258
httpx_mock.add_response(
259-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
259+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
260260
content=sse_body.encode(),
261261
headers={"Content-Type": "text/event-stream"},
262262
)
@@ -290,7 +290,7 @@ async def test_stream_map_plan_type(
290290

291291
sse_body = _build_sse_response(event)
292292
httpx_mock.add_response(
293-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
293+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
294294
content=sse_body.encode(),
295295
headers={"Content-Type": "text/event-stream"},
296296
)
@@ -317,7 +317,7 @@ async def test_stream_data_prefix_no_space(
317317
sse_body = f"data:{json.dumps(event)}\n\n"
318318

319319
httpx_mock.add_response(
320-
url="https://test.axonflow.com/api/v1/executions/exec_stream_1/stream",
320+
url="https://test.axonflow.com/api/v1/unified/executions/exec_stream_1/stream",
321321
content=sse_body.encode(),
322322
headers={"Content-Type": "text/event-stream"},
323323
)

0 commit comments

Comments
 (0)