一键导入
observability-debugger
Debug Cradle local observability data by querying SQLite events/incidents/timeline, runtime snapshots, metrics, and server logs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug Cradle local observability data by querying SQLite events/incidents/timeline, runtime snapshots, metrics, and server logs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Update Cradle chat-runtime native SDK and protocol integrations. Use when upgrading or validating the vendored Codex app-server runtime/protocol, Kimi Web OpenAPI/AsyncAPI snapshots and generated bindings, or @anthropic-ai/claude-agent-sdk in apps/server; also use when asked to inspect newly generated native APIs for useful Cradle features.
Implement, upgrade, or audit a native Cradle Chat Runtime provider backed by a local process, REST/WebSocket protocol, or provider-specific agent SDK. Use when adding a runtime like Kimi, Codex, Claude Agent, OpenCode, or another provider that needs generated protocol bindings, target-scoped process lifecycle, canonical tool mapping, runtime UI slots, interaction bridges, streaming recovery, and end-to-end smoke verification.
Always use this Skill at the beginning of every response. Use whenever you need to read, inspect, wait on, or mutate Cradle-owned state or workflows, including issues, delegation, sessions, awaits, CI/review waits, timed waits, Work inspection, workspaces and git inspection, Chronicle, automations, usage, observability, skills, agents, profiles, providers, preferences, plugins, or server state. Prefer the generated `cradle` CLI and `cradle man`; NEVER bypass Cradle semantics with direct HTTP or database access, ad hoc scripts, raw registry edits, or polling loops. Use `gh` when Cradle does not own the GitHub surface. Primary Work closed-loop delivery is system-injected on Work threads (`manage_pull_request`), not this skill.
Trigger the public desktop release workflow and monitor it with Cradle
design and review llm agent systems, tool interfaces, and skill boundaries. use when chatgpt needs to decide whether a task should be handled by a prompt, workflow, skill, tool, single-agent loop, or multi-agent system; define tool schemas, instructions, guardrails, evaluation plans, or permission boundaries; or critique an existing agent design for over-orchestration, weak context handling, missing verification, or poor tool design.
Control Cradle's in-app browser via MCP tools. Use when the Claude Agent needs to navigate websites, click elements, type text, take screenshots, read page content, or inspect DOM structure within the Cradle desktop app's embedded browser panel. Triggers on "open URL", "navigate to", "click the button", "fill the form", "take a screenshot", "what's on the page", "scroll down", "wait for element", "press Enter". This is for the IN-APP browser only — not for external browser automation.
| name | observability-debugger |
| description | Debug Cradle local observability data by querying SQLite events/incidents/timeline, runtime snapshots, metrics, and server logs. |
Use this skill when a chat turn behaves unexpectedly and you need concrete local evidence.
observability_events — structured error/warn/info eventsobservability_incidents — deduplicated grouped events; TURN_STREAM_FAILED aggregates by code unless a producer supplies a narrower dedupe keybackend_run_snapshots — Cradle-owned runtime-neutral run envelope with millisecond lifecycle timestampsbackend_run_snapshot_events — ordered snapshot event stream for stable harness phases such as model text/reasoning boundaries, tool input/output availability, usage, and finalizationGET /observability/runtime-snapshot — live server/runtime resource view that includes server process health, active chat runs, replay buffers, provider runtime hosts, PTY resources, Chronicle daemon resources, latest desktop samples, renderer/browser drill-downs, and observability queue health{CRADLE_DATA_DIR}/server.log (or $CRADLE_LOG_FILE)Observability and run snapshot rows are forensic records. Session/run/message foreign keys may be NULL after source rows are deleted; do not treat a null FK as malformed data. Snapshot retention is controlled by CRADLE_CHAT_RUN_SNAPSHOT_RETENTION_DAYS (default 30, 0 disables pruning).
Keep these snapshot types separate:
backend_run_snapshots, backend_run_snapshot_events) answer "what happened during this chat run?"/observability/runtime-snapshot) answer "what resources and live runtime state exist right now?"The script tries in order:
--db <path>$CRADLE_DB_PATH$CRADLE_DATA_DIR/cradle.db~/Library/Application Support/Cradle/cradle.db (macOS)~/.config/Cradle/cradle.db (Linux)The logs command tries:
--log <path>$CRADLE_LOG_FILE$CRADLE_DATA_DIR/server.log<db-dir>/server.log (sibling of the resolved cradle.db)Use:
python3 resources/skills/observability-debugger/scripts/obs_debug.py --help
Use the generated Cradle CLI first when the server is running; it exercises the same HTTP API used by agents and preserves server-side redaction/export behavior:
pnpm --filter @cradle/cli cradle observability --help
pnpm --filter @cradle/cli cradle chat snapshot --help
Use the SQLite script when the server is down, the HTTP API is suspect, or you need to inspect local DB state without starting Cradle.
python3 resources/skills/observability-debugger/scripts/obs_debug.py summary --since-min 120
Prints counts by code/severity and top open incidents. There is no generated CLI equivalent for this aggregate summary.
pnpm --filter @cradle/cli cradle observability events --code CHAT_EMPTY_OUTPUT_COMPLETION --limit 50
pnpm --filter @cradle/cli cradle observability events --chat-session-id <id> --limit 200
python3 resources/skills/observability-debugger/scripts/obs_debug.py events --code CHAT_EMPTY_OUTPUT_COMPLETION --limit 50
python3 resources/skills/observability-debugger/scripts/obs_debug.py events --chat-session-id <id> --limit 200
pnpm --filter @cradle/cli cradle observability incidents --status open --limit 50
pnpm --filter @cradle/cli cradle observability incidents --code TURN_STREAM_FAILED --limit 200
python3 resources/skills/observability-debugger/scripts/obs_debug.py incidents --status open --limit 50
python3 resources/skills/observability-debugger/scripts/obs_debug.py incidents --chat-session-id <id> --limit 200
pnpm --filter @cradle/cli cradle observability error-patterns --limit 50
pnpm --filter @cradle/cli cradle observability error-patterns --run-id <runId>
pnpm --filter @cradle/cli cradle chat snapshot run <runId>
pnpm --filter @cradle/cli cradle chat snapshot session <sessionId>
python3 resources/skills/observability-debugger/scripts/obs_debug.py timeline --run-id <runId> --limit 500
python3 resources/skills/observability-debugger/scripts/obs_debug.py timeline --chat-session-id <id> --since-min 240
Timeline output is an array of backend_run_snapshots; each item includes parsed summary_json plus ordered events from backend_run_snapshot_events. Snapshot/event timestamps are milliseconds.
pnpm --filter @cradle/cli cradle observability runtime-snapshot --json
pnpm --filter @cradle/cli cradle observability runtime-snapshot --json server,chatRuntime,providerRuntime,pty,observability
Use this when debugging leaks, stuck runs, replay buffer growth, lingering provider hosts, PTY descendants, Chronicle daemon resources, desktop renderer memory, or observability queue backpressure.
Important fields:
server.memory, server.cpu, server.node — process RSS/heap, CPU window, active handles, and active requestschatRuntime.activeRuns — live run IDs, sessions, provider target kind/id, and model IDchatRuntime.replayBuffers — buffered chunk and delta counts per active runproviderRuntime.hosts — runtime host ref counts, pin counts, resource ownership, and expirypty — terminal resources, process descendants, RSS, and CPU by rolechronicle — Chronicle daemon resource statedesktop.latestSamples — raw Electron main/app metrics, windows, BrowserPanel diagnostics, and renderer diagnostics reported by desktop maindrilldowns.renderer — top renderer windows, top chat sessions by estimated retained chars, and active streaming messages; use after Grafana shows renderer heap or chat payload pressuredrilldowns.browserPanel — BrowserPanel owner/thread/tab/runtime to WebContents/process mappings; use when Tab working set grows without matching renderer JS heap growthdrilldowns.replay.topRuns — active runs with the largest replay buffers, joined back to session/message/provider/model IDsdrilldowns.providerRuntime.topHosts — provider hosts sorted by ref/pin/resource/idle pressure, with expiry and idle timingobservability — event queue depth/drop/persistence healthThis command is server-backed only; it has no SQLite fallback because it reports live process state.
Runtime snapshot drill-down sequence for memory and retention issues:
drilldowns.renderer.topChatSessions is large and aligns with renderer heap growth, inspect that session's durable snapshots/messages.drilldowns.renderer.rendererWindows shows high Tab/renderer identity but chat sessions are small, inspect drilldowns.browserPanel.liveTabs and drilldowns.browserPanel.runtimes for retained WebContents/native BrowserPanel state.drilldowns.replay.topRuns and drilldowns.renderer.activeStreamingMessages before checking logs.drilldowns.providerRuntime.topHosts for ref count, pin count, expiry, and idle duration.Use metrics as secondary evidence after runtime-snapshot, not as the first source of truth. The useful debug question is whether the exported low-cardinality trend agrees with the live JSON snapshot and recent incidents/logs.
Debug sequence:
cradle observability runtime-snapshot --json and identify the suspect resource family: server memory/handles, active runs, replay buffers, provider hosts, PTY resources, Chronicle resources, desktop samples, renderer/browser drill-downs, or observability queue health.cradle_* series over the same time window.drilldowns.renderer.topChatSessions, drilldowns.browserPanel.liveTabs, active run IDs, replay top runs, provider host IDs, PTY descendants, queue depth, or logs.Do not spend time teaching telemetry setup from this skill. If metrics are unavailable, continue with runtime-snapshot, SQLite events/incidents/timeline, and logs.
python3 resources/skills/observability-debugger/scripts/obs_debug.py logs --tail --lines 50
python3 resources/skills/observability-debugger/scripts/obs_debug.py logs --filter "mapper" --lines 200
python3 resources/skills/observability-debugger/scripts/obs_debug.py logs --filter "error" --tail --lines 30
Logs are pino-structured JSON. Pipe through python3 -m json.tool to pretty-print individual lines.
pnpm --filter @cradle/cli cradle observability export \
--chat-session-id <chatSessionId> \
--since-unix <unixSeconds>
python3 resources/skills/observability-debugger/scripts/obs_debug.py bundle \
--chat-session-id <chatSessionId> \
--since-min 240 \
--out /tmp/cradle-obs-bundle.json
The bundle includes observability events, incidents, and run snapshot timelines with metadata.
cradle observability error-patterns --limit 50 or cradle observability incidents --status open.cradle observability events --code <CODE> --limit 50 to narrow to one session/run.cradle chat snapshot run <runId> or cradle chat snapshot session <sessionId> to inspect durable harness phases.cradle observability runtime-snapshot --json when the symptom looks live-resource related: memory growth, stuck active runs, retained replay buffers, provider host leaks, PTY process leaks, Chronicle daemons, desktop renderer pressure, BrowserPanel/WebContents retention, or observability queue backpressure.runtime-snapshot before blaming the resource owner.logs --filter "<chatSessionId>" --lines 100 when DB/API evidence is not enough.cradle observability export ... for API-faithful sharing; use the script bundle when the server is unavailable.chatSessionId or runId before broad scans, but remember old forensic rows may have null FKs.chatSessionId nor runId is known, run summary then events --code ... first.