Skip to content

Conversation

@bmehta001
Copy link
Contributor

@bmehta001 bmehta001 commented Jul 29, 2025

  • Embeds SDK + version into the default User-Agent header for Http Client for C#/JS/Python/Rust
  • Bump patch versions where necessary - not sure it's necessary for Rust
  • Pull versions programmatically to avoid hardcoding
  • Used genversion library for JavaScript and Reflection for C#
  • Lint/add node_modules to .gitignore
  • Tested C#, Rust, Python, and JS

PR Summary
The changes update the HTTP client implementations in Rust, C#, Python, and JavaScript to dynamically include the SDK version in the User-Agent header. This ensures consistent version reporting while also bumping the overall package versions.

  • sdk/rust/src/client.rs: Updated the client builder to use the dynamic version from Cargo.
  • sdk/cs/src/FoundryLocalManager.cs: Configured the C# client to extract the assembly version for the User-Agent header.
  • sdk/python/foundry_local/client.py and new sdk/python/foundry_local/version.py: Modified the Python client to import and use the SDK version in its header.
  • sdk/js/src/client.ts and new sdk/js/src/version.ts: Adjusted the JavaScript client and build script to inject the SDK version into the User-Agent header.

@bmehta001 bmehta001 requested review from amarin16, Copilot and jambayk and removed request for amarin16, Copilot and jambayk July 29, 2025 02:56
@bmehta001 bmehta001 self-assigned this Jul 29, 2025
@bmehta001 bmehta001 requested a review from Copilot July 29, 2025 02:56

This comment was marked as outdated.

Capitalize AssemblyVersion, use cs instead of C#
@bmehta001 bmehta001 requested a review from Copilot July 29, 2025 03:01

This comment was marked as outdated.

@bmehta001 bmehta001 requested a review from Copilot July 29, 2025 03:09
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

Adds dynamic SDK version information to User-Agent headers across all language SDKs (Rust, C#, Python, JavaScript) to improve telemetry and debugging capabilities.

  • Extract version information programmatically instead of hardcoding values
  • Update HTTP clients to include SDK name and version in User-Agent headers
  • Bump package versions to reflect the changes

Reviewed Changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/rust/src/client.rs Uses Cargo environment variable to get package version for User-Agent
sdk/cs/src/FoundryLocalManager.cs Adds assembly version extraction and User-Agent header configuration
sdk/python/foundry_local/client.py Updates HTTP client to include SDK version in User-Agent header
sdk/python/foundry_local/version.py New version file containing SDK version string
sdk/js/src/client.ts Adds User-Agent header with SDK version to HTTP requests
sdk/js/src/version.ts Generated version file for JavaScript SDK
Files not reviewed (1)
  • sdk/js/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

@bmehta001 bmehta001 requested a review from amarin16 July 29, 2025 22:40
@bmehta001 bmehta001 merged commit 37e6ead into main Jul 29, 2025
2 checks passed
@bmehta001 bmehta001 deleted the bhamehta/add-sdk-version-as-user-agent branch July 29, 2025 22:58
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.

3 participants