Skip to content

Python: Clarify Cosmos history provider storage scope - #8391

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
eavanvalkenburg:cosmos-history-scope-assessment
Sep 15, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
eavanvalkenburg:cosmos-history-scope-assessment

Conversation

@eavanvalkenburg

@eavanvalkenburg Eduard van Valkenburg (eavanvalkenburg) commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Motivation & Context

Clarify how CosmosHistoryProvider selects persisted conversation history when applications share Cosmos DB storage or resume conversations across provider instances.

Description & Review Guide

  • What are the major changes? Expand the class docstring to describe the configured storage location, session partition key, and provider source filter. Clarify that the default source_id is shared across instances.
  • What is the impact of these changes? Documentation only. Explain that identical storage selectors access the same history, while authentication, authorization, and trusted namespace selection remain application responsibilities. Different identifiers prevent accidental overlap but do not restrict a client whose Cosmos DB credentials already authorize access to the data. Runtime behavior and public signatures are unchanged.
  • What do you want reviewers to focus on? Accuracy and clarity of the storage-selection and application-responsibility descriptions.

Related Issue

N/A — small documentation clarification; the contribution guidelines allow trivial changes without an issue.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The documentation accurately reflects the existing storage-selection behavior without changing runtime APIs.

Pull request overview

Clarifies how Cosmos-backed conversation histories are selected and shared across provider instances.

Changes:

  • Documents account, database, container, session, and source selectors.
  • Clarifies authorization responsibilities and the shared default source_id.
File summaries
File Description
python/packages/azure-cosmos/agent_framework_azure_cosmos/_history_provider.py Expands provider and parameter documentation.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): 27394410be17
Model: gpt-5.6-sol-fast

Overview

This documentation-only change accurately explains that Cosmos account, database, container, session_id, and source_id collectively select persisted history, while authentication and authorization remain application responsibilities. The implementation and tests confirm that reads, writes, and clearing use the documented selectors, empty session IDs cannot accidentally resume history, and the default source ID is shared across instances. No publishable correctness, compatibility, architectural, or security issue was established.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

Merged via the queue into microsoft:main with commit ab05d32 Sep 15, 2026
48 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 27394410 Deployed Sep 15, 2026 by eavanvalkenburg via add_label #22895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants