Skip to content

Bound Gemini no-progress tool loops - #183

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

Bound Gemini no-progress tool loops#183
Anteriousis wants to merge 1 commit into
10-X-eng:mainfrom
Anteriousis:fix/gemini-progress-guard

Conversation

@Anteriousis

Copy link
Copy Markdown
Contributor

Stop Gemini after three repeated identical tool observations with unchanged CAD state, including alternating stalled calls and repeated errors. Productive revisions reset the guard; explicit pending-job polls remain allowed within a new 64-request default turn ceiling. Both stops return actionable completion text and preserve completed work.

The issue's requested bounded behavior is enabled by default. Existing callers can explicitly set max_turns=None (or 0) for unlimited turns and no_progress_limit=0 to disable the new guard. The observation table is bounded to 128 entries.

Verification

  • Tests failed before implementation and pass afterward.
  • Exact test/build commands and results are listed below.

With the local pytest dependencies on PYTHONPATH, using the bundled Python executable:

& $python -m pytest -q src/Mod/VibeCAD/vibecad_tests/test_gemini_provider.py -k 'finite_default or stalled_calls' --tb=short
# Red: 5 failed, 3 passed, 9 deselected.
& $python -m pytest -q src/Mod/VibeCAD/vibecad_tests/test_gemini_provider.py src/Mod/VibeCAD/vibecad_tests/test_provider_subprocess.py --tb=short
# Green: 68 passed, 1 skipped (platform-specific).
& $python -m py_compile src/Mod/VibeCAD/VibeCADProvider.py
git diff --check

Focused mocked-provider tests cover repeated successes/errors, unknown tools, alternating calls, changing revisions, pending polls, and explicit opt-out. No paid API calls or full FreeCAD GUI/C++ build were run. A long legitimate workflow can hit the ceiling; callers can raise or disable it.

Compatibility

  • Existing public functions and parameters remain available.
  • No preference keys, tool names, or schemas renamed or removed.
  • Defaults preserve unlimited loops: intentionally changed as authorized by the request to fix Bound Gemini no-progress tool loops before they consume repeated API calls #176; explicit opt-outs retain that behavior.
  • No deprecations.
  • Behavioral changes and migration/rollback options are documented above.

Issues

Closes #176.

Before and After Images

Not applicable; no GUI layout changes.

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.

Bound Gemini no-progress tool loops before they consume repeated API calls

1 participant