Effect 4.0.0 is out as the first stable v4 release. We were on 4.0.0-rc.115. Between the two, Effect removed the effect/unstable/* export paths and the effect/Encoding module, and changed a few APIs we depend on.
Changes#
- Imports. All 675 files that imported
effect/unstable/* now use the flattened effect/<area> paths. httpapi is now http-api, and arbitrary/Arbitrary is now effect/Arbitrary. effect/Encoding is replaced by effect/encoding/{Base64,Base64Url,Hex}.
- Tracing for the browser trace proxy.
HttpRouter.serve now builds its app in a private layer memo map. Because of that, the server-wide TracerDisabledWhen predicate, which was merged into makeRoutesLayer, stopped applying, and the browser OTLP proxy route was traced again. server.test.ts caught this. A new withUntracedRequests helper provides the predicate to the served layer, and both the server and the test use it.
- Closing scopes.
Scope.close now only accepts a closeable scope.
- SSH tunnels take their entry scope explicitly instead of reading it from the context.
- The Codex session runtime forks a child of the caller's scope so
close can still end it.
- Smaller API changes:
Effect.partition now returns successes first.
Stream.scan takes a lazy initial state.
SchemaGetter.onSome is replaced by transformEffect, and .compose by SchemaGetter.compose / SchemaTransformation.composeTransformation.
Schema.brand requires a single concrete brand key.
Effect.orElseSucceed now passes the error, which needed a type annotation on the WSL test stub.
- Patches, re-ported onto 4.0.0:
- MCP HTTP DELETE. This is now registered in the HTTP protocol layer against the new internal stateful MCP runtime.
- RpcClient. The request/ping hooks, the three-missed-pong tolerance and the
getSetCookie guard carry over. The ping timeout now uses upstream's SocketReadError reason.
@effect/vitest. The patch is still just the vite-plus/test import swap. pnpm rejects catalog: in the @effect/vitest packageExtensions entry once it re-resolves, so vite-plus is pinned there literally.
Known gap: relay#
infra/relay still uses alchemy@2.0.0-beta.79, the latest published version. It and its @distilled.cloud/* dependencies import the removed effect/unstable/* paths, so the relay will not typecheck, test or deploy until alchemy publishes beta.80. Alchemy main already supports the 4.0.0 module layout. Its preview tarballs depend on URL-pinned distilled packages, which our blockExoticSubdeps policy rejects, so this PR does not pin them. The follow-up is to bump alchemy once beta.80 is on npm.
.repos/effect-smol will be synced in a separate refs PR, as before.
Verification#
tsc --noEmit is clean for server, web, desktop, mobile, contracts, shared, client-runtime, ssh, tailscale, effect-acp, effect-codex-app-server, scripts and oxlint-plugin-t3code.
- Focused tests pass:
server.test.ts, including the OTLP untraced test
McpHttpServer.test.ts, including MCP session DELETE
session.test.ts, including missed-pong tolerance
- The Codex adapter, the SSH tunnel and replay markers
- Schema JSON and the call sites that moved to the new encoding modules
🤖 Generated with Claude Code
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
408ff8a· PR result:6512a81· Source CI: failureScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.