Skip to content

Allow protobuf 7 - #223

Merged
Omar-V2 merged 2 commits into
xai-org:mainfrom
codewithfourtix:allow-protobuf-7
Oct 23, 2026
Merged

Omar-V2 merged 2 commits into
xai-org:mainfrom
codewithfourtix:allow-protobuf-7

Conversation

@codewithfourtix

Copy link
Copy Markdown
Contributor

Fixes #222

The SDK can't be installed next to packages that pin protobuf 7 (Home Assistant 2026.10 pins protobuf==7.36.0). Even with the pin relaxed, proto/__init__.py raises Unsupported protobuf version on 7.x.

  • Raise the bound to protobuf>=5.29.4,<8, with the matching uv.lock specifier so uv sync --locked still passes. The locked version is unchanged.
  • Use the v6 gencode on protobuf 7. In 7.36.0, runtime_version.ValidateProtobufRuntimeVersion only rejects gencode newer than the runtime, and the builder, descriptor and well-known-type APIs used by the v6 gencode and the SDK are all still there.
  • Changelog entry under Unreleased.

The protobuf 7 runtime only rejects gencode newer than itself, so it loads
the v6 gencode. Route protobuf 7 to the v6 modules and raise the upper bound
to <8, so the SDK installs next to packages that pin protobuf 7, such as
Home Assistant 2026.10.

Fixes xai-org#222
@codewithfourtix
codewithfourtix requested a review from a team as a code owner October 12, 2026 04:32
Copilot AI balanced review requested due to automatic review settings October 12, 2026 04:32

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Omar-V2
Omar-V2 merged commit 9e6dae6 into xai-org:main Oct 23, 2026
7 checks passed
Omar-V2 added a commit that referenced this pull request Oct 23, 2026
Prepare to release `v1.21.0` of the xAI Python SDK following the
addition of safety_identifier (#221), guidelines (#229) and protobuf 7
support (#223).
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.

[UPGRADE] Compatibility issue with Home Assistant 2026.10 – protobuf 7.x constraint

5 participants