openclaw-debugging
Skill59 starsChanged 16 days agoMITView on GitHub
Debug OpenClaw model/provider/tool-surface/code-mode/streaming and live/Crabbox behavior; choose logs, probes, proof path before code changes; fetch stored sessions, transcripts, attachments as evidence.
We split this skill into the rules it gives an agent
5 rules. 1 is common, 3 are distinctive, and 1 is very specific to this project.
1
Common
Most of the 7 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Search, Crabbox, CI: get debug signal before guessing.
- Distinctive: line 23
Add/enable narrowest signal proving boundary.
- Common: line 47
Only while debugging; prompts/message text may still appear.
- Distinctive: line 65
Provider payload: before SDK call, log fields, model id, service tier, reasoning, input size, metadata keys, prompt-cache key presence, …
- Very specific: line 127
Always open live stores readOnly: true.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenClaw Debugging
Behavior differs between local tests, live models, providers, code mode, Tool Search, Crabbox, CI: get debug signal before guessing.
Read First
docs/logging.md: log files,openclaw logs, targeted debug flags.docs/reference/test.md: local test commands.docs/tools/code-mode.md: code-mode exec/wait + tool catalog rules.$openclaw-testing: test-lane choice.$crabbox: broad, Docker, package, Linux, live-key, CI-parity proof.
Default Loop
- State suspected boundary: config, tool construction, provider payload, fetch, stream/SSE, transcript replay, worker/runtime, package/dist, CI.
- Add/enable narrowest signal proving boundary.
- Reproduce with same provider/model/config. Never randomly switch models unless model itself = tested variable.
- Compare configured state with actual run activation.
- Patch root cause.
- Rerun exact failing probe; broaden only if contract requires.
Model Transport Logs
Model request shape/stream timing: targeted env flags over global debug:
OPENCLAW_DEBUG_MODEL_TRANSPORT=1 openclaw gateway
OPENCLAW_DEBUG_MODEL_PAYLOAD=tools OPENCLAW_DEBUG_SSE=events openclaw gateway
OPENCLAW_DEBUG_MODEL_PAYLOAD=full-redacted OPENCLAW_DEBUG_SSE=peek openclaw gatewayUseful flags:
OPENCLAW_DEBUG_MODEL_TRANSPORT=1: request start, fetch response, SDK headers, first SSE event, stream done, transport errors atinfo.OPENCLAW_DEBUG_MODEL_PAYLOAD=summary: bounded payload summary.OPENCLAW_DEBUG_MODEL_PAYLOAD=tools: all model-facing tool names.OPENCLAW_DEBUG_MODEL_PAYLOAD=full-redacted: capped, redacted JSON payload. Only while debugging; prompts/message text may still appear.OPENCLAW_DEBUG_SSE=events: first-event + stream-completion timing.OPENCLAW_DEBUG_SSE=peek: first five redacted SSE events.OPENCLAW_DEBUG_CODE_MODE=1: code-mode tool-surface diagnostics.
Watch logs:
openclaw logs --followCommon Boundaries
- Config vs activation: enabled config can coexist with disabled run tools, raw run, empty allowlist, missing model tool support. Check actual visible tools before enforcing provider payload invariants.
- Tool surface: inspect final model-visible tool names, not only registry/
config. Code mode = exactly
exec+waitonly after actual activation. - Provider payload: before SDK call, log fields, model id, service tier, reasoning, input size, metadata keys, prompt-cache key presence, tool names.
- Fetch vs SSE: fetch response proves HTTP headers arrived; first SSE event proves provider body progress. Gap here = stream/body/provider issue, not tool execution.
- Worker/dist: touching workers, dynamic imports, package exports, lazy
runtime boundaries, published paths →
pnpm build. - Live keys: missing provider keys → configured secret workflow before declaring live proof blocked. Env checks presence-only; never print secrets.
Fetching Sessions and Transcripts
Chat-session bug report: fetch actual transcript, sender attribution, attachments as evidence.
CLI first (needs configured install; safe against live gateway):
openclaw sessions list --agent <agentId> --json
openclaw sessions tail
openclaw sessions export-trajectoryDocs: store layout docs/reference/database-schemas.md;
CLI https://docs.openclaw.ai/cli/sessions.
Raw store: CLI unavailable (e.g. remote host over SSH) or event-level detail needed:
- Per-agent data plane:
~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite. Canonical schema:src/state/openclaw-agent-schema.sql. - Hosted/systemd state: service user's home (e.g.
/home/openclaw/.openclaw/...), not root's. Root may have separate stray install with different agents. Expected agent dir missing: locate real DB withfind / -maxdepth 6 -name openclaw-agent.sqlite. - Web chat URL session-id fragment:
/chat/<agentId>/<slug>-<hex>. Resolve insession_nodes:session_key LIKE '%<hex>%'→current_session_id,display_name. Key shape:agent:<agentId>:<surface>:<uuid>; subagent sessions use surfacesubagent. - Transcript:
transcript_events(session_id,seq,event_json).event_json.message:role(user/assistant/toolResult) +content(string or parts of typetext/toolCall/image). - Sender provenance: real user messages carry
message.__openclaw(senderId,senderName,senderIsOwner); runtime-synthesized inputs do not. Distinguish operator-authored text from injected prompts with this. - Full-text transcript search:
session_transcript_fts. - Attachments:
media://inbound/<file>URLs →<state-dir>/media/inbound/<file>. - User-attached images ≠
imagecontent parts. Message envelope carriesmessage.__openclaw.media[]entries:url(media://inbound/<file>),contentType,kind,fileName. Parts-only extractor misses every image; grep rawevent_jsonformedia://. Remote host: scp files locally (one remote path per scp argument); read there.
Hosts without sqlite3 binary still have Node: node:sqlite needs no dependencies.
node -e 'const {DatabaseSync}=require("node:sqlite");
const db=new DatabaseSync(process.argv[1],{readOnly:true});
console.log(JSON.stringify(db.prepare(
"SELECT seq,event_json FROM transcript_events WHERE session_id=? ORDER BY seq"
).all(process.argv[2])))' <db-path> <session-id>- Always open live stores
readOnly: true; never write running gateway's state (rootAGENTS.mdValidation rules). - Realistic-data work: copy DB into dev state dir first.
Code Pointers
- Model payload + Responses stream:
src/agents/openai-transport-stream.ts - Guarded fetch/timing:
src/agents/provider-transport-fetch.ts - OpenAI/Codex provider wrappers:
src/llm/providers/stream-wrappers/openai.ts - Tool construction, Tool Search, code-mode activation:
src/agents/embedded-agent-runner/run/attempt.ts - Code-mode runtime and worker:
src/agents/code-mode.tssrc/agents/code-mode.worker.ts - Tool Search catalog:
src/agents/tool-search.ts
Proof Choice
- Single helper/payload bug: local targeted Vitest.
- Docs/logging-only:
pnpm check:docs+git diff --check. - Worker/dist/lazy import/package surface: targeted tests +
pnpm build. - Live provider/model behavior: same provider/model, debug flags, real key if available.
- Docker/package/Linux/CI-parity: current dedicated Linux worker when capable;
otherwise
$crabbox. - CI failure: exact SHA, relevant job only; logs only after failure/completion.
Output Habit
Report:
- boundary tested
- exact command/env shape, redacted
- observed signal, e.g. tool names or first SSE event timing
- fix location
- narrow proof + remaining risk
Other versions13 projects use a version of this.
Word for word · 6
- steipete/warelay★ 394k100% same
- moltbot/clawdbot★ 394k100% same
- moltbot/moltbot★ 394k100% same
- clawdbot/clawdbot★ 394k100% same
- steipete/clawdis★ 394k100% same
- openclaw/openclaw★ 394k100% same
Edited · 5
- molt-bot/clawdbot★ 391k49% same
- friuns2/openclaw-android-assistant★ 57349% same
- OpenClawAndroid/openclaw-android-assistant★ 55649% same
- clawsouls/soulclaw★ 947% same
- supermansuper563-ops/openclaw-workbench★ 050% same
Wrote their own version · 2
- openclaw/openclaw-windows-node★ 2.2ksame name
- shanselman/openclaw-windows-hub★ 2.2ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use openclaw-performance.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
clawdbotSkillopenclaw-performance
Performance work in OpenClaw: a slow or heavy flow (latency, CPU, memory, SQL, RPC, renders), writing or reviewing a perf PR, or adding a cache. Count the work, delete waste first, cache last.
Also in 6 projects that use this
In this repository107 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- extensions/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- test/AGENTS.mdAGENTS.md
- ui/AGENTS.mdAGENTS.md
- agent-transcriptSkill
- auto-qaSkill
- autoreviewSkill
- channel-message-flowsSkill
- clawdtributorSkill
- claw-scoreSkill
- clawsweeperSkill
- control-ui-e2eSkill
- crabboxSkill
- discord-clawdSkill
- discord-e2eSkill
- discord-user-postSkill
- discrawlSkill
- gitcrawlSkill
- graincrawlSkill
- notcrawlSkill
- openclaw-changelog-updateSkill
- openclaw-ci-limitsSkill
- openclaw-docker-e2e-authoringSkill
- openclaw-ghsa-maintainerSkill
- openclaw-live-updaterSkill
- openclaw-parallels-smokeSkill
- openclaw-pr-maintainerSkill
- openclaw-qa-testingSkill
- openclaw-refactor-docsSkill
- openclaw-release-validationSkill
- openclaw-repair-sweepSkill
- openclaw-secret-scanning-maintainerSkill
- openclaw-test-heap-leaksSkill
- openclaw-testingSkill
- openclaw-test-performanceSkill
- openclaw-updateSkill
- parallels-discord-roundtripSkill
- plugin-sdk-impactSkill
- proof-videoSkill
- prototype-openclaw-tuiSkill
- pr-simplifySkill
- release-openclaw-announcementSkill
- release-openclaw-ciSkill
- release-openclaw-macSkill
- release-openclaw-maintainerSkill
- release-openclaw-plugin-testingSkill
- security-triageSkill
- slack-e2eSkill
- slacrawlSkill
- solidSkill
- tag-duplicate-prs-issuesSkill
- technical-documentationSkill
- telegram-e2e-userbotSkill
- test-auditSkill
- update-team-serverSkill
- verify-releaseSkill
- 1passwordSkill
- apple-notesSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

