effect
4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed
4.1.5 is the newest release of 4.x.
In short
11 breaking5 security17 new2 faster75 fixed1 internal
- Breaking
Require tool parameter schema services in
Response.AllParts,Response.PartandResponse.StreamPart, including for toolkits with handlers, and addTool.ParametersDecodingServices. - Breaking
Fix
Exit.hasFails,Exit.hasDies,Exit.hasInterrupts, andAsyncResult.isInterruptednarrowing away every failure when they returnfalse. They now returnboolean, like the matchingCausechecks; useExit.isFailureorAsyncResult.isFailureto narrow. - Breaking
Handlers receive an
upgradefunction instead ofsocket:upgrade(), orupgrade({ headers })when headers are declared. - Breaking
HttpServerRequestgainsupgradeWith({ headers }), andupgradeisupgradeWith({}). Third-partyHttpServerRequestimplementations must add it. WebSocket upgrades fail when headers are given. - Breaking
JsonPatch.applynow throws on malformed JSON Pointer escapes, such as/a~2or a trailing~, instead of treating them as literal keys. - Breaking
MutableRefandRefnow compare by reference. Distinct instances with equal contents no longer compareEqualor share aHashSetorHashMapkey. - Breaking
Reject repeated occurrences of single-valued CLI flags instead of silently keeping the first value. Use
Flag.atLeast,Flag.atMostorFlag.betweento accept multiple values. - BreakingTo check
Fix
Schedule.fibonacciskipping the repeated initial delay. For a base of 100 millis the delays are now 100, 100, 200, 300, 500 ms instead of 100, 200, 300, 500, 800 ms, so every retry delay after the first is shorter than before.
Release note
Patch Changes
Add a scoped
CliOutput.Presenterservice for suppressing, redirecting, or replacing built-in CLI help, invalid-invocation, and version output.Require tool parameter schema services in
Response.AllParts,Response.PartandResponse.StreamPart, including for toolkits with handlers, and addTool.ParametersDecodingServices.Add a
toModelOutputoption toTool.makeandTool.dynamicfor sending text, images and files to the model in place of the serialized tool result. Anthropic and OpenAI Responses send native content blocks; OpenAI-compatible APIs and OpenRouter send text with a placeholder for each file, via the newPrompt.toolModelOutputToText.OpenAI Responses now sends PDF file parts given as base64, data URL or HTTP(S) URL strings instead of dropping them.
Add a
concurrencyoption toArbitrary.checkEffectand global check configuration to run independent property evaluations concurrently. Results remain deterministic for deterministic generators and repeatable properties, while shrinking and replay stay sequential. The default concurrency is1.Speed up
Base64.encodeandBase64Url.encodeon large inputs and reduce the memory they allocate.Fix duplicate interrupt reasons when interrupting a fiber inside
Effect.withSpanorEffect.fn.Fix
ChildProcessSpawnerhelpers hanging when a command fills a pipe the helper never reads.exitCodenow reads and discardsstdoutandstderruntil the process exits, andstring,lines,streamStringandstreamLinesread and discardstderrunlessincludeStderris set. A failure reading that output while the helper runs, such as from an outputSink, now fails the helper.Clarify that
ChildProcessoutput sinks forstdout,stderrand outputadditionalFdsonly receive data while the corresponding handle stream is consumed, and that the handle stream emits the sink's results.Fix Bash completion of file and directory paths containing spaces, quotes or glob characters.
Add
Completions.fromCommandtoeffect/cli. It converts an existingCommandtree into aCommandDescriptor, so build tooling can generate shell completion scripts withCompletions.generatewithout running the CLI.Skip
Flag.withFallbackPromptandArgument.withFallbackPromptfallbacks whenTerminalCapabilities.canPromptisfalse, failing with the originalMissingOptionorMissingArgumenterror instead of rendering a prompt or waiting for input.Show command help for invalid global flag values instead of failing with a raw parse error.
Add the
CliError.userMessageannotation soCommand.runrenders tagged handler errors without wrapping them inCliError.UserError.Record ClickHouse migrations only after they succeed, so a failed migration and the ones after it are retried on the next run.
Stop a runner that lost a shard lock from storing the final reply of a persisted request on that shard. Before storing it, the runner refreshes its shard locks and checks that the shard is still among them. If it is not, the request is left for the shard's new owner.
Release a frozen runner's PostgreSQL advisory shard locks after
shardLockExpiration. On PostgreSQL 14+,SqlRunnerStoragesetsidle_session_timeouton its lock connection, so a runner that stops refreshing loses its locks instead of holding them until the server drops its TCP connection.With advisory locks on PostgreSQL and MySQL,
SqlRunnerStoragerefresh now only confirms locks its current lock session holds. After the lock connection is replaced, shards held by the previous session are reported lost instead of being silently reacquired.Fix cluster shutdown waiting for
entityTerminationTimeoutwhen a workflow is waiting on a persisted activity request that has not started. During runner shutdown the caller is now abandoned so the request replays under the next owner, and a durable caller abandoned this way is left for replay instead of being answered with an interrupt. WithpreemptiveShutdown: false, entities drain before the runner is marked as shutting down, so such a caller still waits forentityTerminationTimeout.Fix a cluster workflow replay ignoring a durable deferred completion that is persisted but not yet processed by the new owner. A
DurableDeferred.raceAllcould pick a different winner on replay and run the wrong branch. Workflow replays now read the stored completion from the unprocessed request when it has no reply yet.Fix
ClusterWorkflowEnginerunning a completed step's compensation twice wheninterruptUnsafeinterrupts a workflow during a running activity.Fix a forced shard release stalling forever when a child workflow wakes its still-running parent. The wake's cluster abandonment was retried, so it waited on the retired run and blocked the shard from being reacquired. The abandonment now interrupts the wake, so the activation unwinds, the release completes, and the parent is resumed under the next owner.
Fix
HttpClientRequest.compressBodyreplacing the request's Content-Type with the body's content type. Compression now only updates the Content-Encoding and Content-Length headers.Fix
HttpMiddleware.compressionsending an uncompressed response whenAccept-Encodingcontains an empty list member, such asgzip,. Empty members are now ignored as RFC 9110 requires.Fix
Equal.equalsandHash.hashtreating any two same-lengthArrayBuffers as equal.ArrayBufferandSharedArrayBufferare now compared and hashed by their bytes.Fix
Exit.hasFails,Exit.hasDies,Exit.hasInterrupts, andAsyncResult.isInterruptednarrowing away every failure when they returnfalse. They now returnboolean, like the matchingCausechecks; useExit.isFailureorAsyncResult.isFailureto narrow.Prevent later
Semaphore.takecalls from overtaking eligible queued requests while preserving mixed-size overtaking.Fix
Queue.offerAll,MutableList.appendAllandMutableList.prependAllkeeping a reference to the caller's array. Changing that array afterward no longer changes the queued values.Fix
JsonSchema.toDocumentDraft07emittingenum:, which the Draft-07 metaschema rejects. An empty enum now becomes anallOfentry that rejects every value.Fix
Schema.isCapitalizedandSchema.isUncapitalizedaccepting astral letters with the wrong case.Fix
Schema.isULIDto reject values exceeding the 128-bit ULID limit.Fix
Effect.fnstack frames retaining call arguments. A fiber forked inside anEffect.fncall inherits the frame, which kept the arguments of that call and of every traced call above it alive for as long as the fiber ran.Fix
HttpClient.followRedirectsre-encoding the query of theLocationit follows (%20became+,flagbecameflag=, and invalid UTF-8 bytes were replaced with U+FFFD). The redirected request now uses the resolvedLocationURL without rewriting its query.Format values with own getters in
Formatter.formatJsonandCause.prettywithoutProxy, so engines that lack it no longer throw aReferenceError. Getter results stay redacted on every engine.Fix
HttpStaticServerdroppingContent-Location,Date,ExpiresandVaryfrom 304 responses.Add
HttpApiClient.decodeResponseto decode a raw endpoint response with the endpoint's declared success and error schemas, for example after aresponseMode: "response-only"call.Reject
.and..path parameters inHttpApiClientso they cannot change the request path through URL normalization.Describe undeclared response statuses in
HttpApiClienterrors. The reason is still aDecodeError, now with the descriptionundeclared status code, so the message readsDecode: undeclared status code (418 GET ...)instead ofDecode error (418 GET ...).Make
HttpApiClientclose the upgraded connection of anHttpApiSchema.Upgradeendpoint when the101response headers fail to decode, instead of leaving it open.Make
HttpApiClientclose the upgraded connection of anHttpApiSchema.Upgradeendpoint when it is interrupted right after taking the upgrade, before its cleanup was in place.Allow
HttpApiSchema.StreamUint8ArrayandHttpApiSchema.StreamNdjsonto declare a list of content types. The first entry is the default response type, streaming payloads are accepted under every entry, and OpenAPI emits the stream under each one.Stop
HttpClientErrorreasons from exposing request headers, query parameters and bodies when serialized or inspected. TheirtoJSONnow prints the request as its method and redacted URL, and the response as its status, matching the error message. The full request and response remain available through therequestandresponseproperties.Fix OpenAPI incorrectly marking optional HTTP parameters and headers as nullable.
Fix
HttpRouter.prefixeddropping the leading/from the local URL when only a query string follows the prefix. A handler for/api?x=1now sees/?x=1instead of?x=1, and a router mounted under a prefix no longer returns 404 for/prefix?query.Format
HttpServerErrormessages with only the request path, so query values and URL credentials can't leak into span errors or logs. The full request is still available on the error.Redact the URL in the failure that
HttpMiddleware.tracerrecords for 5xx responses when the response ends, so exporters that read the message later no longer see query values that were only redacted during the request.Fix
HttpApiClientmethod calls insideEffect.allwidening their required services toany, and reading services off a non-streaming method's type givingunknown.Name both endpoints when
HttpApiBuilder.layerfinds twoHttpApiEndpoints with the same method and path, and document how to declare request variants of one operation as a single endpoint.Allow buffered payloads and typed
101response headers onHttpApiSchema.Upgradeendpoints.HttpApiSchema.Upgrade({ protocol, headers })declares101headers, encoded likeWithHeadersheaders. Clients decode them and return{ headers, socket }, and OpenAPI lists them on the101.Upgrade endpoints can declare buffered payloads. Streaming payloads are still rejected.
Handlers receive an
upgradefunction instead ofsocket:upgrade(), orupgrade({ headers })when headers are declared.426 Upgrade Requiredis returned before the payload is decoded.HttpServerRequestgainsupgradeWith({ headers }), andupgradeisupgradeWith({}). Third-partyHttpServerRequestimplementations must add it. WebSocket upgrades fail when headers are given.NodeHttpServerwaits for the request body to end before writing the101. On Node 25 and older, which do not parse upgrade request bodies, it readsContent-Lengthbodies from the connection and answers chunked ones with411 Length Required.NodeMultipartfails with aMultipartErrorwhen its source stream errors, instead of waiting for more input.
- Breaking
Ignore
end,attribute,event, andaddLinkscalls on spans that have already ended. Logs andEffect.annotateCurrentSpanfrom fibers that outlive their span no longer modify the ended span,OtlpTracerno longer exports a span twice whenendis called again,OtelSpanno longer triggers OpenTelemetry SDK warnings for late calls, and the DevTools tracer no longer sends events for ended spans. Ignore malformed Set-Cookie Max-Age attributes instead of parsing their numeric prefixes.
SchemaRepresentation.fromJsonSchemaDocumentnow supports$refpointers below top-level definitions, including shared and recursive schemas, and rejects circular pointer aliases during import.JsonPatch.applynow throws on malformed JSON Pointer escapes, such as/a~2or a trailing~, instead of treating them as literal keys.Fix
Matcharray patterns matching arrays shorter than the pattern.Add a
controlMessagesoption to the JSON-RPC serializations inRpcSerialization. MCP servers disable it, so@effect/rpc/*notifications from MCP clients no longer stop stdio servers or write@effect/rpc/Pongto stdout.Fix
McpServermethod-not-found, invalid-params and invalid-request errors including an internal_tagfield. Strict MCP clients such asMcpClientrejected these responses and the stdio transport stopped serving later requests.Fix
MultipartParserrejecting horizontal tabs in quotedContent-DispositionandContent-Typeparameters.MutableRefandRefnow compare by reference. Distinct instances with equal contents no longer compareEqualor share aHashSetorHashMapkey.Fix
OpenApi.fromApito require all stacked security middleware instead of documenting them as alternatives.Add the
effect/observability/OtlpProxymodule, which serves OTLP routes that forward browser telemetry to a collector or vendor and keep credentials on the server.Fix
PartitionedSemaphoredeadlocking when waiters in different partitions request multiple permits, by completing one waiter before rotating to the next partition.Add the experimental
effect/persistence/CircuitBreakermodule with keyed circuits, consecutive and rate trip policies, an in-memory store and a Redis store, plusHttpClient.withCircuitBreakerandHttpClient.circuitBreakerClassifier.Fix
Poolwaiters starving under contention. Capacity freed by a release, an ended reservation, a new acquisition or a strategy reclaim now goes to the longest-waiting borrower instead of a borrower that arrives later.Fix
Stream.broadcastNdropping the last element for a subscriber that keeps up while another lags beyond capacity.PubSub.endno longer drops a backpressured message that a waiting subscriber has not received yet.Redact the AWS SigV4 query parameters
X-Amz-Signature,X-Amz-CredentialandX-Amz-Security-Tokenby default.Fix
HttpClient.followRedirectskeepingContent-Encoding,Content-LanguageandContent-Locationheaders on redirects that switch the request to GET.Release discarded redirect response bodies in
HttpClient.followRedirects.Add
Redis.reserve, which leases a dedicated connection from a pool, so blocking commands likeXREAD BLOCKandBLPOPno longer hold up other commands on the shared connection.NodeRedis,BunRedisandDenoRedislayers acceptmaxConnections,minConnections,idleTimeoutandacquireTimeoutto size the pool.Redis.makenow requires aconnectoption, and hand-writtenRedisservices need areservemember.Reject repeated occurrences of single-valued CLI flags instead of silently keeping the first value. Use
Flag.atLeast,Flag.atMostorFlag.betweento accept multiple values.Fix
RpcClientscope closure hanging when a streamed chunk fails to decode while the socket disconnects and never reconnects. The best-effortInterruptsent to the server for the failed request no longer blocks client shutdown, and is still sent if the client stays open.Treat synchronous throws from RPC handlers as request-level defects, so
disableFatalDefects: truefails only the throwing request instead of every pending request on the client.Fix
RpcSerialization.jsonRpcandndJsonRpcdropping or reordering stream chunks when a stream request is sent in a JSON-RPC batch.Add a
disableFatalDefectsoption toRpcTest.makeClient, so a handler defect fails only its own request instead of every pending request on the client.Fix
Schedule.fibonacciskipping the repeated initial delay. For a base of 100 millis the delays are now 100, 100, 200, 300, 500 ms instead of 100, 200, 300, 500, 800 ms, so every retry delay after the first is shorter than before.Fix
SchemaRepresentation.toCodeDocumentgenerating code that fails to load when a schema identifier isSchema,RegExp,DateorSymbol.Restore encoded content schemas for
Schema.fromJsonStringin schema representations and JSON Schema, including SSE event data in OpenAPI.Schema.fromJsonStringnow ignores explicitcontentMediaTypeandcontentSchemaannotations on its encoded String. PlainSchema.Stringschemas still honor those annotations.Content declarations and checks now participate in code generation and persistence; add any missing
toCodecallbacks orrepresentationidentities.The encoded projection of
Schema.fromJsonStringno longer carries acontentMediaTypeannotation.Keep caller stack frames in errors created with
Schema.Error.makeandSchema.TaggedError.make, including when only a decoder is registered.Support
Schema.Enumkeys inSchema.Record, declaring each enum member value as a required property instead of throwing during construction.Schema.Recordnow consistently rejects optional index-signature values created withSchema.optionalKeyorSchema.optional. UseSchema.UndefinedOrto allowundefinedvalues.Preserve shared references in
Schema.toCodecJsonandSchema.toCodecStringTree, and retainhttpApiStatusannotations when adding checks.If you relied on checks clearing HTTP statuses, add
.annotate({ httpApiStatus: undefined })explicitly.Fix
Schema.toJsonSchemaDocumentthrowing for named template-literal segments and emitting incorrect schemas for segment checks, exclusive unions, and empty unions.Fix
Snowflake.makeGeneratorreturning duplicate ids when the clock is frozen or moves backward.Fix
IN ${sql.in()}compiling to the invalidIN (). An empty list now matches no rows withINand every row withNOT IN, when the keyword directly precedes the helper. On PostgreSQL, array-typed columns are not supported, and a comparison on the left ofINmust be parenthesized:a = (b IN ${sql.in()}).Split
SqlEventJournalbatch statements so large remote syncs andwriteManycalls stay within database parameter limits, including the 100 parameters Durable Object SQLite allows per statement, still committing each batch in one transaction after a single callback.Keep
SqlResolverbatches separated by transactions started withSqlClient.makeWithTransactionwhen the caller's context has noSqlClient, or carries a different client. Requests outside such a transaction no longer join its batch, where a rollback could discard their writes.Fix
transformResultNamesandtransformQueryNamesthrowing on JSON arrays that containnull, and turning scalar items in those arrays into objects.Escape the
sql.updateValuesalias as an identifier, without applying name transforms. Pass a bare alias rather than pre-quoted SQL, and quote mixed-case PostgreSQL aliases where they are referenced. CustomonRecordUpdatecompiler hooks now receive the alias already escaped.Fix
Sse.makeParserdropping the first event of a stream that starts with a UTF-8 BOM when an empty chunk is fed first.Add the root
$schemato thedraft-07anddraft-2020-12schemas returned bySchema.toStandardJSONSchemaV1.Fix
Stream.groupByandStream.groupByKeygroups not ending when the upstream ends or fails.Fix
Stream.groupedandStream.rechunkdropping buffered elements when the upstream fails.Keep upstream stream failures out of sink error handlers in
Stream.run,Stream.peelandStream.aggregate/Stream.aggregateWithin. Upstream failures now reach the caller unchanged instead of being remapped or recovered bySink.mapError,Sink.catch,Sink.catchCauseorSink.orElse, andSink.onExitobserves them as an interruption.Preserve the throw location of defects raised in
Effect.syncandEffect.suspendwhen rendering causes on V8.Emit smaller declarations for exported
Data.taggedEnumconstructors by returning the namedData.TaggedEnum.Constructorand newData.TaggedEnum.GenericConstructortypes instead of expanded anonymous objects.Libraries that export a generic tagged enum and are built against this version emit
Data.TaggedEnum.GenericConstructorin their declarations, so their consumers needeffect4.0.7 or later.Fix
Cookies.fromSetCookiedropping cookies with spaces or tabs before=, such assession = abc, and keeping that whitespace at the start of the value insession= abc. Spaces and tabs around the name and value are now removed, as RFC 6265 requires, while percent-encoded spaces in the value are still decoded.Fix
HttpStaticServerignoringIf-MatchandIf-Unmodified-Since. Failed preconditions now return 412 before cache validation and range handling.Fix
Toml.parsetreating everything after a bare carriage return as comment text. A carriage return not followed by a line feed now throws aSyntaxError; LF and CRLF line endings are still accepted.Fix
Toml.parseto reject forbidden raw control characters, including bare carriage returns.Fix
Toml.parseto reject integers outside JavaScript's safe integer range instead of silently rounding them.Fix
Toml.parseaccepting a table defined twice, such as a[table]header for a table that dotted keys already defined.Fix
Toml.parseto reject Unicode escapes that are not scalar values, as required by TOML 1.0.Fix
Cookies.parseHeaderleaving quotes on values surrounded by whitespace.Fix
SqlRunnerStorageleaking shard locks on Vitess after releasing all shards.RELEASE_ALL_LOCKS()makes vtgate replace the session's lock connection, so the stored lock holder id went stale: later acquisitions took locks the runner already held a second time, and releasing such a shard left it locked. The storage now re-takes its pin lock after releasing all shards and refreshes the stored id.Enforce
MaxBodySizeon buffered body reads (arrayBuffer,text,json,urlParamsBody) of webHttpServerRequests, as used by Bun, Deno andtoWebHandler. Bodies over the limit fail with aBodyTooLargeRequestParseError, which responds with 413.Replay a workflow on the next runner when shutdown interrupts an activity in a
DurableDeferred.raceAllwhose other branches are parked. Before, the run was stored asSuspendedand never resumed.Preserve the app's error and service types when applying
HttpMiddleware.xForwardedHeaders, instead of widening them toany.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.