From df0d7e20e6c73ba08c366678ca44dd8b4c8a2250 Mon Sep 17 00:00:00 2001 From: lc6464 <64722907+lc6464@users.noreply.github.com> Date: Sat, 4 Apr 2026 12:35:27 +0800 Subject: [PATCH] fix(tool): improve formatting of escaping rules in CLI tool prompt --- pkg/providers/toolcall_utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/providers/toolcall_utils.go b/pkg/providers/toolcall_utils.go index 2f5597d51..c5e6ad007 100644 --- a/pkg/providers/toolcall_utils.go +++ b/pkg/providers/toolcall_utils.go @@ -26,7 +26,9 @@ func buildCLIToolsPrompt(tools []ToolDefinition) string { sb.WriteString("Escaping rules for string arguments:\n") sb.WriteString("- `\\n` means a real newline.\n") sb.WriteString("- To pass a literal backslash+n (`\\n`), encode it as `\\\\n` inside arguments JSON.\n") - sb.WriteString("- Because `arguments` is itself a JSON string, this often appears as `\\\\\\\\n` in the outer payload.\n\n") + sb.WriteString( + "- Because `arguments` is itself a JSON string, this often appears as `\\\\\\\\n` in the outer payload.\n\n", + ) sb.WriteString("### Tool Definitions:\n\n") for _, tool := range tools {