fix(debug): fix Zod 4 compatibility in tool-executor

In Zod 4, _def.defaultValue is the value itself, not a function.
This was causing 'curr._def.defaultValue is not a function' error
when the debug dashboard tried to extract tool definitions.
This commit is contained in:
Rin
2026-02-18 11:12:46 +08:00
committed by Neko Ayaka
parent e9dd2ce0ac
commit 377d9378bd
@@ -147,7 +147,8 @@ export class ToolExecutor {
curr = curr._def.schema
}
else if (typeId === 'ZodDefault') {
defaultValue = curr._def.defaultValue()
// In Zod 4, defaultValue is the value itself, not a function
defaultValue = curr._def.defaultValue
curr = curr._def.innerType
}
else {