Skip to content

Dev: run multiple workers together locally #1531

@AutumnsGrove

Description

@AutumnsGrove

Summary

Set up multi-worker local development using Wrangler's multi-config wrangler dev -c feature (GA September 2025). This allows all Grove workers to run in a single Miniflare instance with service bindings and DO RPC working between them.

Why

Currently, service bindings (AUTH, LUMEN, ZEPHYR, REVERIE) are dead in vite dev — they can't resolve other workers. This makes it impossible to test cross-service flows locally (login, AI, email). Multi-config dev mode resolves this by running all workers in one Miniflare instance.

Implementation

Core dev command

# Run aspen + heartwood + durable-objects together
wrangler dev \
  -c apps/aspen/wrangler.toml \
  -c services/heartwood/wrangler.toml \
  -c workers/grove-durable-objects/wrangler.toml

First config = primary (receives HTTP). Others accessible via service bindings.

What this unlocks

  • Full login flow (Aspen → Heartwood → back)
  • DO RPC from SvelteKit routes to Loom DOs
  • Reverie → Lumen service binding chain
  • Rate limiting via ThresholdDO

Tradeoffs

  • Loses Vite HMR (runs in workerd, not Node.js)
  • Requires building SvelteKit first (pnpm build then wrangler dev)
  • Some bindings (Workers AI) need remote: true

What to build

  • Create scripts/dev-multi.sh that orchestrates multi-config wrangler dev
  • Add root script: pnpm dev:full (builds + runs multi-config)
  • Add [dev] overrides for production-only vars (AUTH_BASE_URL → localhost, etc.)
  • Document which bindings need remote: true (Workers AI, Vectorize)
  • Test: login flow works end-to-end locally
  • Test: DO RPC from Aspen routes to PostMetaDO
  • Test: Reverie → Lumen service binding chain

Key Limitation

getPlatformProxy() (used by SvelteKit's adapter-cloudflare in vite dev) does NOT support multi-config yet (workers-sdk issue #9445). Until that ships, multi-config dev requires wrangler dev mode (no HMR). See Tier 3 issue for the hybrid workaround.

Context

  • Wrangler multi-config changelog: September 2025
  • Port assignments already added (Tier 1): aspen=5173, landing=5174, plant=5175, meadow=5176, heartwood=8787
  • .dev.vars.example files already created (Tier 1)
  • Related: #9445 (workers-sdk) — multi-config getPlatformProxy

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestheartwoodAuthentication and identity (sessions, passkeys)latticeFramework, monorepo, and shared infrastructurelumenAI assistant and intelligence layerpattern:loomDurable Objects coordination layer

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions