🐛 fix: 修复 prompt 模板花括号转义,避免 str.format() KeyError

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
朱潮 2026-04-04 23:36:09 +08:00
parent b1b98caad7
commit 59cf7fd904
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ The filesystem backend is currently operating in: `{agent_dir_path}`
- **Tools** (e.g., `rag_retrieve`, `read_file`, `bash`): Directly callable via tool_call interface with structured parameters. - **Tools** (e.g., `rag_retrieve`, `read_file`, `bash`): Directly callable via tool_call interface with structured parameters.
- **Skills** (e.g., `baidu-search`, `pdf`, `xlsx`): Multi-step workflows executed by: (1) reading SKILL.md, (2) extracting the command, (3) running it via the `bash` tool. - **Skills** (e.g., `baidu-search`, `pdf`, `xlsx`): Multi-step workflows executed by: (1) reading SKILL.md, (2) extracting the command, (3) running it via the `bash` tool.
❌ WRONG: Generating a tool_call with `{"name": "baidu-search", "arguments": {...}}` ❌ WRONG: Generating a tool_call with `{{"name": "baidu-search", "arguments": {{...}}}}`
✅ CORRECT: Using `read_file` to read SKILL.md, then using `bash` to execute the script ✅ CORRECT: Using `read_file` to read SKILL.md, then using `bash` to execute the script
If you see a skill name in the "Available Skills" list, it is NEVER a tool you can call directly. If you see a skill name in the "Available Skills" list, it is NEVER a tool you can call directly.

View File

@ -90,7 +90,7 @@ The todo list is a planning tool - use it judiciously to avoid overwhelming the
- **Tools** (e.g., `rag_retrieve`, `read_file`, `bash`): Directly callable via tool_call interface with structured parameters. - **Tools** (e.g., `rag_retrieve`, `read_file`, `bash`): Directly callable via tool_call interface with structured parameters.
- **Skills** (e.g., `baidu-search`, `pdf`, `xlsx`): Multi-step workflows executed by: (1) reading SKILL.md, (2) extracting the command, (3) running it via the `bash` tool. - **Skills** (e.g., `baidu-search`, `pdf`, `xlsx`): Multi-step workflows executed by: (1) reading SKILL.md, (2) extracting the command, (3) running it via the `bash` tool.
❌ WRONG: Generating a tool_call with `{"name": "baidu-search", "arguments": {...}}` ❌ WRONG: Generating a tool_call with `{{"name": "baidu-search", "arguments": {{...}}}}`
✅ CORRECT: Using `read_file` to read SKILL.md, then using `bash` to execute the script ✅ CORRECT: Using `read_file` to read SKILL.md, then using `bash` to execute the script
If you see a skill name in the "Available Skills" list, it is NEVER a tool you can call directly. If you see a skill name in the "Available Skills" list, it is NEVER a tool you can call directly.