Skip to content

fix(providers): remove default agent tool-call iteration cap - #8829

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/agent-pending-tool-calls
Oct 9, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/agent-pending-tool-calls

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Agent block tool loops no longer stop at a default 20 model round trips; MAX_TOOL_ITERATIONS now caps them only when explicitly set to a positive integer (the execution timeout still bounds a run)
  • At the old cap, non-streaming provider loops exited with the model's final turn still requesting tools: those calls never ran and the turn's preamble text came back as the block output, breaking structured-output consumers downstream
  • Dropped the /MAX_TOOL_ITERATIONS denominator from iteration log lines, updated the env docs, .env.example, and the test mock's doc (mock keeps a finite test cap)

Type of Change

  • Bug fix

Testing

  • vitest run providers executor/handlers/agent (2150 passed)
  • bun run lint, bun run type-check (apps/sim), bun run check:audits (58 audits), docs-manifest:check
  • Full suite left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 9, 2026 2:18am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 12 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Changes agent tool-call loop behavior from capped to unbounded by default.

The PR appears safe to merge, with non-blocking documentation and regression-coverage improvements.

Findings

  1. P2 Timeout is not always enabled ▶
  2. P2 Long conversations lack regression coverage ▶

Summary

Removes the default 20-round Agent tool-call limit. MAX_TOOL_ITERATIONS now applies only when set to a positive integer. Provider logs drop the limit denominator, and documentation explains the new default.

  • Clarify that self-hosted execution timeouts are also optional.
  • Add a regression check for an Agent that finishes after more than 20 tool rounds.
  • waleedlatif1 explicitly intends unlimited production loops and a finite shared test limit; neither choice is reported as a defect.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Agent requests a model turn] --> B{Model requests tools?}
  B -->|No| C[Return final answer]
  B -->|Yes| D{Explicit iteration limit reached?}
  D -->|Yes| E[Existing capped-loop behavior]
  D -->|No| F[Run tools]
  F --> A
  G[Configured timeout or cancellation] --> H[Abort execution]
  H -.-> A
Loading

Reviews (1) · Last reviewed commit: "fix(providers): remove default agent too..." · Reviewed by Greptile

Comment thread apps/docs/content/docs/platform/self-hosting/environment-variables.mdx Outdated
Comment thread apps/sim/providers/index.ts
@waleedlatif1
waleedlatif1 merged commit 1ed08d8 into staging Oct 9, 2026
45 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/agent-pending-tool-calls branch October 9, 2026 02:28

This branch was successfully deployed

1 active deployment
Preview — 11bfe622 Deployed Oct 9, 2026 by vercel[bot]
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