From aefdc9f0880e566c17dfa12717b1ddfd9a9ad0df Mon Sep 17 00:00:00 2001 From: Shrey Kant Rajvanshi Date: Sat, 13 Jun 2026 17:57:37 +0530 Subject: [PATCH 1/3] feat(client): send X-Initiator: SDK-PY so SDK traffic is attributable (SEG-319) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SDK sent X-Initiator: segmind-python-sdk/0.1.0, which spot-backend's SQS worker rejects (not in InitiatorType) and coerces to OTHERS — so SDK calls are indistinguishable from raw requests/curl in the DB. Send the stable token X-Initiator: SDK-PY instead. Heimdall passes it through verbatim on the sync path (-> SDK-PY) and suffixes -V2 on the v2-async path (-> SDK-PY-V2). Both are added to InitiatorType in the paired spot-backend PR. Version detail stays in the User-Agent header (segmind-python-sdk/0.1.0), which heimdall logs — so we don't lose version telemetry. Updated test_http_client_headers assertions accordingly. Full suite: 256 passed, 7 skipped. --- segmind/client.py | 7 ++++++- tests/test_client.py | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/segmind/client.py b/segmind/client.py index 2e84499..de27346 100644 --- a/segmind/client.py +++ b/segmind/client.py @@ -45,7 +45,12 @@ def _build_client(self) -> httpx.Client: headers = { # "Content-Type": "application/json", "User-Agent": "segmind-python-sdk/0.1.0", - "X-Initiator": "segmind-python-sdk/0.1.0", + # SEG-319: identifies SDK traffic in spotdb. Heimdall passes + # X-Initiator through verbatim on sync (-> "SDK-PY") and suffixes + # "-V2" on the v2-async path (-> "SDK-PY-V2"). Must match the + # InitiatorType enum in spot-backend or it's coerced to OTHERS. + # Version detail stays in User-Agent above. + "X-Initiator": "SDK-PY", } if self.api_key: headers["x-api-key"] = self.api_key diff --git a/tests/test_client.py b/tests/test_client.py index 9ff68f8..5894e8d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -36,7 +36,9 @@ def test_http_client_headers(self, mock_api_key): assert http_client.headers["x-api-key"] == mock_api_key assert http_client.headers["User-Agent"] == "segmind-python-sdk/0.1.0" - assert http_client.headers["X-Initiator"] == "segmind-python-sdk/0.1.0" + # SEG-319: stable initiator token so spotdb can attribute SDK traffic + # (heimdall suffixes -V2 on the v2-async path -> "SDK-PY-V2"). + assert http_client.headers["X-Initiator"] == "SDK-PY" def test_http_client_headers_without_api_key(self): @@ -46,7 +48,7 @@ def test_http_client_headers_without_api_key(self): assert "x-api-key" not in http_client.headers assert http_client.headers["User-Agent"] == "segmind-python-sdk/0.1.0" - assert http_client.headers["X-Initiator"] == "segmind-python-sdk/0.1.0" + assert http_client.headers["X-Initiator"] == "SDK-PY" def test_http_client_timeout_configuration(self, mock_api_key): From 8809dd422d68cde00b6c16aec8a94b2dc7a7c4e5 Mon Sep 17 00:00:00 2001 From: Shrey Kant Rajvanshi Date: Sun, 14 Jun 2026 12:03:20 +0530 Subject: [PATCH 2/3] chore(release): back-merge main + bump version to 1.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Back-merged origin/main (PR #1 v2-async + the docs.yml deprecated-actions CI fix) into this branch so build-and-deploy passes — it was red only because the branch predated the Pages-actions bump now on main. Bump __version__ 1.0.0 -> 1.1.0: 1.0.0 is already on PyPI, and main gained the v2 async feature (submit_async / run_async / AsyncJob) since 1.0.0 — a minor bump. This branch also carries the SEG-319 X-Initiator: SDK-PY change, so 1.1.0 ships both. Full suite green after the merge. --- segmind/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmind/__init__.py b/segmind/__init__.py index c6c9bd6..91504cd 100644 --- a/segmind/__init__.py +++ b/segmind/__init__.py @@ -38,7 +38,7 @@ InferenceTimeout, ) -__version__ = "1.0.0" +__version__ = "1.1.0" # Default client (lazily initialized) _default_client: Optional[SegmindClient] = None From 2fae81411100c829b0bb288d86d5cd2a690ec683 Mon Sep 17 00:00:00 2001 From: Shrey Kant Rajvanshi Date: Sun, 14 Jun 2026 12:04:17 +0530 Subject: [PATCH 3/3] chore(release): use patch bump 1.0.1 (not 1.1.0) --- segmind/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmind/__init__.py b/segmind/__init__.py index 91504cd..09ed4ca 100644 --- a/segmind/__init__.py +++ b/segmind/__init__.py @@ -38,7 +38,7 @@ InferenceTimeout, ) -__version__ = "1.1.0" +__version__ = "1.0.1" # Default client (lazily initialized) _default_client: Optional[SegmindClient] = None