Skip to content

fix: align ToolLoopAgent prepareCall types with runtime-supported settings - #18522

Open
ai-sdk-factory[bot] wants to merge 2 commits into
mainfrom
bugfix-18518-20260806160616629275
Open

fix: align ToolLoopAgent prepareCall types with runtime-supported settings#18522
ai-sdk-factory[bot] wants to merge 2 commits into
mainfrom
bugfix-18518-20260806160616629275

Conversation

@ai-sdk-factory

@ai-sdk-factory ai-sdk-factory Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Background

Valid ToolLoopAgent prepareCall code failed TypeScript checks for runtime-supported settings and advertised call-only fields that are never provided.

Root Cause

The prepareCall input and return types used incomplete Pick lists and an insufficient Omit list. The reproduction confirmed the omitted settings were available and honored at runtime while TypeScript rejected them, and that advertised call-only fields were stripped before invocation.

Summary

Added toolChoice, maxRetries, prepareStep, repairToolCall, and experimental_repairToolCall to prepareCall input and return types; removed unavailable call-only fields from its input type; added an ai patch changeset.

Testing

Added type regression coverage for all newly exposed settings and for exclusion of fields absent at runtime.

End-to-end Validation

  • pnpm -C packages/ai build followed by an in-memory TypeScript consumer compile against the generated declarations passed with the supported overrides and rejected-field assertions.

Related Issues

Fixes #18518

Closes #18520

ai-sdk-factory and others added 2 commits August 6, 2026 16:12
Co-authored-by: hyamero <78056869+hyamero@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolLoopAgent: prepareCall types also omit toolChoice, maxRetries, prepareStep, and repairToolCall present at runtime

1 participant