Commit 68ccf6c
committed
fix: prevent TS2589 type instantiation error in ToolCallback
Use [T] extends [U] pattern on the AnySchema check to prevent
distributive conditional types. This fixes the "Type instantiation
is excessively deep and possibly infinite" error that occurs when
using registerTool after upgrading to v1.23.0.
The issue was that AnySchema (z3.ZodTypeAny | z4.$ZodType) as a union
caused TypeScript to distribute the conditional type check, leading
to exponential type instantiation.
Fixes #11801 parent 466483f commit 68ccf6c
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | | - | |
| 1091 | + | |
1092 | 1092 | | |
1093 | 1093 | | |
1094 | 1094 | | |
| |||
0 commit comments