mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-11 08:19:01 +08:00
fix(mcp): 修复 MCP 配置 timeout 字段不支持字符串类型的问题 (#12384)
fix(mcp): allow string input for timeout in mcp config Co-authored-by: Sun <10309831+x_taiyang@user.noreply.gitee.com>
This commit is contained in:
parent
7a7089e315
commit
bdf8f103c8
@ -123,7 +123,15 @@ export const McpServerConfigSchema = z
|
||||
* 请求超时时间
|
||||
* 可选。单位为秒,默认为60秒。
|
||||
*/
|
||||
timeout: z.number().optional().describe('Timeout in seconds for requests to this server'),
|
||||
timeout: z
|
||||
.preprocess((val) => {
|
||||
if (typeof val === 'string' && val.trim() !== '') {
|
||||
const parsed = Number(val)
|
||||
return isNaN(parsed) ? val : parsed
|
||||
}
|
||||
return val
|
||||
}, z.number().optional())
|
||||
.describe('Timeout in seconds for requests to this server'),
|
||||
/**
|
||||
* DXT包版本号
|
||||
* 可选。用于标识DXT包的版本。
|
||||
|
||||
Loading…
Reference in New Issue
Block a user