Skip to content

fix(cloudflare/container): forward startup options through Cloudflare.start - #341

Merged
sam-goodwin merged 1 commit into
alchemy-run:mainfrom
yovanoc:fix/container-start-forward-options
May 16, 2026
Merged

sam-goodwin merged 1 commit into
alchemy-run:mainfrom
yovanoc:fix/container-start-forward-options

Conversation

@yovanoc

@yovanoc yovanoc commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Cloudflare.start currently calls container.start() with no arguments, silently dropping any ContainerStartupOptions the caller wants to apply on each start (e.g. enableInternet, entrypoint, envVars overrides).

This is a 10-line change that adds an optional second parameter to Cloudflare.start and forwards it to container.start.

Why

The underlying Container interface already accepts options:

start(options?: ContainerStartupOptions): Effect.Effect<void>;

And bindContainer in ContainerBinding.ts already wires the runtime side correctly:

start: (options?: ContainerStartupOptions) =>
  Effect.sync(() => state.container!.start(options)),

But the public-facing Cloudflare.start helper has no way to pass options through, so callers have no path to set per-instance startup overrides documented in the Cloudflare Containers API. The runtime is fully ready — only the call-site signature is missing.

Repro

const container = yield* Cloudflare.start(sandbox, { enableInternet: true });
//                                                  ^^^^^^^^^^^^^^^^^^^^^^^
// Today: ignored. After this PR: forwarded to container.start.

Diff

10 insertions, 3 deletions in StartContainer.ts only:

  • import ContainerStartupOptions alongside the existing Container / ContainerError imports
  • accept options?: ContainerStartupOptions as the second parameter
  • pass options to container.start(options)

No behavior change for existing callers (the parameter is optional).

….start

Cloudflare.start currently calls container.start() with no arguments,
silently dropping any ContainerStartupOptions the caller wants to apply
on each start (e.g. enableInternet, entrypoint, envVars overrides).

Accept an optional second parameter and forward it to container.start
so per-instance startup overrides are respected.
@sam-goodwin
sam-goodwin merged commit 1c72b9c into alchemy-run:main May 16, 2026
1 of 4 checks passed
DavidJFelix pushed a commit to DavidJFelix/alchemy-effect that referenced this pull request Aug 7, 2026
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.

2 participants