Skip to content

[wrangler] Add observability query endpoint to agent-facing Local Explorer hint - #14871

Merged
NuroDev merged 7 commits into
cloudflare:mainfrom
nickpatt:local-explorer-agent-hint-observability
Jul 28, 2026
Merged

[wrangler] Add observability query endpoint to agent-facing Local Explorer hint#14871
NuroDev merged 7 commits into
cloudflare:mainfrom
nickpatt:local-explorer-agent-hint-observability

Conversation

@nickpatt

@nickpatt nickpatt commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds the local observability query endpoint to the agent-facing Local Explorer hint that wrangler dev prints for AI-agent sessions.

The hint introduced in #14688 lists every Local Explorer route (D1, KV, R2, Durable Objects, Workflows, local workers) except the local observability SQL endpoint added in #14633. That endpoint is the one an agent needs to inspect what actually happened during an invocation — request traces and console.* logs — so leaving it out means an agent following the hint can discover every binding except the trace/log store.

This adds:

POST {api}/local/observability/query - query captured request traces and console logs (read-only SQL over the spans and logs tables)

to the printed hint (where {api} = http://localhost:8787/cdn-cgi/explorer/api), and names the two backing tables (spans, logs) so an agent can write a correct query without first fetching the full ~23k-token OpenAPI document. No behavior change beyond the printed text; the hint still only prints on the existing agent/non-interactive opt-in path.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this only changes an agent-facing terminal hint; the endpoint itself is already documented via the Local Explorer OpenAPI schema.

Note

This is a contribution from an AI agent: opencode (claude-opus-4).


Open in Devin Review

…lorer hint

The hint wrangler dev prints for AI-agent sessions listed every Local
Explorer route except the local observability SQL endpoint. Add
POST /cdn-cgi/explorer/api/local/observability/query so agents can
discover the read-only trace/log query endpoint (spans and logs tables)
alongside the existing binding and storage routes.
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6b768d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Jul 27, 2026
@workers-devprod
workers-devprod requested review from a team and emily-shen and removed request for a team July 27, 2026 09:07
@workers-devprod

workers-devprod commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14871

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14871

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14871

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14871

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14871

miniflare

npm i https://pkg.pr.new/miniflare@14871

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14871

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14871

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14871

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14871

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14871

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14871

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14871

wrangler

npm i https://pkg.pr.new/wrangler@14871

commit: 6b768d8

Comment thread packages/wrangler/src/dev/start-dev.ts Outdated

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jul 28, 2026
Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@NuroDev
NuroDev self-requested a review July 28, 2026 20:03
@NuroDev
NuroDev enabled auto-merge (squash) July 28, 2026 20:07
@NuroDev
NuroDev merged commit 1394867 into cloudflare:main Jul 28, 2026
64 of 65 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants