Skip to content

[wrangler] Add one-time --force notice and drop skipped telemetry in Pages delegation#14601

Merged
MattieTK merged 2 commits into
mainfrom
pages-delegation-force-notice
Jul 10, 2026
Merged

[wrangler] Add one-time --force notice and drop skipped telemetry in Pages delegation#14601
MattieTK merged 2 commits into
mainfrom
pages-delegation-force-notice

Conversation

@MattieTK

@MattieTK MattieTK commented Jul 8, 2026

Copy link
Copy Markdown
Member

Follow-up refinements to the Pages-to-Workers delegation shipped in #14312, based on early telemetry.

Two changes:

  1. One-time --force guidance for agents. When an agent opts out of the delegation by passing --force to wrangler pages deploy or wrangler pages project create, Wrangler now prints an end-of-command notice (only on success) telling the agent that --force only needs to be passed once — the project now exists, so subsequent commands are no longer eligible for delegation and run against Pages directly without --force. This addresses agents repeatedly appending --force after learning about it from the delegation failure message.

  2. Stop emitting the skipped telemetry event. Skips are deterministic, expected non-cases (the account already has Pages projects, the project uses an unsupported Pages feature, Pages-only args are present, etc.), so the event carries no signal and dominated event volume. The count of skipped commands is derivable from the Pages command's own telemetry, so a dedicated event is not needed. Local logger.debug output is retained for developer visibility.


  • 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 affects the agent-facing behaviour of the hidden --force opt-out and internal telemetry for an experimental feature; there is no user-facing documentation to update.

Open in Devin Review

@MattieTK
MattieTK requested a review from workers-devprod as a code owner July 8, 2026 12:09
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a23f809

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 8, 2026
@workers-devprod
workers-devprod requested review from a team and james-elicx and removed request for a team July 8, 2026 12:09
@workers-devprod

workers-devprod commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@ask-bonk

ask-bonk Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Everything looks correct and well-tested. Let me do a final check on the deploy.ts --force path: is there a scenario where pages deploy --force runs but the deploy could reach the notice line even if the actual deploy failed? The notice line is at 643, after metrics.sendMetricsEvent("create pages deployment") (639), which is at the end of the success path. Failures throw earlier. Good.

Let me also confirm that for pages deploy, when --force is not set and delegation is skipped for a non-agent, forcedOptOut is undefined (falsy) — correct, so no notice.

One last consideration: the notice message is printed via logger.log to stdout unconditionally on the agent success path. But could there be JSON/machine output modes for pages deploy where adding text to stdout breaks parsing? Let me check if there's an output-file mechanism vs stdout — the deploy uses writeOutput (separate from stdout) and logger.log for human messages already (e.g. "✨ Deployment complete!"). So adding another logger.log is consistent with existing behavior.

The changes are logically sound, well-tested, and consistent with the codebase conventions. The telemetry removal is intentional and tests are updated accordingly. The forcedOptOut flag is correctly gated behind agent detection and only fires on success paths.

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

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

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: e7f9936

devin-ai-integration[bot]

This comment was marked as resolved.

@MattieTK
MattieTK force-pushed the pages-delegation-force-notice branch from a4957f0 to a23f809 Compare July 9, 2026 15:58
MattieTK and others added 2 commits July 9, 2026 17:57
…Pages delegation

When an agent opts out of the Pages-to-Workers delegation with `--force`,
Wrangler now prints an end-of-command notice (on success) explaining that
`--force` only needs to be passed once, since the project then exists and
subsequent commands are no longer delegated.

Also stop emitting the `skipped` telemetry event: those are deterministic,
expected non-cases (e.g. the account already has Pages projects) that carry
no signal, and the count is derivable from the Pages command's own telemetry.
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@MattieTK
MattieTK force-pushed the pages-delegation-force-notice branch from a23f809 to e7f9936 Compare July 9, 2026 16:57

@penalosa penalosa 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.

Are we recording --force in the telemetry?

@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 9, 2026
@MattieTK

Copy link
Copy Markdown
Member Author

Are we recording --force in the telemetry?

yes

@MattieTK
MattieTK merged commit 3015320 into main Jul 10, 2026
67 of 69 checks passed
@MattieTK
MattieTK deleted the pages-delegation-force-notice branch July 10, 2026 12:56
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jul 10, 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.

3 participants