Conversation
由于3.28的bug,每次 /NEW命令,不会注入系统提示词,我在这里加了一段提示,让AI去读取AGENTS.md,AI再根据AGENTS.md的要求去读取其他配置文件。解决失忆的问题。不太懂代码,所以硬编码了我自己配置文件的目录。
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough将工具调用提示模板从要求模型输出 Changes
代码审查工作量估计🎯 3 (Moderate) | ⏱️ ~20 minutes 已更新的现有节概览此次更改修改了工具调用提示模板,要求模型输出采用 XML 变更内容
代码审查工作量估计🎯 3 (Moderate) | ⏱️ ~20 分钟 兔子的贺诗
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/zero-token/tool-calling/web-tool-prompt.ts`:
- Around line 47-49: The Chinese template's JSON example in web-tool-prompt.ts
is inconsistent with the required OpenAI format (it shows {"number":"5"} but
parser expects {"name":"...","arguments":{...}}); update the Chinese example
(the <tool_call id="call_001" name="plus_one"> sample) to the full format
matching the English template (e.g.
{"name":"plus_one","arguments":{"number":"5"}}) so web-tool-parser.ts's extract
logic (lines ~84-89) can correctly parse tool calls.
- Line 54: Remove the hardcoded user-specific path
"~/.openclaw-zero/workspace/AGENTS.md" from the prompt template in
web-tool-prompt.ts (the prompt string/variable or builder that injects
tool-calling instructions); instead either delete the line from the template or
replace it with a configurable placeholder and accept the actual path via a
config/parameter (e.g., an injected options value or agentConfigPath passed into
the function that builds the prompt). Update the function/variable that
constructs the prompt so it no longer embeds user-specific filesystem locations
and document the new config placeholder/parameter in the function signature or
exported config interface.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 309a580e-15c8-4f71-8d78-2534721f3b17
📒 Files selected for processing (1)
src/zero-token/tool-calling/web-tool-prompt.ts
Update tool call format to include 'name' and 'arguments' in JSON.
由于3.28的bug,每次 /NEW命令,不会注入系统提示词,我在这里加了一段提示,让AI去读取AGENTS.md,AI再根据AGENTS.md的要求去读取其他配置文件。解决失忆的问题。不太懂代码,所以硬编码了我自己配置文件的目录。
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Failure Recovery (if this breaks)
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.Summary by CodeRabbit
<tool_call>包装输出,取代此前的 code-block JSON 格式,提升可解析性。