effect
4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed
4.1.5 is the newest release of 4.x.
In short
2 breaking5 security7 new4 faster38 fixed2 internal
- Breaking
BigDecimal.fromStringandSchema.BigDecimalFromStringreject strings whose scale, before or after removing trailing zeros, is outside ±10,000, such as"1e300000000","10e10000"or more than 10,000 fractional digits.BigDecimal.fromStringUnsafethrows for them. - Breaking
Operations that align scales (
sum,subtract,remainder,scale,round,truncate,ceil,floor) throw aRangeErrorwhen the scales differ by more than 20,000. - Security
Limit
BigDecimalscales to prevent resource exhaustion. - Security
Verify the session authentication signature before an EventLog server binds a signing key to an identity, and reject a verified key that differs from the identity's existing binding. A request with an invalid signature no longer creates a binding.
- SecurityTo check
Brand SQL fragments and segments with the new
Statement.FragmentTypeIdandStatement.SegmentTypeIdsymbols, sosqlinterpolation binds plain objects shaped like fragments or segments as parameters instead of SQL; build fragments and segments with theStatementconstructors. - Security
Sse.encodernow removes CR and LF from eventidandeventvalues, and NUL fromidvalues, so they cannot add fields or events to the encoded stream. - Security
Fix
Tool.unsafeSecureJsonParseaccepting Unicode-escaped__proto__andconstructorkeys. JSON text containing a\uescape is now always scanned, so escaped spellings throw aSyntaxErrorlike their literal forms. Objects with anullconstructorvalue are accepted instead of throwing aTypeError.
Release note
Patch Changes
Restore
SchemaBinary.toCodecderivation forPrompt.FilePartand the AI response part schemas that include it.Fix
AtomRegistry.subscribewithoutimmediatenever notifying for an atom that has not been read yet. Subscribing now builds the atom, so the listener hears later changes. This also fixesget.subscribe,get.streamwithwithoutInitialValue, anduseAtomSubscribein@effect/atom-react.A failed build no longer makes
subscribethrow: the next read reports the failure, and the listener hears the recovery. An error thrown by a failed build's finalizer no longer aborts the next build; it is reported once that build has its value.Speed up
Base64Url.decodeandBase64Url.decodeStringby decoding the URL-safe alphabet directly, instead of transliterating the input and decoding it again as standard Base64.Limit
BigDecimalscales to prevent resource exhaustion.BigDecimal.fromStringandSchema.BigDecimalFromStringreject strings whose scale, before or after removing trailing zeros, is outside ±10,000, such as"1e300000000","10e10000"or more than 10,000 fractional digits.BigDecimal.fromStringUnsafethrows for them.Operations that align scales (
sum,subtract,remainder,scale,round,truncate,ceil,floor) throw aRangeErrorwhen the scales differ by more than 20,000.roundreturns values already at or below the target scale unchanged.
Enforce
MaxBodySizeon buffered request body reads inBunHttpServer,DenoHttpServer, andHttpServerRequest.fromClientRequest.Add
onRejectiontoCircuitBreaker.execute. With"allow", a call the circuit would refuse withCircuitOpenorCircuitHalfOpenruns unrecorded instead, while a call the circuit admits, probe included, is recorded as usual. Calls that must always run can then still count towards the breaker's state. Defaults to"fail", which keeps the current behavior.Pass
{ probe }toCircuitBreakerclassifycallbacks, includingHttpClient.withCircuitBreaker.probeistruewhen the call is the HalfOpen probe, so a classifier can count an outcome it otherwise ignores, such as a rate-limited response, as a failure that reopens the circuit. Existing one-argument classifiers are unchanged. The callback type is exported asCircuitBreaker.Classifier.Fix
ClickhouseMigratorfailing to create its migrations table or record applied migrations, by running those statements as ClickHouse commands instead of queries.Migrator.makeaccepts an optionaltransformWritesoption for these statements, defaulting toidentity.Retry transient
PersistenceErrors when a cluster workflow sends an activity or reads its reply during a pending interrupt, instead of storing the failure as a workflow defect. A request whose save was committed but not acknowledged is deduplicated, so the activity still runs once.A cluster client request whose send fails is no longer retained by
Sharding.Fix local callers of persisted entity requests hanging when a reply save commits but reports a failure, for example when the connection drops before the COMMIT acknowledgement arrives. The runner now checks storage for the committed reply and lets the caller read it, without replaying the request.
Fix persisted success replies being stored after a
ClusterSchema.WithTransactionrequest transaction rolled back. A failed save inside the request transaction is no longer retried, since a retry could autocommit the reply outside the aborted transaction (for example after a MySQL deadlock). The failed transaction now replays the request instead.Fix type-checking the
effectcrypto declarations with@types/node22 or 24 and without the DOM library. The*FromCryptoKeyconstructors inAead,Cipher,KeyAgreement,KeyWrap,MacandSignaturenow accept the new structuralWebCrypto.CryptoKeytype instead of the globalCryptoKey, and DOM and Node Web Crypto keys are both assignable to it. TheWebCryptoreference andWebCrypto.layernow use the type ofglobalThis.cryptoinstead of the globalCryptotype.Fix
DateTime.Zonedexposing itsadjustedEpochMillisecondscache as an enumerable property afterDateTime.toDate, which brokeObject.keys, spread and deep equality.Speed up
DateTimeconstruction by creating thepartsUtc,adjustedEpochMillisecondsandpartsAdjustedcache properties on first use. Reading and writing these fields is unchanged, butObject.hasOwn,Object.getOwnPropertyNamesandObject.getOwnPropertyDescriptorno longer report them before the caches are populated, or at all on instances sealed or frozen before first use. Reading the parts of, or writing these fields on, an instance frozen before first use no longer throws.Fix
Equal.equalsandHash.hashthrowing on plain objects whose"~effect/Equal"or"~effect/Hash"key is not a function. Such values are now treated as data.Verify the session authentication signature before an EventLog server binds a signing key to an identity, and reject a verified key that differs from the identity's existing binding. A request with an invalid signature no longer creates a binding.
EventLogServerUnencrypted.EventLogServerAuthorization.authorizeIdentityand theauthorizeIdentityoption ofEventLogServer.layerRpcHandlersnow also receive the presented signing public key. Use the newEventLogSessionAuth.deriveSigningPublicKeyto record an identity's signing key at provisioning time and reject any other key.Stop finished fibers from retaining their last span and stack frame. A finished fiber kept alive by a cache entry, observer or
Deferredno longer keeps the ended span's parent chain, and the success values recorded on those spans, from being garbage collected.Fix
Host.domainNameFromStringrejecting decomposed Unicode domain names.Fix
Effect.requestretaining completed requests and their async context in its batch pool.Stop GraphQL calls from succeeding on non-2xx HTTP responses. A non-2xx GraphQL body without
errors, including{ data: null }, now fails with aTransportErrorcarrying the HTTPstatus,headersandRetry-After, so retry policies onisRetryableapply. A non-2xx body withdataanderrorsfails with aResponseErroreven with{ partial: true }.Add
HttpClient.timeout, which fails requests that receive no response within the given duration with anHttpClientErrorwrapping aTransportError, so the timed client keeps the standardHttpClientservice type and is retried byretryTransient. The timeout covers the wrapped client until it returns a response, which for a plain client is when the response headers arrive; body reads after that are not covered.Fix
Iterable.takeWhileiterators yielding values or pulling from the source after they have returneddone.Fix
SchemaRepresentation.fromJsonSchemaDocumentrejecting objects whoseanyOf/oneOfbranches are combined with sibling properties that contain anenum, such as branches redeclaring an enum property already declared by the object.Declare
KeyFormat.JsonWebKeyinstead of referencing the DOM library's globalJsonWebKey, soeffectdeclarations type-check with Node-only types.Add MCP Skills extension (SEP-2640) support. Servers publish skills with
McpServer.skillorMcpServer.registerSkill. Clients opt in withextensions: { skills: true }and uselistSkills,getSkill,readResourceDirectoryandreadSkillResource, which verifies files against the listed digests and frontmatter.Fix
McpServertoolkit results whose encoded success is not JSON, such as aSchema.Void,Schema.DateorSchema.optionalfield, failingtools/callwith an internal error.structuredContentand its text mirror now use the same JSON encoding as the advertisedoutputSchema.Fix
McpServerreturning an internal error fromresources/listandresources/templates/listonv2026_07_28when an optional resource field isundefined.Recognize
.pyand.shfiles inMime.getType.Ndjson.decodeandNdjson.decodeStringnow also skip lines containing only spaces or tabs whenignoreEmptyLinesis enabled.Fix
OtlpSerialization.layerJsonwritingbytesValuedata as plain objects instead of base64 strings.Uint8Arrayviews and NodeBuffers are now encoded as OTLP/JSON expects.Fix
Path.formatdropping the dot before extensions given without one, such asext: "csv".Stop PgClient transactions from staying open after a pooler drops their prepared statements.
Fix
Pool.getandPool.usehanging in finalizers registered after the pool once its idle items expire. The pool now runs in a child scope that stays open until the pool shuts down.Speed up
FileSystem.globby reading subdirectories concurrently, in at most 16 forked fibers per call plus the calling fiber, and only forking a fiber for directory entries that need astatorreadLink. Results and their order are unchanged.Reclaim expired keys in
RateLimiter.layerStoreMemory. Each entry now expires once its state is indistinguishable from an unseen key, matching the TTLs of the Redis store, and a background sweep scoped to the layer removes expired entries every minute, so an idle store drains to empty instead of retaining every key it has seen.Fix
RateLimiterhandling of zero and negative limits:RateLimiterStore.fixedWindownow honors a zerolimitin the memory and Redis stores.The Redis fixed-window script now rejects an over-limit first request instead of charging it.
Delay-mode
RateLimiter.consumenow returns an infinite delay for a nonpositive limit instead of admitting requests.
Remove the
Effect.requestbatch pool and allocate a new batch for each batch key.Document that a request accepted by an
RpcClient.Protocolstays pending until a reply names it, and how a transport that only delivers requests acknowledgesdiscardcalls and rejects the rest.Fail discarded RPC calls (
discard: true) promptly on transport errors.A discarded call waited for its pending send to finish before reporting any failure. While a socket was disconnected the call hung instead of failing, and once it reconnected the request was still sent and the handler ran. Failures now complete the call immediately and interrupt the pending send. Successful acknowledgements still wait for the send to finish.
Fix
RpcClientacknowledging stream chunks dropped by an interrupted consumer, which could drain the entire server stream before the interrupt was sent.Fix
Rpc.SuccessChunkresolving toneverfor a union of RPCs.Fail only the affected calls when an
RpcClient.layerProtocolWorkerworker crashes.Brand SQL fragments and segments with the new
Statement.FragmentTypeIdandStatement.SegmentTypeIdsymbols, sosqlinterpolation binds plain objects shaped like fragments or segments as parameters instead of SQL; build fragments and segments with theStatementconstructors.Document how to retry serialization failures and deadlocks with
SqlClient.withTransaction.Encode
HttpApiSchema.StreamSsedatavalues with the schema's JSON codec, so schemas such asSchema.Date,Schema.BigIntandSchema.Optionround-trip through SSE events and are documented accurately in OpenAPI.Sse.encodernow removes CR and LF from eventidandeventvalues, and NUL fromidvalues, so they cannot add fields or events to the encoded stream.Speed up
Glob.matchby tracking match states as a bitmask and reading path segments without splitting the path. Patterns such as*.tsthat are a literal prefix and suffix around one*are also checked without backtracking, which helpsFileSystem.globtoo.Fix
OtlpSerialization.layerProtobufthrowing on metric data points withoutstartTimeUnixNano.Add
McpClientservercapabilities, discovery page and itemlimits, andtoolkitoptions for approved tool snapshots, complete results, returned failures, trusted annotations and tool customization.Fix
Tool.unsafeSecureJsonParseaccepting Unicode-escaped__proto__andconstructorkeys. JSON text containing a\uescape is now always scanned, so escaped spellings throw aSyntaxErrorlike their literal forms. Objects with anullconstructorvalue are accepted instead of throwing aTypeError.Add unstable
effect/josemodules for JWKs (generation, PEM/DER conversion and thumbprints), compact JWS and JWE, schema-typed signed and encrypted JWTs with decryption key resolvers, and local or remote JWKS resolution.Wake a parent workflow when its suspended child is interrupted with
ClusterWorkflowEngine, and surface the child's interruption to the parent as a defect fromChild.executeso the parent completes instead of replaying.
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.