Repository navigation
Conversation
…lated tools Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
This branch has not been deployed
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.
The bug
_finalize_tool_result clears the whole run-scoped readonly replay cache after any successful non-readonly tool call. remember is non-readonly because it mutates ~/.vibe-trading/memory/, which has no relationship to what read_url, web_search, or session_search would return -- but the system prompt encourages the model to call it often, so every remember() call forces every readonly result since the last compaction to be re-fetched instead of replayed.
The fix
Added an invalidates_readonly_cache flag (default True, preserving today's behavior) and opted RememberTool out of it, since its writes never touch workspace/run_dir state a readonly tool reads.
Tests
Added a case with an unrelated remember() call interleaved between a readonly call and its post-compaction repeat, confirming it's still served from the cache. All 16 existing readonly-replay tests still pass, including the one confirming a genuine write still invalidates the cache.
Fixes #2309