Shell Tool · engineering · Sentinel

Debug a CF Worker

Tail logs, decode CF exception codes (1101 uncaught, 1102 CPU), trace which boundary is failing.

Updated today
View as MarkdownsentinelsonnetstandardMax 15 turns

Overview

Implements debug-cf-worker/SKILL.md. Tails the live Worker logs via wrangler tail, captures the exception, decodes the error code, identifies which boundary is at fault (Worker code, DO RPC, container fetch, fetch upstream). When the failure spans multiple layers, layers in instrument-then-fix/SKILL.md: insert raw passthrough diagnostics at each boundary to pinpoint the broken layer before patching.

When to use this

  • user reports a Worker returning 500
  • user says 'CF exception 1101' or 'error code 1102'
  • Worker works locally but fails when deployed
  • DO RPC failing or container fetch returning HTML error page

When NOT to use this

  • Worker hasn't been deployed yet → use deploy-to-cloudflare and verify-deploy first
  • user wants to debug a non-Worker process (Next.js dev server, etc.) → use shell_exec + iterate-until-green

Example prompts

this Worker is returning 500 — debug it
Worker exception 1101 in production
the DO is throwing 'Cannot read property of undefined' under load

Inputs and output

Inputs

FieldDescription
worker_namewrangler.toml `name` field
error_signalURL that triggers it, or exception code

Output

Root-cause analysis + the patch applied + post-fix verify result.

Runtime profile

What the engine commits when this skill runs.

PropertyValueMeaning
Model tiersonnetThe balanced default model class. Trades quality against cost for the vast majority of skill runs.
Cost classstandardThe balanced default model. Right for most skills.
Turn budget15Hard cap on tool-calling iterations before the engine forces a final answer.
ExecutionsynchronousRuns inside the live turn; result lands in the same response.

Under the hood

Tools the engine exposes to this skill and integrations it needs.

ResourceKind
shell_exectool
shell_readtool

Tags: engineering, debug, cloudflare

Execution template

Shell tools dispatch via a command template. The model substitutes user inputs into the placeholders before firing the underlying tool.

shell_execbash
1wrangler tail {{worker_name}} & repro {{error_signal}}; follow debug-cf-worker/SKILL.md; instrument-then-fix if multi-layer

Invoking this from an agent

Three paths reach this skill. From the chat UI, a user can type the persona slash command followed by a natural request and the discovery step resolves to this skill automatically. From the MCP server, fetch the skill detail with get_skill({id: "debug-cf-worker"}) and then invoke it through the agent runtime once the authenticated tier ships. From your own code, hit /docs/skills/debug-cf-worker/llm.txt for the token-efficient markdown body and feed it to your model directly.

Note
Every skill page has a canonical permalink and a markdown alternate that LLM crawlers consume via Accept: text/markdown. The full machine-readable catalog lives at /.well-known/agent-skills/index.json.