Fix Gemini replay of unchanged CAD state - #180
Open
Anteriousis wants to merge 1 commit into
Open
Conversation
8 tasks
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.
Gemini previously attached the complete VibeScript state after every tool call, including reads that left it unchanged. This two-line fix passes the pre-tool context to the existing comparison helper, so unchanged state is omitted and changed state is delivered once.
Regression tests cover document revision, surface and workbench changes, native-engine state omission, and multiple calls within one model response. Tool results, call IDs, and Gemini thought signatures are preserved.
Verification
Tests ran on Windows using the bundled Python interpreter and isolated pytest/jsonschema dependencies. In the commands below,
$pythonand$gitstand for the absolute executable paths used during verification; machine-specific paths are omitted.Before the implementation:
Result: 3 failed, 1 passed, 9 deselected. The three VibeScript cases reproduced redundant state; the native-engine case already passed.
After the implementation:
Result: 64 passed, 1 skipped.
Additional checks:
Both passed.
No paid model requests were made. Provider streams and the CAD bridge were mocked. No full C++ build or live GUI test was run; the production change is limited to Python request construction.
Issues
Fixes #175.
Follow-up to the provider payload optimization in #130.
Before and After Images
Not applicable: no GUI changes. Previously each unchanged read added another state block to the model conversation; afterward unchanged reads preserve the useful tool result without that redundant block.
Compatibility