Repository navigation
fix(reflect): a full context no longer skips the required recall step (#4563) - #5292
Merged
Merged
Conversation
nicoloboschi
force-pushed
the
fix/4563-forced-recall-fits
branch
from
October 6, 2026 10:37
4781c36 to
3549bef
Compare
…#4563) When an earlier retrieval step (observations, mental models) returned enough text to hit the context budget, reflect stopped and answered right away, so the forced raw-fact recall never ran and the answer could miss newer facts and corrections. Now, when a forced step is still pending and the conversation is over budget, the earlier tool results are blanked in the model-facing conversation (oldest first) until the call fits. The full results stay in the evidence history, and once the forced steps finish the answer is written from that full history, not from the shortened conversation. If blanking is not enough, the old behaviour applies (answer from what was gathered); no new error paths. Also: single-chunk final synthesis now uses the splitter's chunk, which token-cuts an indivisible oversized result instead of dropping it. Supersedes #4747, keeping its compaction idea and dropping its new hard failures (noncompliance and step-limit errors).
nicoloboschi
force-pushed
the
fix/4563-forced-recall-fits
branch
from
October 6, 2026 11:07
3549bef to
a4d4278
Compare
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 #4563. Supersedes #4747.
What users saw
Reflect (and mental-model refresh) first reads summaries, then is required to check raw memories. When the summaries were long enough to fill the context budget, reflect stopped and answered right away. The raw-memory check never ran, so answers could miss newer facts and corrections.
What changes
What was dropped from #4747
#4747 turned a model ignoring the "call recall now" instruction, a low step limit, or a provider context error into hard 500s. That broke 3 existing tests (a no-tools model got a misleading error) and could fail every reflect under a lowered step limit. The ignored-instruction case is already handled on main by retrying the step (#5236).
Tests
test_big_observations_do_not_skip_forced_recall(both "recall on the last turn" and "turns to spare"): red on main (recall never called), green here.test_reflect_agent.py,test_reflect_split_synthesis.py,test_mental_model_no_answer_preserved.py,test_reflect_document_answer.py: 153 passed.