Repository navigation
fix(reflect): replace memory ids the model never saw in answers and pages (#5166) - #5302
Merged
Merged
Conversation
…ages (#5166) Reflect validated the structured memory_ids of done against what it retrieved, but took the answer text as written. A full UUID the model made up or garbled (often sharing the first 8 characters with a real one), or that the length rewrite garbled from a correct citation, was stored in the mental model page and 404'd when resolved. - ToolResultPresenter records every UUID the model was shown: the raw tool results (so cited real ids pass) and the opening prompt (question, directives). - After the length rewrite, on both the done path (text and structured document) and forced synthesis, any UUID outside that set becomes "[unverified id]". A UUID quoted inside a memory, like a request id, is kept. - Regression tests: made-up id in done, rewrite garbling a document citation, forced synthesis, plus a presenter unit test.
This was referenced Oct 8, 2026
Merged
This was referenced Oct 16, 2026
Merged
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.
Fixes #5166.
Problem
Reflect checked the structured
memory_idsofdoneagainst what it retrieved, but kept the answer text exactly as written. So a full UUID that was made up or garbled was stored in the answer and the mental-model page, and returned 404 when looked up. These IDs often share their first 8 characters with a real ID. Two sources:donegot right (the case raised in the issue comments).Fix
ToolResultPresenterrecords every UUID the model was shown. That covers the raw tool results (so real retrieved IDs, cited by alias or in full, pass) and the opening prompt (question, directives, mission).[unverified id]. This runs on thedonepath (markdown and structured document) and on forced synthesis.Tests
Each scripts the model and runs the real
run_reflect_agent. All three fail onmain(the fake ID survives) and pass with the fix:donecites a real alias plus a fake ID that shares the real one's prefix. The fake is replaced, and the real ID and a quoted request id stay.There is also a presenter unit test.
Not covered
An ID copied from an older version of a page the model read still passes, because the model did see it. Catching that would mean checking every cited ID against the bank.