Skip to content

fix: pass --env flag to auxiliary workers in multi-worker mode#12604

Merged
petebacondarwin merged 1 commit intomainfrom
devin/1771451177-fix-multiworker-env
Feb 19, 2026
Merged

fix: pass --env flag to auxiliary workers in multi-worker mode#12604
petebacondarwin merged 1 commit intomainfrom
devin/1771451177-fix-multiworker-env

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Feb 18, 2026

Fixes #12212.

When running wrangler dev with multiple config files (e.g. -c ./apps/api/wrangler.jsonc -c ./apps/queues/wrangler.jsonc -e=dev), the --env flag was not being forwarded to auxiliary (non-primary) workers. Only disableDevRegistry and multiworkerPrimary were passed, so auxiliary workers used the default environment instead of the one specified by --env. This caused environment-specific bindings (like queue consumers) to not be triggered in local dev.

The fix adds env: args.env to the options passed to setupDevEnv for auxiliary workers, matching the behavior already in place for the primary worker (which receives the full args object).

Note for reviewers: It may be worth checking whether other args beyond env should also be forwarded to auxiliary workers — the current auxiliary setup only passes env, disableDevRegistry, and multiworkerPrimary.


  • Tests
    • Tests included/updated
  • Public documentation
    • Documentation not necessary because: this is a bug fix for existing functionality
  • Wrangler V3 Backport
    • Not necessary because: multi-worker mode is not in Wrangler V3

Devin PR requested by @petebacondarwin

Link to Devin run


Open with Devin

Co-Authored-By: pbacondarwin@cloudflare.com <pete@bacondarwin.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 18, 2026

🦋 Changeset detected

Latest commit: 9211423

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

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

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 18, 2026

Claude finished @petebacondarwin's task —— View job


Changeset Review

All changesets look good

The changeset .changeset/fix-multiworker-env-flag.md passes all validation criteria:

  • Correct version type (patch for bug fix)
  • Clear, meaningful description with usage example
  • No problematic markdown headers
  • Follows the repository's changeset format guidelines

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 18, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 9211423

@petebacondarwin petebacondarwin marked this pull request as ready for review February 19, 2026 10:03
@petebacondarwin petebacondarwin requested a review from a team as a code owner February 19, 2026 10:03
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

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 1 additional finding.

Open in Devin Review

Copy link
Copy Markdown
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🙂

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Feb 19, 2026
@petebacondarwin petebacondarwin merged commit e2a6600 into main Feb 19, 2026
38 of 40 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Feb 19, 2026
@petebacondarwin petebacondarwin deleted the devin/1771451177-fix-multiworker-env branch February 19, 2026 10:21
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.

Running separate process local queue producer and consumer doesn't work with -c -c pattern using wrangler environments

3 participants