Skip to content

fix(core): run each Output.mapEffect once per deploy - #3645

Open
sam-goodwin wants to merge 1 commit into
fix/cluster-bundle-racefrom
fix/output-mapeffect-memo
Open

sam-goodwin wants to merge 1 commit into
fix/cluster-bundle-racefrom
fix/output-mapeffect-memo

Conversation

@sam-goodwin

@sam-goodwin sam-goodwin commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Output.mapEffect now runs its effect once per deploy for each input, however many Outputs derive from it.

const bundled = pool.entities.pipe(Output.mapEffect(bundle));
yield* Docker.Image("Runner", {
  build: { context: bundled.pipe(Output.map((b) => b.dir)) },
  tag: bundled.pipe(Output.map((b) => b.hash)),
});
// before: bundle ran for each read, in the plan and again in apply (6 runs here), at the same time
// after: one run, shared by every read
  • The run is kept in the deploy's artifact store, so the next deploy (or alchemy dev reload) runs it again.
  • A changed input runs it again: apply re-resolves props after an upstream updates.
  • A failed run isn't kept.

The Effect Cluster pool's own bundle cache from #3621 is removed; this covers it.

Reported by @fern-pillar.

Fixes #3491

@sam-goodwin
sam-goodwin added this pull request to stack #3646 November 22, 2026 15:50
@alchemy-version-bot

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

pnpm install https://pkg.alchemy.run/alchemy/pr:3645:101c322
@alchemy.run (36)
pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/archil/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/boat/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/axiom/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/doppler/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/infisical/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/1password/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/turso/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/convex/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/e2b/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/daytona/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/modal/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/prisma/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/hetzner/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/digitalocean/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/railway/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/fly/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/github/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/stripe/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/gcp/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:3645:101c322
Transitive Dependencies (30)
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/archil/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/boat-dev/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/turso/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/convex/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/e2b/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/daytona/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/modal/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/s3/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/digitalocean/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/effect-cluster/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@alchemy.run/rivet/pr:3645:101c322
pnpm install https://pkg.alchemy.run/@distilled.cloud/rivet/pr:3645:101c322

Published Nov 22, 2026, 3:52 PM UTC. Expires Nov 29, 2026, 3:52 PM UTC, extended while this pull request is open.

@sam-goodwin
sam-goodwin marked this pull request as ready for review November 22, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output.mapEffect runs its effect once for each derived Output, and the plan runs them at the same time (breaks the SwarmPool runner build)

1 participant