Skip to content

Conversation

@codewarnab
Copy link

@codewarnab codewarnab commented Dec 10, 2025

Description

Fixes #10995 type inference issue for dynamic tools in useChat.

Changing ToolCall<string, unknown> to ToolCall<string, any> for dynamic tools allows for better type narrowing when using discriminated unions on toolCall.input.

Verification

  • Verified locally that tsc builds correctly.
  • Existing tests were run but failed due to unrelated environment issues on main branch.

Copilot AI review requested due to automatic review settings December 10, 2025 10:25
@codewarnab codewarnab marked this pull request as draft December 10, 2025 10:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR attempts to fix type inference for dynamic tools in useChat by changing the input type parameter from unknown to any in the InferUIMessageToolCall type definition. The PR also includes formatting adjustments to union type declarations.

  • Changes dynamic tool input type from ToolCall<string, unknown> to ToolCall<string, any> on line 495
  • Reformats union type indentation for consistency throughout the file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codewarnab codewarnab marked this pull request as ready for review December 10, 2025 10:38
@codewarnab
Copy link
Author

@aayush-kapoor can you check now

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.

useChat onToolCall callback lacks proper type inference for tool inputs

1 participant