[vite-plugin] Surface Local Explorer API to headless agents, matching wrangler's hint - #14996
Open
nickpatt wants to merge 4 commits into
Open
[vite-plugin] Surface Local Explorer API to headless agents, matching wrangler's hint#14996nickpatt wants to merge 4 commits into
nickpatt wants to merge 4 commits into
Conversation
Aligns the hint with the one `wrangler dev` already prints: adds the observability query route (with a runnable example), keeps the OpenAPI schema last behind a last-resort note so agents reach for the specific routes first, and uses wrangler's route ordering. Also updates the explorer path in the test, which moved to /cdn-cgi/local/explorer.
🦋 Changeset detectedLatest commit: a603a10 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
workers-devprod
requested review from
a team and
edmundhung
and removed request for
a team
August 3, 2026 15:30
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
5 tasks
The wrapper used the library's isAgent(), which reports `hybrid` environments as agents — so a human in Warp or VS Code would have been treated as a headless agent, contradicting the wrapper's own doc comment. Check the detected type is exactly `agent`, as wrangler's wrapper does, and pass an empty processAncestry so process-tree traversal stays off regardless of the library's default.
dario-piotrowicz
approved these changes
Aug 3, 2026
workers-devprod
approved these changes
Aug 3, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surfaces the Local Explorer API to headless agents from the Vite plugin, the same way
wrangler devalready does.This is #14912 (thanks @Dario) with the hint text aligned to the one wrangler prints today - the implementation is unchanged, only the message differs.
When a Vite dev or preview server with the Cloudflare plugin is started in a headless AI agent environment, the plugin now prints the Local Explorer API URL and useful resource routes to stdout so agents can discover and call them programmatically.
Also fixes the explorer path in the test: it was
/cdn-cgi/explorer, but the route has since moved to/cdn-cgi/local/exploreronmain, so the assertion no longer held.Verified against a real
vite devsession - the hint prints as above, and both thecurlexample and the KV route return data unmodified from the hint.