Skip to content

Optional client_name for tools built on the SDK - #7

Merged
vernu merged 1 commit into
mainfrom
feat/client-name
Nov 15, 2026
Merged

vernu merged 1 commit into
mainfrom
feat/client-name

Conversation

@vernu

@vernu vernu commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Tools and integrations built on the SDK can pass client_name (for example my-app/1.2.0). It goes ahead of the SDK's own name in the client headers, the same as clientName in the JS SDK (textbee/textbee-js#15). An invalid value raises ValueError. The README documents the option.

The SDK already names itself as textbee-python/<version>, so this only matters for tools built on top of it.

🤖 Generated with Claude Code

https://claude.ai/code/session_017B6pTTFVhKWwcKLit7MEdz

Summary by CodeRabbit

  • New Features
    • Added an optional client name that appears before the SDK identifier in request headers, helping identify a published tool or integration.
    • Invalid client names are rejected; leaving the option unset preserves the existing SDK identifier.

Tools and integrations that wrap the SDK can name themselves. The name goes
ahead of the SDK's own name in the client headers, as in the JS SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017B6pTTFVhKWwcKLit7MEdz
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The client accepts an optional client_name, validates its space-separated name/version parts, and prepends valid parts to the SDK identifier. Requests send the resulting identifier in the user-agent and x-sdk-client headers.

Changes: Client Identification

Layer / File(s) Summary
Client name option and validation
src/textbee/_client.py
Textbee accepts an optional client_name. The client validates one to four name/version parts and combines valid parts with the SDK identifier.
Request headers and validation coverage
src/textbee/_client.py, tests/test_client.py, README.md
Both request headers use the combined identifier. The tests cover header values and invalid names. The README documents the option and its format.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to df177

This adds an optional client_name setting that is sent in the client headers ahead of the SDK name. Existing usage is unchanged and invalid values are rejected, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: an optional client_name setting for tools built on the SDK. The changeset adds this constructor argument, validates it, prepends it to the user-agent and x-sdk-client …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an optional client_name setting for tools built on the SDK. The changeset adds this constructor argument, validates it, prepends it to the user-agent and x-sdk-client headers, documents it in the README, and adds tests. The title matches the primary objective in the PR summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 86629de and df17762.

Files selected for processing: 3

  • README.md
  • src/textbee/_client.py
  • tests/test_client.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@vernu
vernu merged commit da403c1 into main Nov 15, 2026
9 checks passed
@vernu vernu mentioned this pull request Nov 15, 2026
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