Skip to content

feat(providers): make the agent tool-call ceiling configurable - #7430

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/configurable-max-tool-iterations
Sep 3, 2026
Merged

feat(providers): make the agent tool-call ceiling configurable#7430
waleedlatif1 merged 2 commits into
stagingfrom
fix/configurable-max-tool-iterations

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • MAX_TOOL_ITERATIONS now reads from an env var of the same name, defaulting to 20 — no behavior change unless it is set
  • Self-hosted deployments can raise the agent tool-call loop without maintaining a custom build (fixes Is MAX_TOOL_ITERATIONS = 20 intentionally fixed for self-hosted Agent blocks? #7428)
  • Non-numeric, zero, negative, or fractional values fall back to the 20 default via envNumber
  • Documented in .env.example, the self-hosting env-var docs, and the Helm values file

Type of Change

  • New feature (non-breaking change which adds functionality)

Testing

Tested manually. bun run type-check, bun run lint, and bun run check:audits (45 audits) all pass.

Checklist

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lm2sCA6iswCvNT33eNRrix

MAX_TOOL_ITERATIONS is now read from an env var of the same name and
defaults to 20, so self-hosted deployments can raise the agent tool loop
without a custom build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lm2sCA6iswCvNT33eNRrix
@vercel

vercel Bot commented Sep 3, 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 Sep 3, 2026 5:42am UTC

Request Review

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lm2sCA6iswCvNT33eNRrix
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes the agent tool-call iteration ceiling configurable for self-hosted deployments while preserving the existing default.

  • Adds validated MAX_TOOL_ITERATIONS environment configuration with a default of 20.
  • Documents the setting in the self-hosting guide, environment example, and Helm values.
  • Bumps the Helm chart patch version.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/providers/index.ts Replaces the fixed provider iteration limit with a validated environment-derived value and a fallback of 20.
apps/sim/lib/core/config/env.ts Registers MAX_TOOL_ITERATIONS as an optional server environment variable.
helm/sim/values.yaml Adds a commented Helm envDefaults example that is supported by the chart’s generic environment rendering.
helm/sim/Chart.yaml Advances the Helm chart patch version for the configuration addition.
apps/docs/content/docs/platform/self-hosting/environment-variables.mdx Documents how self-hosters can raise the agent tool-call ceiling and notes the additional model-call cost.
apps/sim/.env.example Adds the optional MAX_TOOL_ITERATIONS setting and its default to the example environment file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config[MAX_TOOL_ITERATIONS environment variable] --> Parse[envNumber validation]
  Parse -->|positive integer| Ceiling[Configured iteration ceiling]
  Parse -->|unset or invalid| Default[Default ceiling: 20]
  Ceiling --> Providers[Provider tool-call loops]
  Default --> Providers
Loading

Reviews (2): Last reviewed commit: "chore(helm): bump chart version for the ..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@waleedlatif1
waleedlatif1 merged commit fd8c0d0 into staging Sep 3, 2026
30 checks passed
@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1
waleedlatif1 deleted the fix/configurable-max-tool-iterations branch September 3, 2026 05:44

@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.

1 issue found across 6 files

Confidence score: 3/5

  • In helm/sim/Chart.yaml, installs that omit image.tag or image.digest continue using v0.8.18, so users will not receive the new configurable tool-call ceiling and behavior may differ from the chart’s intended release; update appVersion to a published release.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="helm/sim/Chart.yaml">

<violation number="1" location="helm/sim/Chart.yaml:5">
P1: When users install this chart without setting `image.tag` or `image.digest`, the default image remains `v0.8.18`, so the new configurable tool-call ceiling is not available. Update `appVersion` to a published release tag containing this change before shipping the chart.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread helm/sim/Chart.yaml
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