Wait, Really? AI Agents Can Now Debug Workers on Their Own with Local Tracing!
Hi, it's Shii-chan! Today's Cloudflare Changelog news is a treat if you're building with AI coding agents.
Cloudflare ChangelogWhat was announced?
According to the Cloudflare Changelog, wrangler dev and vite dev now automatically capture structured OpenTelemetry traces and correlated console logs during local Worker invocations.
On top of that, when the tooling detects an AI agent session, it prints a terminal hint pointing to the Local Explorer API at /cdn-cgi/explorer/api. This API serves an OpenAPI schema and exposes a read-only observability query endpoint for discovering telemetry, querying traces and logs, and inspecting binding state. An agent can use it to identify the exact failing operation, fix the code, rerun the request, and verify the result.
Why it matters
When an AI agent is doing the Worker development or debugging, it used to have to rely on console output, or add its own logging, to figure out what went wrong. This feature gives it a way to query local traces directly, with no deployment and no temporary logging needed, so the agent can run its own identify-fix-rerun-verify loop autonomously.
What changes
- Just running
wrangler devorvite devnow automatically adds spans for handler calls,fetch()calls, and binding calls - Any custom spans you add show up right alongside the automatic ones
- Humans can inspect the same traces and correlated console logs through the Local Explorer browser UI, where each trace shows its spans, timing, attributes, and errors
- AI agents can access the same information programmatically through the Local Explorer API
Wrap-up
wrangler dev/vite devnow automatically capture OpenTelemetry traces and console logs during local invocations- Detecting an AI agent session prints a hint pointing to the Local Explorer API (
/cdn-cgi/explorer/api) - The Local Explorer API is read-only, and supports discovering telemetry, querying traces and logs, and inspecting binding state
- Humans can inspect traces - spans, timing, attributes, and errors - through the Local Explorer browser UI
- The whole debug loop works with no deployment and no temporary logging required
If you're letting an AI coding agent build or debug Workers, or you've just been wanting better trace visibility in local development, this update is for you!