Adding user agent#30
Merged
aayush3011 merged 3 commits intoJul 9, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a toolkit-specific Cosmos DB user-agent string (with optional caller prefix) and wires it through both sync and async Cosmos memory clients so Cosmos requests can be attributed in backend telemetry.
Changes:
- Introduces
COSMOS_USER_AGENT/build_cosmos_user_agent()utilities and stores the resolved UA on the shared base client config. - Adds a new
user_agentconstructor argument toCosmosMemoryClientandAsyncCosmosMemoryClient, forwarding it when creatingCosmosClient. - Adds unit tests covering user-agent construction/forwarding and bumps package version + changelog entry.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Bumps editable package version to 0.2.0b3. |
| pyproject.toml | Bumps project version to 0.2.0b3. |
| CHANGELOG.md | Documents the new user_agent constructor option and release entry. |
| azure/cosmos/agent_memory/_utils.py | Adds user-agent helpers/constants used to build the Cosmos UA string. |
| azure/cosmos/agent_memory/_base/base_client.py | Plumbs user_agent through base config and stores _cosmos_user_agent. |
| azure/cosmos/agent_memory/cosmos_memory_client.py | Forwards resolved user-agent into sync CosmosClient construction. |
| azure/cosmos/agent_memory/aio/cosmos_memory_client.py | Forwards resolved user-agent into async CosmosClient construction. |
| tests/unit/test_utils.py | Adds unit tests for user-agent helper behavior. |
| tests/unit/test_cosmos_memory_client.py | Adds unit tests asserting user_agent is passed to the Cosmos client. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.