除錯
本頁介紹用於串流輸出的除錯輔助工具,特別是在 provider mixes reasoning into normal text.執行期除錯覆寫
Use/debug in chat to set runtime-only config overrides (memory, not disk).
/debug 預設為停用;請以 commands.debug: true 啟用。
/debug 預設為停用;請以 commands.debug: true 啟用。
This is handy when you need to toggle obscure settings without editing openclaw.json.
範例:
/debug reset 會清除所有覆寫並回到磁碟上的設定。
Gateway 監看模式
為了快速迭代,請在檔案監看器下執行 Gateway 閘道器:gateway:watch 之後加入任何 Gateway 閘道器 CLI 旗標,重啟時都會一併傳遞。
Dev 設定檔 + dev gateway(—dev)
Use the dev profile to isolate state and spin up a safe, disposable setup for debugging. 共有 兩個--dev 旗標:
- 全域
--dev(設定檔): 將狀態隔離在~/.openclaw-dev之下,並將 Gateway 閘道器連接埠預設為19001(其衍生連接埠也會隨之位移)。 gateway --dev:告訴 Gateway 在缺少時自動建立預設設定 + 工作區(並略過 BOOTSTRAP.md)。
pnpm openclaw ... 執行 CLI。
其行為如下:
-
設定檔隔離(全域
--dev)OPENCLAW_PROFILE=devOPENCLAW_STATE_DIR=~/.openclaw-devOPENCLAW_CONFIG_PATH=~/.openclaw-dev/openclaw.jsonOPENCLAW_GATEWAY_PORT=19001(瀏覽器/畫布也會相應位移)
-
Dev 啟動(
gateway --dev)- 若缺少則寫入最小設定(
gateway.mode=local,繫結 local loopback)。 - 將
agent.workspace設為 dev 工作區。 - 設定
agent.skipBootstrap=true(不使用 BOOTSTRAP.md)。 - 若缺少則播種工作區檔案:
AGENTS.md、SOUL.md、TOOLS.md、IDENTITY.md、USER.md、HEARTBEAT.md。 - 預設身分:C3‑PO(protocol droid)。
- 在 dev 模式下略過頻道提供者(
OPENCLAW_SKIP_CHANNELS=1)。
- 若缺少則寫入最小設定(
--dev 是一個全域設定檔旗標,且會被某些執行器吃掉。
注意:--dev 是一個全域設定檔旗標,且會被某些執行器吃掉。
If you need to spell it out, use the env var form:
--reset 會清除設定、憑證、工作階段,以及 dev 工作區(使用
trash,而非 rm),然後重新建立預設的 dev 設定。
提示:如果已有非 dev 的 Gateway 閘道器正在執行(launchd/systemd),請先停止它:
原始串流記錄(OpenClaw)
OpenClaw 可以在任何過濾/格式化之前,記錄原始助理串流。 這是查看推理是否以純文字增量抵達 (或作為獨立的思考區塊)的最佳方式。 透過 CLI 啟用:~/.openclaw/logs/raw-stream.jsonl
原始分塊記錄(pi-mono)
為了在解析成區塊之前擷取原始 OpenAI 相容分塊, pi-mono 提供了獨立的記錄器:~/.pi-mono/logs/raw-openai-completions.jsonl
注意:這只會由使用 pi-mono 的
openai-completions 提供者的處理程序輸出。
安全性注意事項
- 原始串流記錄可能包含完整提示、工具輸出與使用者資料。
- Keep logs local and delete them after debugging.
- 若你分享日誌,請先清除祕密資訊與 PII。