feat(client): send X-Initiator: SDK-PY so SDK traffic is attributable (SEG-319)#2
Merged
Merged
Conversation
… (SEG-319) 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.
There was a problem hiding this comment.
Code Review
This pull request updates the X-Initiator header value from 'segmind-python-sdk/0.1.0' to 'SDK-PY' in the HTTP client to correctly identify SDK traffic in spotdb and match backend expectations. The corresponding unit tests have been updated to reflect this change. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The SDK sent
X-Initiator: segmind-python-sdk/0.1.0. spot-backend's SQS worker rejects any value not in itsInitiatorTypeenum and coerces it toOTHERS, so SDK calls are indistinguishable from rawrequests/curl traffic in the DB — we can't measure adoption.Send the stable token
X-Initiator: SDK-PYinstead:POST /v1/{slug}→ heimdall passes it through → stored asSDK-PY.POST /v2/{slug}→ heimdall suffixes-V2→SDK-PY-V2.Both tokens are added to
InitiatorTypein the paired spot-backend PR.Version detail stays in
User-Agent: segmind-python-sdk/0.1.0(heimdall logs it), so no version telemetry is lost.Changes
segmind/client.py—X-Initiatorheader valuesegmind-python-sdk/0.1.0→SDK-PY.tests/test_client.py— updated the two header assertions.Test
Full suite: 256 passed, 7 skipped.
ruff checkclean.Pairs with / sequencing
The spot-backend
InitiatorTypePR (SEG-319). Deploy order doesn't matter — until the enum lands,SDK-PYjust falls intoOTHERS(no breakage). Cleanest is spot-first, then an SDK release.Linear: SEG-319 (parent SEG-114, related SEG-52).