Skip to content

Conversation

@Gawor270
Copy link
Member

Description

Describe your changes.

Motivation and Context

Why is this change required? What problem does it solve? If it fixes an open
issue, please link to the issue here.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@linear
Copy link

linear bot commented Jan 15, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds SDK version tracking by including a custom header in HTTP requests made by the Fishjam client. This enables server-side tracking of which SDK version is being used by clients.

Changes:

  • Added import of get_version() function to the OpenAPI client module
  • Added x-sdk_version header with format py-{version} to both sync and async HTTP client methods in AuthenticatedClient

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self._headers[self.auth_header_name] = (
f"{self.prefix} {self.token}" if self.prefix else self.token
)
self._headers["x-sdk_version"] = f"py-{get_version()}"
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The header name uses an underscore in "x-sdk_version" which is inconsistent with HTTP header naming conventions. HTTP headers should use hyphens as separators. Change to "x-sdk-version" to follow standard conventions.

Suggested change
self._headers["x-sdk_version"] = f"py-{get_version()}"
self._headers["x-sdk-version"] = f"py-{get_version()}"

Copilot uses AI. Check for mistakes.
self._headers[self.auth_header_name] = (
f"{self.prefix} {self.token}" if self.prefix else self.token
)
self._headers["x-sdk_version"] = f"py-{get_version()}"
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The header name uses an underscore in "x-sdk_version" which is inconsistent with HTTP header naming conventions. HTTP headers should use hyphens as separators. Change to "x-sdk-version" to follow standard conventions.

Copilot uses AI. Check for mistakes.
self._headers[self.auth_header_name] = (
f"{self.prefix} {self.token}" if self.prefix else self.token
)
self._headers["x-sdk_version"] = f"py-{get_version()}"
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The SDK version header is only added to AuthenticatedClient but not to the base Client class. This creates an inconsistency where only authenticated requests include the SDK version. For consistent tracking and analytics, the SDK version header should also be added in the Client.get_httpx_client() method (around line 91) and Client.get_async_httpx_client() method (around line 122).

Suggested change
self._headers["x-sdk_version"] = f"py-{get_version()}"

Copilot uses AI. Check for mistakes.
self._headers[self.auth_header_name] = (
f"{self.prefix} {self.token}" if self.prefix else self.token
)
self._headers["x-sdk_version"] = f"py-{get_version()}"
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The new SDK version header functionality lacks test coverage. Similar header functionality in the codebase (e.g., x-goog-api-client in test_gemini.py) has comprehensive tests. Consider adding tests that verify the SDK version header is correctly set in both sync and async HTTP clients.

Copilot uses AI. Check for mistakes.
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.

2 participants