Python: Fix Cosmos memory retrieval with Toolkit 0.3 - #8460
Evan Mattson (moonbox3) merged 1 commit into
Conversation
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 70c06d60b36e
Model: gpt-5.6-sol-fast
Overview
The review found 3 verified inline finding(s).
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
3 verified findings remained after source verification (1 high, 2 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/azure-cosmos-memory/agent_framework_azure_cosmos_memory/_context_provider.py
There was a problem hiding this comment.
🟡 Changes recommended
Procedural context must be routed through instruction extensions rather than included in the user-role memory message.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates Cosmos memory retrieval for Agent Memory Toolkit 0.3.0b2 while preserving older-client compatibility.
Changes:
- Adds capability-aware episodic and procedural retrieval.
- Preserves legacy fallbacks and isolates retrieval failures.
- Updates dependencies, tests, lockfile, and documentation.
File summaries
| File | Summary |
|---|---|
python/uv.lock |
Locks Toolkit 0.3.0b2. |
python/packages/azure-cosmos-memory/tests/test_emulator.py |
Supports both write API names. |
python/packages/azure-cosmos-memory/tests/test_context_provider.py |
Adds retrieval contract and failure-isolation tests. |
python/packages/azure-cosmos-memory/README.md |
Documents updated retrieval behavior. |
python/packages/azure-cosmos-memory/pyproject.toml |
Bounds the Toolkit dependency below 0.4. |
python/packages/azure-cosmos-memory/agent_framework_azure_cosmos_memory/_context_provider.py |
Implements compatible retrieval paths; procedural context requires instruction-priority handling. |
Review details
- Files reviewed: 5/6 changed files
- Comments generated: 1
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Motivation & Context
agent-framework-azure-cosmos-memorysupports Agent Memory Toolkit0.3.0b2, but its generic retrieval call silently omits selected episodic memories and bypasses the Toolkit's task-aware procedural projection. This prevents configured episode and procedure context from reaching agent runs.The provider must support the newer retrieval contract without dropping users on the existing
0.2.0b3compatibility floor.Description & Review Guide
0.4, and add focused contract coverage and documentation.0.3.0b2installations now retrieve configured episodic and procedural memory correctly, while supported0.2.xand0.3.0b1clients retain their existing call shapes.0.3.0b2task-aware path, including failure isolation and dependency bounds.Related Issue
Fixes #7923
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.