Repository navigation
Conversation
…5/U6) - U4: exact-entry tools (get/update/delete/delete_with_profile) accept a nested citation object (memory_ref/entry_id/entry_version_id) with precedence memory_ref > entry_id > entry_version_id; legacy flat memory_id kept as backward-compatible alias. - U5: request-scoped request_id via contextvars, shared by tool body and access-log record; internal bridge flag exposed via mark_internal_bridge/is_internal_bridge. - U6: access_logged decorator emits exactly one transport.request.completed event per logical tool call (operation=mcp.tools.call, transport=mcp). - tests: 20 unit tests covering citation resolution, precedence, prefix stripping and single-count logging (all passing).
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.
Which issue or RFC does this PR close?
N/A.
Rationale for this change
MCP tool calls could only address a memory through the legacy flat
memory_id, which makes it impossible to reference a specific entry or entry version, and each logical tool call could emit more than one access-log event, so usage accounting was unreliable.What changes are included in this PR?
get/update/delete/delete_with_profile) now accept a nested citation object (memory_ref/entry_id/entry_version_id) with precedencememory_ref>entry_id>entry_version_id. The legacy flatmemory_idis kept as a backward-compatible alias.request_idviacontextvars, shared between the tool body and the access-log record; the internal bridge flag is exposed throughmark_internal_bridge/is_internal_bridge.access_loggeddecorator now emits exactly onetransport.request.completedevent per logical tool call (operation=mcp.tools.call,transport=mcp).Are there any user-facing changes?
No breaking change for existing callers: flat
memory_idrequests keep working as before. Exact-entry tools additionally accept the nested citation object.How was this change tested?
Per the commit message of
3b0bfb2: 20 unit tests cover citation resolution, precedence, prefix stripping and single-count logging. Added test file:tests/unit/test_mcp_contract_u456.py.AI usage statement
Not applicable.