Skip to content

Fix Gemini replay of unchanged CAD state - #180

Open
Anteriousis wants to merge 1 commit into
10-X-eng:mainfrom
Anteriousis:fix/gemini-unchanged-state
Open

Fix Gemini replay of unchanged CAD state#180
Anteriousis wants to merge 1 commit into
10-X-eng:mainfrom
Anteriousis:fix/gemini-unchanged-state

Conversation

@Anteriousis

@Anteriousis Anteriousis commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

  • For code changes, a test failed before the implementation and passes afterward; for non-code changes, the PR explains why TDD does not apply.
  • The PR lists the exact build and test commands and their results.

Tests ran on Windows using the bundled Python interpreter and isolated pytest/jsonschema dependencies. In the commands below, $python and $git stand for the absolute executable paths used during verification; machine-specific paths are omitted.

Before the implementation:

& $python -m pytest -q src/Mod/VibeCAD/vibecad_tests/test_gemini_provider.py -k only_sends_changed_state --tb=short

Result: 3 failed, 1 passed, 9 deselected. The three VibeScript cases reproduced redundant state; the native-engine case already passed.

After the implementation:

& $python -m pytest -q src/Mod/VibeCAD/vibecad_tests/test_gemini_provider.py src/Mod/VibeCAD/vibecad_tests/test_provider_subprocess.py --tb=short

Result: 64 passed, 1 skipped.

Additional checks:

& $python -m py_compile src/Mod/VibeCAD/VibeCADProvider.py src/Mod/VibeCAD/vibecad_tests/test_gemini_provider.py
& $git diff --check

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

  • Existing public functions and APIs remain present.
  • No preference keys, tool names, or schema fields were renamed or removed.
  • Existing model settings and productive tool execution remain unchanged.
  • Changed CAD state, tool results, call IDs, and thought signatures remain available.
  • No deprecations, dependency changes, packaging changes, or public API breaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid replaying unchanged VibeScript state in Gemini tool results

1 participant