Skip to content

Send Connect-Protocol-Version: 1 instead of 1.0 - #70

Merged
rodnnnney merged 1 commit into
mainfrom
rod/connect-protocol-version-header
Oct 8, 2026
Merged

rodnnnney merged 1 commit into
mainfrom
rod/connect-protocol-version-header

Conversation

@rodnnnney

Copy link
Copy Markdown
Collaborator

Summary

  • What broke: every generated call sends Connect-Protocol-Version: 1.0, and the server rejects it with 400 invalid_argument: Connect-Protocol-Version must be "1": got "1.0", regardless of auth. Reproduced against app.textql.com with chats.get_all.
  • Cause: the spec this SDK was generated from (1.1.30) types the header as type: number, so the Python model is a float. demo2 #16402 already pins it to the string "1", but the SDK has not been regenerated since.
  • Fix: _ConnectProtocolVersionHook in _hooks/registration.py (not overwritten by Speakeasy) rewrites 1.0 to 1 before each request. It becomes a no-op once the SDK is regenerated from the fixed spec.

Release Notes

SDK: Fixed Python SDK calls failing with a 400 error about the Connect protocol version.

Tests

TestConnectProtocolVersionHeader: header sent as 1
  1. Set up: SDK over the mock transport from tests/conftest.py.
  2. Action: chats.get_all and chats.get_all_async.
  3. Assert: the recorded request carries Connect-Protocol-Version: 1.

Checked the sync path locally with an httpx.MockTransport (header comes out as 1); the pytest suite has not been run.

The spec this SDK was generated from types the header as a number, so the
generated models send 1.0, which connect-go rejects with 400 on every unary
call. A before-request hook rewrites it until the SDK is regenerated from the
fixed spec (demo2 #16402).
@rodnnnney
rodnnnney merged commit d80542f into main Oct 8, 2026
6 checks passed
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