Add Create User-Agent Header Utility - #98
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new utility function GetUserAgentHeader that generates standardized User-Agent header strings for SDK HTTP requests. The implementation includes OS type resolution and SDK version information, with optional orchestrator identification.
Key Changes:
- Added
GetUserAgentHeadermethod to generate User-Agent strings with SDK version, OS type, Node.js version, and orchestrator info - Added private
ResolveOsTypehelper that maps OS type names (Windows_NT→Windows, Darwin→macOS, Linux→Linux) - Comprehensive test coverage for both new methods including edge cases and OS type mapping
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/agents-a365-runtime/src/utility.ts | Implements GetUserAgentHeader method and ResolveOsType helper with OS name mapping logic |
| tests/common/utility.test.ts | Adds comprehensive test suite for GetUserAgentHeader and ResolveOsType, plus tests for existing GetAppIdFromToken and ResolveAgentIdentity methods |
added 2 commits
December 3, 2025 15:02
added 2 commits
December 5, 2025 11:17
…b.com/microsoft/Agent365-nodejs into users/jterrazas/add-user-agent-header
pontemonti
previously approved these changes
Dec 5, 2025
joratz
approved these changes
Dec 9, 2025
pontemonti
approved these changes
Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.