Skip to content

[wrangler] Hide unusable dev hotkeys under Turborepo - #13742

Merged
edmundhung merged 5 commits into
mainfrom
edmundhung/fix-turborepo-hotkeys
Oct 15, 2026
Merged

edmundhung merged 5 commits into
mainfrom
edmundhung/fix-turborepo-hotkeys

Conversation

@edmundhung

@edmundhung edmundhung commented Apr 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #7814.

Hide the wrangler dev hotkey bar when running under Turborepo's stream output, where the task can have a pseudo-TTY even though keyboard input is not forwarded. Keep the existing hotkeys available when TURBO_IS_TUI=true, since Turborepo's terminal UI supports interactive input.

Rebased onto current main and adapted the guard to the shared Workers/Pages dev startup path. Reuse the same guard when deciding whether to print the existing Local Explorer API hint for agent sessions, so Turbo stream mode does not suppress both the hotkeys and the hint. The change does not alter Turborepo or dev-server behavior.

Validation:

  • Unit coverage for Turbo environment detection, agent hints, and existing dev/hotkey behavior: 164 tests passed with inherited Turbo CI variables.
  • PTY coverage for Workers and Pages, stream output, and existing single-/multiworker exit behavior: 14 tests passed.
  • Wrangler type checks, focused lint/format checks, and relevant builds passed.
  • Real Turborepo stream/TUI probes confirmed the input-forwarding distinction. Built Wrangler prints the agent hint without hotkeys in stream mode and preserves working hotkeys without the headless hint in TUI mode.

  • 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 fixes the display of unusable hotkeys without changing the public API.

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c5cc48e

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-plugin 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

@ask-bonk

ask-bonk Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

I've now thoroughly reviewed the PR. The changes are clean, well-structured, and correct:

  1. is-turborepo.ts: Simple, well-designed detection function with injectable env parameter for testability. Checks the three standard Turborepo environment variables (TURBO_HASH, TURBO_TASK, TURBO_INVOCATION_DIR).

  2. start-dev.ts: Correctly extracts the condition into shouldRenderInteractiveDevSession and adds the !isTurborepo() check. Both the multi-worker and single-worker branches are updated consistently. The authHook re-registration path at line 50 correctly relies on hotkeysDisplayed (which will be false since hotkeys were never registered in the first place), so it's also safe.

  3. Unit tests: Properly use ({ expect }) from test context, pass explicit env objects rather than mutating process.env.

  4. Integration tests: Properly strip TURBO env vars from the default PTY environment (so existing hotkey tests aren't broken when the monorepo's own Turbo runner sets these vars), and add a dedicated test that sets TURBO_HASH and verifies hotkeys are hidden.

  5. Changeset: Correct format, patch level is appropriate for a bugfix.

No logic bugs, no security issues, no backward compatibility problems. The approach is pragmatic and minimal.

LGTM

github run

@github-actions

github-actions Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

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

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@13742

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@13742

@cloudflare/config

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

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@13742

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@13742

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@13742

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@13742

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: b7a11a8

Turborepo's stream output uses a pseudo-TTY without forwarding input, while its terminal UI can forward working hotkeys. Hide the dev hotkey bar only for stream output.
@edmundhung
edmundhung force-pushed the edmundhung/fix-turborepo-hotkeys branch from 959d23c to c8d9fda Compare October 14, 2026 09:58
@edmundhung edmundhung changed the title fix(wrangler): hide dev hotkey bar under turborepo [wrangler] Hide unusable dev hotkeys under Turborepo Oct 14, 2026
@edmundhung
edmundhung marked this pull request as ready for review October 14, 2026 10:26
@workers-devprod
workers-devprod requested review from a team and petebacondarwin and removed request for a team October 14, 2026 10:26
@workers-devprod

workers-devprod commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@edmundhung
edmundhung force-pushed the edmundhung/fix-turborepo-hotkeys branch 2 times, most recently from a6839d9 to af2400d Compare October 14, 2026 11:00
@edmundhung
edmundhung force-pushed the edmundhung/fix-turborepo-hotkeys branch from af2400d to c5cc48e Compare October 14, 2026 11:17
devin-ai-integration[bot]

This comment was marked as resolved.

@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

@edmundhung
edmundhung enabled auto-merge (squash) October 15, 2026 15:08
@edmundhung
edmundhung merged commit 4a5377f into main Oct 15, 2026
87 checks passed
@edmundhung
edmundhung deleted the edmundhung/fix-turborepo-hotkeys branch October 15, 2026 15:26
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Oct 15, 2026
brandhaug added a commit to brandhaug/b2b-saas-starter that referenced this pull request Oct 19, 2026
## pnpm-workspace.yaml (default)

## Dependency Updates

| Package | From | To | Type |
| --- | --- | --- | --- |
| `wrangler` | 4.151.0 | 4.151.1 | patch |

## Release Notes

<details>
<summary><b>wrangler</b> (4.151.0 → 4.151.1)</summary>

### Patch Changes

- [#15541](cloudflare/workers-sdk#15541)
[`e13d5cc`](cloudflare/workers-sdk@e13d5cc)
Thanks [@<!---->mack-erel](https://github.com/mack-erel)! - Keep remote
dev sessions alive through transient network failures

`wrangler dev --remote` and `getPlatformProxy()` refresh their preview
token before it expires, but a single failed refresh — for example while
the network was briefly down — stopped refreshing for good, leaving the
session broken until restart. A failed refresh now retries every minute
until it succeeds. Rebuilds also no longer push the refresh past the
session's expiry.

- [#16284](cloudflare/workers-sdk#16284)
[`42c6912`](cloudflare/workers-sdk@42c6912)
Thanks [@<!---->karloper](https://github.com/karloper)! - Fix `wrangler
rollback` reporting success after the changed secrets confirmation is
declined

Previously, declining the "The following secrets have changed…"
confirmation printed "Aborting rollback..." and then also printed a
success message and the target version as the "Current Version ID", even
though no deployment was made and the original version was still live.
Wrangler now stops after aborting, so the output matches what is
actually deployed.

- [#13742](cloudflare/workers-sdk#13742)
[`4a5377f`](cloudflare/workers-sdk@4a5377f)
Thanks [@<!---->edmundhung](https://github.com/edmundhung)! - Hide the
`wrangler dev` hotkey bar when Turborepo does not forward input

- Updated dependencies
[[`e1d1b77`](cloudflare/workers-sdk@e1d1b77)]:
  - [email protected]

</details>

---
*This PR was auto-generated by
[catalog-update-action](https://github.com/brandhaug/catalog-update-action).*

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

🐛 BUG: hotkey bar renders when used with turborepo

3 participants