Users/akataria/improvements#8
Merged
aayush3011 merged 4 commits intoMay 6, 2026
Merged
Conversation
added 2 commits
May 5, 2026 23:21
There was a problem hiding this comment.
Pull request overview
This PR tightens thread-scoping semantics for turn memories, improves determinism/performance of Cosmos queries, and hardens client behavior around reconnects and embedding generation so downstream processing/search behaves more reliably.
Changes:
- Require explicit
thread_idformemory_type="turn"inadd_local(sync/async) and update unit tests accordingly. - Make dedup-count extraction consistent with the pipeline contract (
merged + superseded) and add tests to reject legacy keys. - Improve Cosmos/pipeline behavior: deterministic ordering for reconciliation queries, single-partition queries for thread-scoped operations, embedding of non-turn memories on
push_to_cosmos, and guardrails against infinite “strip unsupported param” retry loops.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_cosmos_memory_client.py | Updates sync client tests for required thread_id on turns; adds tests for thread-id validation and embedding behavior on push. |
| tests/unit/aio/test_cosmos_memory_client.py | Updates async client tests for required thread_id on turns; adds validation test. |
| agent_memory_toolkit/cosmos_memory_client.py | Enforces thread_id for turn locals, drains Cosmos client on reconnect, and embeds non-turn records during push_to_cosmos. |
| agent_memory_toolkit/aio/cosmos_memory_client.py | Mirrors sync changes for async: turn validation, draining Cosmos client on reconnect, and embedding on push. |
| agent_memory_toolkit/pipeline.py | Adds deterministic ordering for reconciliation context and uses partition-keyed queries for thread-scoped reads. |
| agent_memory_toolkit/processors/inprocess.py | Updates dedup-count extraction to merged + superseded only. |
| agent_memory_toolkit/aio/processors/inprocess.py | Async mirror of dedup-count extraction update. |
| tests/unit/processors/test_inprocess.py | Updates processor tests for new dedup-count semantics; adds legacy-key test coverage. |
| tests/unit/aio/processors/test_inprocess.py | Updates async processor test for new dedup-count semantics. |
| agent_memory_toolkit/chat.py | Limits repeated “strip unsupported param” retries to avoid potential infinite loops. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- push_to_cosmos (sync + async): persist generated embeddings back to local_memory so a repeat push doesn't re-embed already-embedded non-turn records. - Update test comment: _make_memory auto-generates a UUID thread_id for non-turn types when omitted (it does not user-scope them). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.