Skip to content

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

Closed
matingathani wants to merge 4 commits into
cloudflare:mainfrom
matingathani:fix/skills-banner-stderr
Closed

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

Conversation

@matingathani

@matingathani matingathani commented May 29, 2026

Copy link
Copy Markdown
Contributor

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

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 26e93d2

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

This PR includes changesets to release 4 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/wrangler-bundler 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

pkg-pr-new Bot commented May 29, 2026

Copy link
Copy Markdown
create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

@cloudflare/wrangler-bundler

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/wrangler-bundler@14097

commit: 26e93d2

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

The general preference is that when we are in JSON output mode we do not render any such logs, rather than sending them to stderr.

@github-project-automation github-project-automation Bot moved this from Untriaged to In Review in workers-sdk Jun 1, 2026

@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 potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@dario-piotrowicz

Copy link
Copy Markdown
Member

The log has entirely been removed in #14162 so this PR is no longer applicable, sorry @matingathani 😓

@github-project-automation github-project-automation Bot moved this from In Review to Done in workers-sdk Jun 3, 2026
@matingathani

Copy link
Copy Markdown
Contributor Author

Thanks @dario-piotrowicz — makes sense to close since #14162 removes the log entirely. Closing.

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.

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

4 participants