Skip to content

[wrangler] fix: write skills banner to stderr in non-interactive shells#14097

Open
matingathani wants to merge 3 commits into
cloudflare:mainfrom
matingathani:fix/skills-banner-stderr
Open

[wrangler] fix: write skills banner to stderr in non-interactive shells#14097
matingathani wants to merge 3 commits into
cloudflare:mainfrom
matingathani:fix/skills-banner-stderr

Conversation

@matingathani
Copy link
Copy Markdown
Contributor

@matingathani matingathani commented May 29, 2026

Fixes #14036.

maybeInstallCloudflareSkillsGlobally used logger.log (stdout) for the non-interactive informational banner. When users pipe wrangler output (e.g. wrangler deploy --json | jq), the banner prefixes the JSON and causes jq to fail:

$ wrangler secret list --name my-worker --format json | jq '.'
jq: parse error: Invalid numeric literal at line 1, column 11

The root cause: the non-interactive branch (!isInteractive() && !ci.isCI) is exactly the shape of a scripted invocation from an operator shell. The banner is informational — it belongs on stderr like every other non-data message.

Fix: logger.loglogger.warn in the non-interactive branch of maybeInstallCloudflareSkillsGlobally. logger.warn routes to console.warn (stderr), leaving stdout clean for JSON consumers. The interactive install path (line ~133) keeps logger.log since that targets a TTY user.


  • Tests
    • Tests included/updated
  • Public documentation
    • Documentation not necessary because: this is a bug fix with no new user-facing API surface.

Open in Devin Review

The non-interactive branch of maybeInstallCloudflareSkillsGlobally used
logger.log (stdout) to print the Cloudflare agent skills banner. This
contaminated the output of commands like `wrangler deploy --json | jq`,
causing jq to fail with a parse error because the banner prefixed the JSON.

Changed to logger.warn so the banner goes to stderr, leaving stdout clean
for structured output consumers.

Fixes cloudflare#14036.
Copilot AI review requested due to automatic review settings May 29, 2026 05:14
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 4e4bcc0

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 May 29, 2026
@workers-devprod workers-devprod requested review from a team and ascorbic and removed request for a team May 29, 2026 05:14
@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/skills-banner-stderr.md: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/agents-skills-install.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/agents-skills-install.ts: [@cloudflare/wrangler]

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 29, 2026

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 4e4bcc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

maybeInstallCloudflareSkillsGlobally writes banner to stdout in non-interactive non-CI shells, breaking JSON output

2 participants