fix(翻译超时):超时报错修改
deploy-hxtesting / build-and-deploy (push) Successful in 1m16s

This commit is contained in:
runny committed 2026-11-30 21:51:15 +08:00
1 parent c6088aeb4b
commit f12128a5c3
4 files changed
+136 -33

No files matched your search

+8
View File
@@ -44,6 +44,12 @@ const (
// 600-second command timeout so the tool can return a structured timeout
// result instead of being cancelled first by the generic agent wrapper.
shellExecToolTimeout = 10*time.Minute + 5*time.Second
// xlsxTranslateToolTimeout is slightly longer than xlsx_translate's own
// 20-minute internal budget so the tool can return a structured timeout
// result instead of being cancelled first by the generic agent wrapper.
// Workbook translation runs many LLM batches serialised by the provider's
// concurrency gate, which no other tool comes close to needing.
xlsxTranslateToolTimeout = 20*time.Minute + 5*time.Second
// webFetchToolSlack is how much longer the agent wrapper waits than the
// shared page-fetch budget. Same 5s headroom as shell_exec, so web_fetch can
// return its own timeout result instead of being cancelled first.
@@ -117,6 +123,8 @@ func toolExecutionTimeout(toolName string, arguments ...string) time.Duration {
switch toolName {
case "shell_exec":
return shellExecToolTimeout
case agenttools.ToolXlsxTranslate:
return xlsxTranslateToolTimeout
case "web_fetch":
return webfetch.PageFetchTimeout() + webFetchToolSlack
}