Repository navigation
The request ledger identifies unchanged memory polls - #1487
Merged
zlareb1 merged 1 commit intoNov 26, 2026
Merged
Conversation
Signed-off-by: ningsiyuan1024 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
approved these changes
Nov 25, 2026
zlareb1
left a comment
Member
There was a problem hiding this comment.
No findings. HTTP and MCP record the poll flag without storing the memory value. All 28 focused ledger and event projection tests pass.
Member
|
@ningsiyuan1024 plz sign CLA |
2 of 3 tasks
zlareb1
reviewed
Nov 25, 2026
zlareb1
left a comment
Member
There was a problem hiding this comment.
The Postgres 18 storage job times out while flushing trace_log. The same test returns ClickHouse code 159 on clean main when the trace log is delayed. It passes with the repair's query-log-only flush while the trace log is still delayed. Failed job · Repair #1495
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.
Related: #1149
Changelog category
Improvement
Changelog entry
The request ledger records whether a conditional
memory.getmatched the revision its caller already held.Why
A get and an unchanged poll can name the same memory id and version on two requests in a run. The existing event recorded the id and version for both. Recording the handler's
unchangedresult lets a reader identify the poll without looking up the current memory.Scope and risk
The flag describes an exact get. Fields selected by a caller and MCP response trimming still govern the content it receives. Search receipts and client-reported reliance remain separate work under the linked issue.
Compatibility, rollout and rollback
The event's existing args map gains
out_unchangedas a string when the handler reported a boolean. Earlier rows lack the key and have unknown poll status. Operators can deploy or revert the change without a migration or backfill.Tests
python -m pytest -q tests/unit/test_ledger_invariants.py -k get_ledger_distinguisheschecks two revisions of one memory in a run, an unchanged poll, a metadata projection and a miss. On the base commit it fails on the missing ledger field. The ledger, event projection, MCP response and documentation selections passed (315 tests).With a private HTTP server and ClickHouse, set a memory, read it under a run, update it, read it again and poll with
if_versionequal to the updated version. The three persisted request ids were distinct. The first row retained the original revision. The other two named the updated revision without_unchangedset tofalseandtruerespectively.AI assistance in the code
AI-generated. I designed and reviewed the change. OpenAI Codex implemented the patch.
Checklist
Note
Low Risk
Observability-only addition to ledger argument projection with no migration; older rows simply omit the new field.
Overview
The request ledger now records
out_unchangedonmemory.getrows when the handler returns a booleanunchanged, so analysts can tell anif_versionpoll that matched the caller’s revision (true) from a normal read or metadata-only response (false) even whenout_memory_idandout_versionare identical. Older rows without the field are documented as having unknown poll status.Run documentation in
runs.mdwas updated to describeout_memory_id,out_version, andout_unchangedtogether and to clarify that these fields do not imply agent reliance.A unit test exercises two revisions, an unchanged poll, a trimmed metadata get, and a miss to lock in the invariant.
Reviewed by Cursor Bugbot for commit 56f7dfe. Bugbot is set up for automated code reviews on this repo. Configure here.