Add files via upload

This commit is contained in:
公明
2026-07-21 21:02:45 +08:00
committed by GitHub
parent b54867e383
commit 8bd42a6f7a
4 changed files with 106 additions and 6 deletions
+1 -1
View File
@@ -715,7 +715,7 @@ func historyToMessages(history []agent.ChatMessage, appCfg *config.Config, mwCfg
opts = append(opts, schema.WithToolName(tn))
}
content := h.Content
if !h.ModelFacingTrace {
if !h.ModelFacingTrace || (toolContentMax > 0 && len(content) > toolContentMax) {
content = normalizeRestoredToolContent(content, toolContentMax)
}
raw = append(raw, schema.ToolMessage(content, h.ToolCallID, opts...))