fix(agent): 执行边界 - 遵守策略上限并压缩工具协议

This commit is contained in:
ddCat committed 2026-09-22 11:43:42 +08:00
1 parent dc2002b010
commit c1d628b873
6 files changed
+40 -17

No files matched your search

+4 -1
View File
@@ -47,7 +47,10 @@ func agentStepMaxOutputTokensDefault() int {
func agentStepTimeoutSecondsDefault() int {
value := envInt("CANVAS_AGENT_STEP_TIMEOUT_SECONDS", DefaultRuntimeAgentStepTimeout)
return min(value, MaxRuntimeAgentStepTimeoutSeconds)
if value <= 0 {
return DefaultRuntimeAgentStepTimeout
}
return min(max(value, MinRuntimeAgentStepTimeoutSeconds), MaxRuntimeAgentStepTimeoutSeconds)
}
type RuntimeResourcePolicy struct {