Skip to content

feat(client): send X-Initiator: SDK-PY so SDK traffic is attributable (SEG-319)#2

Merged
shrey-rajvanshi merged 4 commits into
mainfrom
shrey/seg-319-sdk-py-initiator
Jun 14, 2026
Merged

feat(client): send X-Initiator: SDK-PY so SDK traffic is attributable (SEG-319)#2
shrey-rajvanshi merged 4 commits into
mainfrom
shrey/seg-319-sdk-py-initiator

Conversation

@shrey-rajvanshi

Copy link
Copy Markdown
Contributor

Summary

The SDK sent X-Initiator: segmind-python-sdk/0.1.0. spot-backend's SQS worker rejects any value not in its InitiatorType enum and coerces it to OTHERS, so SDK calls are indistinguishable from raw requests/curl traffic in the DB — we can't measure adoption.

Send the stable token X-Initiator: SDK-PY instead:

  • Sync POST /v1/{slug} → heimdall passes it through → stored as SDK-PY.
  • v2-async POST /v2/{slug} → heimdall suffixes -V2SDK-PY-V2.

Both tokens are added to InitiatorType in 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.pyX-Initiator header value segmind-python-sdk/0.1.0SDK-PY.
  • tests/test_client.py — updated the two header assertions.

Test

Full suite: 256 passed, 7 skipped. ruff check clean.

Pairs with / sequencing

The spot-backend InitiatorType PR (SEG-319). Deploy order doesn't matter — until the enum lands, SDK-PY just falls into OTHERS (no breakage). Cleanest is spot-first, then an SDK release.

Linear: SEG-319 (parent SEG-114, related SEG-52).

… (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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

shrey-rajvanshi and others added 3 commits June 14, 2026 12:02
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.
@shrey-rajvanshi shrey-rajvanshi merged commit ad22354 into main Jun 14, 2026
6 checks passed
@shrey-rajvanshi shrey-rajvanshi deleted the shrey/seg-319-sdk-py-initiator branch June 14, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant