Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 03df55f The changes in this PR will be included in the next version bump. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
github-actions
Bot
had a problem deploying
to
testing branch preview / next
April 11, 2026 19:05
Failure
github-actions
Bot
had a problem deploying
to
testing branch preview / next
April 14, 2026 08:36
Failure
github-actions
Bot
had a problem deploying
to
testing branch preview / next
April 14, 2026 10:09
Failure
✅ Documentation PR preview deployed successfullyThis pull request gets a stable PR-scoped preview link that is updated in place on every preview run.
Logs and details
|
✅ Testing branch preview deployed successfullyThis workflow publishes a branch-scoped testing preview on every qualifying push, even when no pull request exists. When the branch belongs to an open pull request, the same run also refreshes the stable PR preview comment.
Logs and details
|
github-actions
Bot
had a problem deploying
to
testing branch preview / next
April 14, 2026 12:06
Failure
github-actions
Bot
had a problem deploying
to
testing branch preview / next
April 14, 2026 13:21
Failure
github-actions
Bot
had a problem deploying
to
documentation branch preview / next
April 14, 2026 17:21
Failure
github-actions
Bot
had a problem deploying
to
testing branch preview / next
April 14, 2026 17:28
Failure
createRuntimeLogForwarder sent workerd's `warn` lines to logger.error with the `error` ones — the split workerd's stdout and stderr once made — and RuntimeLogLogger had no `warn`, so every console.warn a worker made printed with an ` ERROR ` badge in the dev log (seen in uidini as ` ERROR [uidini/share] browser close resolved 66ms after …`, a console.warn). `warn` now goes to logger.warn, falling back to console.warn; `error` is unchanged. All three callers (dev-server/server.ts ×2, workspace/server.ts) pass a ConsolaInstance, which has `warn`. The test that asserted warn → logger.error is replaced by one asserting warn → logger.warn and error → logger.error, plus the console.warn fallback; both failed before this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…still running reapExitingChrome decided "exited" by the runtime's `exit` event (or an exit code) alone. On Windows that event can trail Chrome's exit by seconds: it tracks the root's conhost.exe child going away, not the root. Measured with a real chrome-headless-shell 156 closed over CDP `Browser.close`, under Bun 1.4.2 AND Node 25.9.0 (so not a Bun bug): process.kill(pid, 0) answered ESRCH first, and `exit` came more than 1 s later in 10 of 65 Bun and 3 of 15 Node sessions, 17.6 s at worst; one Bun session saw none in 14 s. Past the 5 s grace the reap killed a Chrome that had exited, waited 5 s more for the event, and threw ChromeReapError "was still running … and it was killed" — while taskkill said "There is no running instance of the task" for the root's pid. waitForExit now also polls a liveness probe (new ReapOptions.isRunning, default processIsRunning = process.kill(pid, 0); ESRCH gone, EPERM running, anything else rejects the reap), at once, every 100 ms and at the deadline. An `exit` still ends the wait at once. A Chrome the probe still reports running after the kill is still a ChromeReapError. Tests: fake processes whose `exit` never comes while the probe reports them gone — before the grace, already gone, and after the kill — resolve `exited`/`killed` without a kill or a throw (red before: they killed and threw); one the probe reports running after the kill still throws and was probed after the kill; a throwing probe rejects; processIsRunning answers for a real process before and after it exits. Existing tests now inject the fake's probe, since their made-up pids would otherwise be probed for real. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eanup, EPERM and probe failure are graded
Round 1 (quality-reviewer, opus) returned PASS with 0 red. Its yellows, and
what was done with each:
1. The 100 ms liveness poll was ungraded (removed, all tests passed: the
deadline probe answered 2 s later). The two "OS reports gone" cases now
require the reap inside 500 ms of a 2 s grace, and the already-gone case
inside 50 ms, which grades the probe asked at once.
2. Timer cleanup was ungraded: without clearInterval(poll) in stop() a 100 ms
kill(pid, 0) loop ran on per reap, forever. A case per deciding path (the
event, the OS) counts probe calls, waits 350 ms after the reap resolved,
and requires the count not to move.
3. EPERM -> running was ungraded. processIsRunning takes the kill call as a
second parameter (default process.kill); ESRCH, EPERM, another errno and a
call that returns are each graded with a stand-in, no protected pid needed.
4. A probe that threw rejected the reap with its raw error, before any grace
or kill, and the session's report named no Chrome. It is now a
ChromeLivenessError naming the pid, saying whether the kill had run ("so it
was not killed" before it), with the probe's error as `cause`. Chosen over
falling back to an event-only wait: the probe failing at all is unexpected,
and guessing on in that state is what produced the false report this lane
exists to remove.
5. The changeset and the file header asserted a mechanism (`exit` follows the
conhost.exe child going away) that was correlation, not measurement. Cut;
the header now says why the event lags is not established. A new
ReapOptions.onExitSeenByOs is told when the probe rather than the event
decided, and toSessionBrowser writes it as a debug line, so a session
whose `exit` never came leaves a trace.
Also: the real-Chrome test's answers(port) had no fetch timeout, and a reap
can now finish before Windows has closed Chrome's sockets; it is bounded at
2 s and a timeout reads as "not answering". Ran 6 times on Windows (18
sessions): 3 pass each time. And the processIsRunning real-process test now
probes in a loop that never yields on Windows, so the pid cannot be released
for reuse before the probe answers; POSIX still probes after `exit`, since a
zombie answers as running until the runtime reaps it.
Every new grade was checked against a mutant of the fixed source: no poll,
stop() leaving the poll, EPERM -> gone, the probe error unwrapped, no
onExitSeenByOs call, no probe at once, and no default trace in
toSessionBrowser — each is killed by the named cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is public
A predeploy check grading a config under a controlled environment had two bad choices. Running
`loadConfig` let the dotenv layer copy every ancestor `.env.public`, `.env.dev` and `.env` into
`process.env` first, so an untracked file on the checking machine decided the answer. Importing
the config module itself meant reading only its top-level `vars`, which misses `env.production`,
`extends`, `wrangler.passthrough.vars` and a sibling `devflare.config.js`, which c12 loads ahead of
the `.ts`. And `compileConfig` refuses a binding configured by name until `loadResolvedConfig` has
looked its id up over the network.
`loadConfig({ dotenv: false })` skips the layer and nothing else; the option guards that one call.
`compileBuildConfig`, the offline compile `devflare build` and `deploy --dry-run` already use, is
exported from `devflare` (the root entry re-exports the compiler's own function, asserted by
identity; the browser entry refuses it by name with a Node-only hint). Its doc-comment and the docs
say what it does NOT cover: an `env.X` descriptor stays a descriptor until a deploy resolves it,
preview-scoped names read `DEVFLARE_PREVIEW_*`, which `deploy --prod` clears, and Bun's own `.env`
loading needs `bun --no-env-file`. `LoadConfigOptions.environment` now says `loadConfig` ignores it.
Tests: the layer off and on for one fixture holding an ancestor `.env.public` and a `.env` beside
the config; `extends` and the schema still applied with it off; the compile contract, including a
name-only D1. Three mutants each die to exactly one case: the option ignored, c12's own dotenv
loader switched on, and an early return that skips the schema.
`resolveConfigEnvVars` stays internal: in build mode it throws on a required `env.X` descriptor
with no value, so a check under a controlled environment could not use it without failing correct
configs.
QA round 1 (one fresh reviewer, opus, xhigh): 1 🔴 (the docs said the compiled vars are what a
deploy ships, which is false for descriptors and inherited preview variables; deleted and replaced
by the caveats above) and 5 🟡, all fixed. No second round owed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y off a config's vars In dev the app directory's .dev.vars (or wrangler's .env fallback) is laid over vars and beats what the config computed, so a launcher deciding those values itself could not hold them. With the switch off, applyLocalDevVarsToConfig returns the config itself and reads no file. The name is exported as LOCAL_DEV_VARS_ENV. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the browser entry, an unknown value is refused, and "reads no file" is graded The root export had no browser.ts mirror, which package-surface.test.ts caught; the name now lives in a module that imports nothing and both entries re-export it. A value outside the two lists throws rather than quietly keeping the overlay on. An unreadable .dev.vars (a directory) is opened with the switch on and never with it off, which kills a guard moved after the read. Both test files start every case with the switch unset. The docs name the @cloudflare/vite-plugin path the switch does not reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f() evaluates what it imports Every function satisfied DevflareConfigInput on its own (its `name` is a string, the rest is optional), so the object overload of defineConfig took every factory: `defineConfig(async () => …)` typed as TypedConfig, and no factory's body was checked against the schema. The object overload now refuses functions through a `[Symbol.hasInstance]?: never` member, which a symbol key keeps out of the literal's completions. ref() read the referenced module's default raw, so an async config threw `Referenced config must have a "name" property` and a named factory resolved to the function's own name. It now awaits the default and calls it when it is a factory, as c12 does for loadConfig, and its types accept such modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nts> declares ExtractEntrypoints matched against TypedConfig<infer E> with the default vars, Record<string, unknown>. Explicit entrypoints leave a config's vars `unknown`, which that refuses, so every such config's accessor widened to `string`. Match with `unknown` vars instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… compiles again, and factory errors name the field A value typed as the exported DefineConfigInput union matched none of the three overloads once the object overload refused functions. A fourth overload takes it, its object arm guarded by the same NotAFunction, and types the result as maybe-a-Promise. With four overloads TypeScript reports only the last, so its single factory arm returns either form: two arms made one kind of factory's error elaborate against the wrong one. The probe now asserts each marked line's reason, not just its line, and grades ref().config for a module exporting a raw factory. The changeset no longer claims parity with loadConfig (only with c12's await-then-call step) or that ref()'s types newly accept such modules, and it names the two type changes a consumer can hit: a factory that declares a parameter, and a DefineConfigInput value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The child re-resolves its platform.env through resolveDevConfig, which reads the switch from its own process.env, so buildViteChildEnv must not strip it with the two DEVFLARE_ channels it does strip. Nothing graded that; stripping inherited DEVFLARE_* names now fails this case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, as build and dry run resolve them `prepareDeployConfig` called `resolveConfigEnvVars` on the loaded config, which reads `config.vars` alone, and `prepareConfigResourcesForDeploy` merged `env.<environment>` over it afterwards. A descriptor in `env.production.vars` or `env.preview.vars` therefore reached `.devflare/deploy/wrangler.jsonc` as the descriptor object, while `devflare build` and `deploy --dry-run` (both merge, then resolve) printed its value. A required base descriptor that the environment replaces failed the deploy and nothing else. All three now resolve through `resolveConfigEnvVarsForEnvironment`, which merges and then resolves. The deploy resolves before provisioning anything, then puts those `vars` back onto the config that resource preparation re-merged. Preparation must keep taking the loaded config, because preview prep finds preview-scoped resources by the unmaterialised binding strings. Fixed by the same change: - The drift check hashed the unmerged config while the build hashed the merged one, so every deploy of a config with an `env` section for its target warned "source config changed since build" about the artefact it had just built. - The dry run's "Resolved view" re-merged the environment from the merged config's leftover `env` section and printed its descriptors. Tests (`deploy-env-vars.test.ts`) drive the real deploy against a mocked Wrangler for `--prod`, `--preview` and a shadowed base descriptor. Each case asserts the deployed `vars`, and that both dry-run views print the same `vars`. A fourth case asserts the deploy reports no drift. Before the fix, the three new resolution cases failed. Four mutants were each killed: dropping the `vars` carry-over, resolving the unmerged config again, hashing the loaded config, and keeping the re-merged `vars` in the resolved view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e control, and the remark names a public call
- `resolveConfigEnvVars`'s `@remarks` pointed public readers at `resolveConfigEnvVarsForEnvironment`,
which `devflare/config` does not export. It now names the public merge,
`resolveResources(config, { phase: 'build', environment })`.
- The "no drift" deploy test matched a literal heading, so a reworded warning would have let it pass
on any output. The heading now comes from `formatDriftWarning`. A positive control also deploys
with `--build` after the config changed and expects drift. With drift reporting disabled, only
that control fails; the no-drift case cannot see it.
Left for the owner (reported, not changed here):
- Nothing checks that preview prep receives the loaded, unmaterialised config. Passing it the
materialised `targetConfig` survives every deploy suite, and `--preview` would then provision no
preview resources. This gap predates the commit. Closing it takes a `--preview` deploy with a
preview-scoped binding against a stubbed Cloudflare API.
- `mergeEnvironmentValue` deep-merges two env descriptors that share a key, because descriptors are
plain objects. The environment's descriptor then inherits the base's `.parse()`. This predates the
commit, but build, dry run and deploy now all share it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ble instead of throwing
A predeploy check could not see what an `env.X` descriptor's `.default()` ships. `loadConfig({ dotenv:
false })` and `compileBuildConfig` leave each descriptor as the object it is, so a check reading `vars`
as strings passed `env.SHARE_ORIGIN.default('http://localhost:5991')` while a deploy shipped the
localhost address. The resolvers devflare uses were no substitute: `resolveConfigEnvVars` reads the
dotenv files, and both it and `resolveVarsFromSources` throw in build mode on a required variable with
no value, which fails a correct config that nobody has provisioned in the check's environment.
`resolveConfigEnvVarsFromSources(config, { environment, sources, mode })` is exported from `devflare`.
It merges the environment, then resolves every descriptor in the merged `vars`, the order
`resolveConfigEnvVarsForEnvironment` uses for build, dry run and deploy. `mode` defaults to `build`.
A descriptor reads `sources` alone (preview-scoped names still materialise from `DEVFLARE_PREVIEW_*`
in `process.env`, as a build does). It returns `{ config, missing }`: a required variable with no
value is listed with its path and left out of `config.vars`, a parser refusing a value still throws,
and the config carries no `env` sections, so compiling it again for the environment cannot merge an
unresolved descriptor back in. The browser entry refuses it by name. The throwing resolvers stay internal and now share its core,
`resolveVarsReportingMissing`, so all of them resolve one way.
Tests: `tests/unit/config/env-vars-from-sources.test.ts` (11 cases) — a default ships and a source
wins over it; a missing required variable is reported and dropped, an absent optional one only
dropped; build is the default mode (`.dev()` and `.absentInDev()` off, with dev as the control); the
environment merges first; `process.env` is not read; a parser refusal throws; the documented
`compileBuildConfig(…, { alreadyResolved: true })` recipe emits the resolved values; and two agreement
cases run the build's own resolver over the same values; the result has no `env` section, so a
second compile for the environment agrees; and preview names materialise, from `process.env`. `package-surface.test.ts` asserts the root
export by identity, the throwing resolvers' absence, and the browser refusal. Seven mutants each died:
mode defaulting to dev (2 cases), the merge skipped (3), `process.env` read (1), `missing` emptied (3),
a throw on a missing variable (3), the `env` section kept (1), and the merge without preview
materialisation (1). The unit lane on this commit: 2159 pass, 2 skip, 0 fail.
Docs: the configuration page, `LLM.md`, the README export table, `API_STABILITY.md`, and
`compileBuildConfig`'s doc-comment, which now names the resolution step instead of only warning.
QA round 1 (one fresh reviewer, opus, xhigh): PASS, 0 🔴, five 🟡, all fixed — the returned config
kept its `env` section; "reads `sources` and nothing else" was false for preview names; preview
materialisation was untested; `EnvVarParseError` was documented as importable and is not (its `code`
is documented instead, and `EnvResolutionMode` is exported); and a test comment overclaimed what the
agreement cases detect. Two 🟢 taken: `missing` is in walk order, not declaration order, and a plain
object rather than `process.env` itself is advised, since win32 matches its names case-insensitively.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…run locally through ctx.container A container entry may set schedulingPolicy: 'durable_object' with named images. It compiles to the fields Wrangler takes for that policy (class_name, scheduling_policy, name, images), and the schema refuses the application-wide fields Wrangler rejects there. devflare dev and createTestContext() build each named image with Docker or Podman, pull Miniflare's egress interceptor, and attach the container to its Durable Object in Miniflare with SQLite storage, the shape wrangler dev uses. The test gateway exports a container-backed module's WorkerEntrypoint classes so outbound intercepts can target ctx.exports. Windows is refused (workerd cannot reach a named pipe), workspace dev refuses such an app, and DEVFLARE_ENABLE_CONTAINERS=0 turns local containers off. A new workspace-ci job runs the engine-backed test on the runner's Docker and fails if it would skip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sertions, and the Wrangler parity test in a serial lane Importing Wrangler in the unit lane left two other files holding a method-less Miniflare on Linux CI, so the parity test moves to the serial test-context lane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…side their own tests mock.module is process-global and the unit lane runs every file in one process in directory order. Adding test files on Linux put simple-context-runtime.test.ts before simple-context-multi-worker and local-secrets, which then built its FakeMiniflare (no dispose, fake getBindings). The mocks now fake only while that file's tests run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-tested, builds load into the engine's store - red: the devflare dev path had never run a real container and no test reached its wiring. A dev-server integration test now drives the same Durable Object through createDevServer, and the CI container job runs it. - docker builds pass Wrangler's --load and --provenance=false, so a buildx docker-container builder cannot keep the image out of the store. - Podman on macOS reads the machine's host-side socket. - a container class that failed to bundle names the bundle error; the workspace refusal runs before anything starts; the refusal for an unserved class no longer sends readers to another worker, and the docs say referenced workers' containers do not run locally. - the deprecation and 2026-12-31 claims name their sources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… locally A config that reaches a container only through a worker it references (a ref() service binding, or a cross-worker Durable Object binding to its class) now gets that worker's containers in createTestContext() and devflare dev: devflare builds the images from the referenced config, attaches them where it hosts that worker's Durable Objects, and exports the WorkerEntrypoint classes their modules declare so an intercept can target ctx.exports. workspace dev refuses such an app, and the Vite plugin leaves them out, as documented. Graded end to end by three new container-lane integration tests (service binding, cross-worker DO ref, devflare dev) and by unit tests of the refuse, ignore and turned-off modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- resolve-service-bindings.ts was 1,147 lines against the 1,000-line ceiling, which reddened validate. The referenced-container decision moves to referenced-containers.ts, and Bun detection, the bundle cache and the Durable Object host bundler to durable-object-bundle.ts (906 lines left; clearBundleCache and ReferencedContainerMode are still exported from it). - A referenced worker's container engine reaching Miniflare was graded by nothing, because Miniflare's default socket hid a dropped option. The test-context merge moves into applyMultiWorkerConfig, and unit cases on a non-default socket grade it there and in buildMiniflareDevConfig. - The workspace-dev refusal was graded only through the function it calls. A test now runs prepareWorkspaceApp against an app that references a container-backed builder. - Docs no longer say a cross-worker Durable Object ref's containers run under devflare dev, which resolves no such refs. They say the devflare dev path is tested for a worker-only project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p dirs The Durable Object host bundler moved out of resolve-service-bindings.ts and still writes its temporary entry beside the classes it bundles, so the census of hardcoded .devflare paths names the new file with the same reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
resolve-service-bindings now imports the container modules, which brings src/test/containers.ts into apps/documentation's svelte-check. Under @cloudflare/workers-types, Request.clone() is typed with the class's own generic parameters, which fetch does not accept, so that check failed on fetchWithStartupRetries. The clone is asserted back to Request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.