3.7 KiB
summary, read_when
| summary | read_when | |||
|---|---|---|---|---|
| Debugging tools: watch mode, raw model streams, and tracing reasoning leakage |
|
Debugging
This page covers debugging helpers for streaming output, especially when a provider mixes reasoning into normal text.
Runtime debug overrides
Use /debug in chat to set runtime-only config overrides (memory, not disk).
This is handy when you need to toggle obscure settings without editing clawdbot.json.
Examples:
/debug show
/debug set messages.responsePrefix="[clawdbot]"
/debug unset messages.responsePrefix
/debug reset
/debug reset clears all overrides and returns to the on-disk config.
Gateway watch mode
For fast iteration, run the gateway under the file watcher:
pnpm gateway:watch --force
This maps to:
tsx watch src/entry.ts gateway --force
Add any gateway CLI flags after gateway:watch and they will be passed through
on each restart.
Dev profile + dev gateway (--dev)
Use the dev profile to isolate state and spin up a safe, disposable setup for
debugging. There are two --dev flags:
- Global
--dev(profile): isolates state under~/.clawdbot-devand defaults the gateway port to19001(derived ports shift with it). gateway --dev: tells the Gateway to auto-create a default config + workspace when missing (and skip BOOTSTRAP.md).
Recommended flow:
pnpm clawdbot --dev gateway --dev
pnpm clawdbot --dev tui
What this does:
-
Profile isolation (global
--dev)CLAWDBOT_PROFILE=devCLAWDBOT_STATE_DIR=~/.clawdbot-devCLAWDBOT_CONFIG_PATH=~/.clawdbot-dev/clawdbot.jsonCLAWDBOT_GATEWAY_PORT=19001(bridge/canvas/browser shift accordingly)
-
Dev bootstrap (
gateway --dev)- Writes a minimal config if missing (
gateway.mode=local, bind loopback). - Sets
agent.workspaceto the dev workspace. - Sets
agent.skipBootstrap=true(no BOOTSTRAP.md). - Seeds the workspace files if missing:
AGENTS.md,SOUL.md,TOOLS.md,IDENTITY.md,USER.md,HEARTBEAT.md. - Default identity: C3‑PO (protocol droid).
- Writes a minimal config if missing (
Reset flow (fresh start):
pnpm clawdbot --dev gateway --dev --reset
--reset wipes config, credentials, sessions, and the dev workspace (using
trash, not rm), then recreates the default dev setup.
Tip: if a non‑dev gateway is already running (launchd/systemd), stop it first:
clawdbot daemon stop
Raw stream logging (Clawdbot)
Clawdbot can log the raw assistant stream before any filtering/formatting. This is the best way to see whether reasoning is arriving as plain text deltas (or as separate thinking blocks).
Enable it via CLI:
pnpm gateway:watch --force --raw-stream
Optional path override:
pnpm gateway:watch --force --raw-stream --raw-stream-path ~/.clawdbot/logs/raw-stream.jsonl
Equivalent env vars:
CLAWDBOT_RAW_STREAM=1
CLAWDBOT_RAW_STREAM_PATH=~/.clawdbot/logs/raw-stream.jsonl
Default file:
~/.clawdbot/logs/raw-stream.jsonl
Raw chunk logging (pi-mono)
To capture raw OpenAI-compat chunks before they are parsed into blocks, pi-mono exposes a separate logger:
PI_RAW_STREAM=1
Optional path:
PI_RAW_STREAM_PATH=~/.pi-mono/logs/raw-openai-completions.jsonl
Default file:
~/.pi-mono/logs/raw-openai-completions.jsonl
Note: this is only emitted by processes using pi-mono’s
openai-completionsprovider.
Safety notes
- Raw stream logs can include full prompts, tool output, and user data.
- Keep logs local and delete them after debugging.
- If you share logs, scrub secrets and PII first.