picoclaw/docs/operations/debug.zh.md

36 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 调试 PicoClaw
> 返回 [README](../project/README.zh.md)
PicoClaw 在处理每一个请求时,都会在后台执行多个复杂的交互操作——从消息路由和复杂度评估,到工具执行和模型故障适配。能够准确地看到正在发生什么至关重要,这不仅有助于排查潜在问题,也有助于真正理解代理的运作方式。
## 以调试模式启动 PicoClaw
要获取代理运行的详细信息LLM 请求、工具调用、消息路由),可以使用调试标志启动 PicoClaw 网关:
```bash
picoclaw gateway --debug
# or
picoclaw gateway -d
```
在此模式下,系统会对日志进行详细格式化,并显示系统提示词和工具执行结果的预览。
## 禁用日志截断(完整日志)
默认情况下PicoClaw 会在调试日志中截断过长的字符串(例如*系统提示词*或大型 JSON 输出结果),以保持控制台的可读性。
如果你需要检查某个命令的完整输出,或发送给 LLM 模型的确切载荷,可以使用 `--no-truncate` 标志。
**注意:** 此标志*仅*在与 `--debug` 模式组合使用时有效。
```bash
picoclaw gateway --debug --no-truncate
```
当此标志激活时,全局截断功能将被禁用。这在以下场景中非常有用:
* 验证发送给提供商的消息的确切语法。
* 读取 `exec``web_fetch``read_file` 等工具的完整输出。
* 调试保存在内存中的会话历史。