Skip to content

fix: raise AI chat tool roundtrip limit from 5 to 10#1096

Merged
datlechin merged 1 commit into
mainfrom
fix/raise-ai-tool-roundtrip-limit
May 7, 2026
Merged

fix: raise AI chat tool roundtrip limit from 5 to 10#1096
datlechin merged 1 commit into
mainfrom
fix/raise-ai-tool-roundtrip-limit

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

AIChatViewModel.maxToolRoundtrips was set to 5. The assistant hit the cap on routine tasks: discovering a table schema after a column error, retrying a query, then proposing a corrected version uses 3–4 roundtrips on its own. Multi-step migrations or "find and fix" tasks blow through 5 immediately, leaving the user with a generic "AI made too many tool calls in one response" banner and no recourse other than rephrasing.

Bumps the cap to 10. Single-line change. The cap remains a safety against runaway tool-calling loops, but at a level that fits real iteration patterns.

Follow-ups (not in this PR)

  • Cancelled tool calls should arguably not consume a roundtrip — a "Cancel" cancels the call but should let the user redirect, not burn quota.
  • A user-visible "Continue" affordance once the cap hits, so the user can opt in to more rounds rather than starting over.
  • A user setting if 10 turns out to be insufficient for some workflows.

Test plan

  • Build the project.
  • Trigger a multi-step assistant task (e.g., "find all tables with a deprecated column and rename it"). Confirm the assistant can chain at least 8–9 tool roundtrips before the cap.
  • Confirm the cap still fires for genuinely runaway loops (e.g., manufactured infinite tool calls in tests, if any).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit a4977bc into main May 7, 2026
2 checks passed
@datlechin datlechin deleted the fix/raise-ai-tool-roundtrip-limit branch May 7, 2026 17:14
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.

1 participant