{"kind":"Skill","metadata":{"namespace":"community","name":"openclaw-debugging","version":"0.1.0"},"spec":{"description":"Debug OpenClaw model, provider, tool-surface, code-mode, streaming, and live/Crabbox behavior by choosing the right logs, probes, and proof path before changing code.","files":{"SKILL.md":"---\nname: openclaw-debugging\ndescription: Debug OpenClaw model, provider, tool-surface, code-mode, streaming, and live/Crabbox behavior by choosing the right logs, probes, and proof path before changing code.\n---\n\n# OpenClaw Debugging\n\nUse this skill when OpenClaw behavior differs between local tests, live models,\nproviders, code mode, Tool Search, Crabbox, or CI, and the next move should be a\ndebug signal rather than a guess.\n\n## Read First\n\n- `docs/logging.md` for log files, `openclaw logs`, and targeted debug flags.\n- `docs/reference/test.md` for local test commands.\n- `docs/reference/code-mode.md` for code-mode exec/wait and tool catalog rules.\n- Use `$openclaw-testing` for choosing test lanes.\n- Use `$crabbox` for broad, Docker, package, Linux, live-key, or CI-parity proof.\n\n## Default Loop\n\n1. State the suspected boundary: config, tool construction, provider payload,\n   fetch, stream/SSE, transcript replay, worker/runtime, package/dist, or CI.\n2. Add or enable the narrowest signal that proves that boundary.\n3. Reproduce with the same provider/model/config. Do not randomly switch models\n   unless the model itself is the variable being tested.\n4. Compare configured state with actual run activation.\n5. Patch the root cause.\n6. Rerun the exact failing probe, then broaden only if the contract requires it.\n\n## Model Transport Logs\n\nUse targeted env flags instead of global debug when the model request shape or\nstream timing matters:\n\n```bash\nOPENCLAW_DEBUG_MODEL_TRANSPORT=1 openclaw gateway\nOPENCLAW_DEBUG_MODEL_PAYLOAD=tools OPENCLAW_DEBUG_SSE=events openclaw gateway\nOPENCLAW_DEBUG_MODEL_PAYLOAD=full-redacted OPENCLAW_DEBUG_SSE=peek openclaw gateway\n```\n\nUseful flags:\n\n- `OPENCLAW_DEBUG_MODEL_TRANSPORT=1`: request start, fetch response, SDK\n  headers, first SSE event, stream done, and transport errors at `info`.\n- `OPENCLAW_DEBUG_MODEL_PAYLOAD=summary`: bounded payload summary.\n- `OPENCLAW_DEBUG_MODEL_PAYLOAD=tools`: all model-facing tool names.\n- `OPENCLAW_DEBUG_MODEL_PAYLOAD=full-redacted`: capped, redacted JSON payload.\n  Use only while debugging; prompts/message text may still appear.\n- `OPENCLAW_DEBUG_SSE=events`: first-event and stream-completion timing.\n- `OPENCLAW_DEBUG_SSE=peek`: first five redacted SSE events.\n- `OPENCLAW_DEBUG_CODE_MODE=1`: code-mode tool-surface diagnostics.\n\nWatch logs with:\n\n```bash\nopenclaw logs --follow\n```\n\n## Common Boundaries\n\n- **Config vs activation:** config can be enabled while the run disables tools,\n  is raw, has an empty allowlist, or lacks model tool support. Check the actual\n  visible tools before enforcing provider payload invariants.\n- **Tool surface:** inspect final model-visible tool names, not only the tool\n  registry or config. Code mode means exactly `exec` and `wait` only after it\n  actually activates.\n- **Provider payload:** log fields, model id, service tier, reasoning, input\n  size, metadata keys, prompt-cache key presence, and tool names before SDK\n  call.\n- **Fetch vs SSE:** fetch response proves HTTP headers arrived; first SSE event\n  proves provider body progress. A gap here is a stream/body/provider issue, not\n  tool execution.\n- **Worker/dist:** run `pnpm build` when touching workers, dynamic imports,\n  package exports, lazy runtime boundaries, or published paths.\n- **Live keys:** use the configured secret workflow for missing provider keys\n  before saying live proof is blocked. Env checks are presence-only; never print\n  secrets.\n\n## Code Pointers\n\n- Model payload + Responses stream:\n  `src/agents/openai-transport-stream.ts`\n- Guarded fetch/timing:\n  `src/agents/provider-transport-fetch.ts`\n- OpenAI/Codex provider wrappers:\n  `src/agents/pi-embedded-runner/openai-stream-wrappers.ts`\n- Tool construction, Tool Search, code-mode activation:\n  `src/agents/pi-embedded-runner/run/attempt.ts`\n- Code-mode runtime and worker:\n  `src/agents/code-mode.ts`\n  `src/agents/code-mode.worker.ts`\n- Tool Search catalog:\n  `src/agents/tool-search.ts`\n\n## Proof Choice\n\n- Single helper/payload bug: local targeted Vitest.\n- Docs/logging-only: `pnpm check:docs` and `git diff --check`.\n- Worker/dist/lazy import/package surface: targeted tests plus `pnpm build`.\n- Live provider/model behavior: same provider/model with debug flags and a real\n  key if available.\n- Docker/package/Linux/CI-parity: `$crabbox`.\n- CI failure: exact SHA, relevant job only, logs only after failure/completion.\n\n## Output Habit\n\nReport:\n\n- boundary tested\n- exact command/env shape, redacted\n- observed signal, such as tool names or first SSE event timing\n- fix location\n- narrow proof and any remaining risk\n","agents/openai.yaml":"interface:\n  display_name: \"OpenClaw Debugging\"\n  short_description: \"Debug model, tool, stream, and live behavior\"\n  default_prompt: \"Use $openclaw-debugging to identify the right OpenClaw debug boundary, turn on targeted logs, and choose the narrowest local or Crabbox proof.\"\n"},"import":{"commit_sha":"424c6d0a5f4665b803ad6768d08b0be7659deaf4","imported_at":"2026-05-18T20:13:36Z","license_text":"MIT License\n\nCopyright (c) 2025 Peter Steinberger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","owner":"openclaw","repo":"openclaw/openclaw","source_url":"https://github.com/openclaw/openclaw/tree/424c6d0a5f4665b803ad6768d08b0be7659deaf4/.agents/skills/openclaw-debugging"}},"content_hash":[174,5,211,95,237,79,73,209,253,150,74,207,18,153,116,229,224,228,131,40,228,228,215,38,236,243,8,153,79,22,202,231],"trust_level":"unsigned","yanked":false}
