Packages

effect

4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed

Your version

4.1.1

30 Oct 2026Where it was published

4.1.5 is the newest release of 4.x.

In short

2 breaking5 security7 new4 faster38 fixed2 internal

  • Breaking

    BigDecimal.fromString and Schema.BigDecimalFromString reject 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.fromStringUnsafe throws for them.

  • Breaking

    Operations that align scales (sum, subtract, remainder, scale, round, truncate, ceil, floor) throw a RangeError when the scales differ by more than 20,000.

  • Security

    Limit BigDecimal scales 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.

  • Security

    Brand SQL fragments and segments with the new Statement.FragmentTypeId and Statement.SegmentTypeId symbols, so sql interpolation binds plain objects shaped like fragments or segments as parameters instead of SQL; build fragments and segments with the Statement constructors.

    To check
  • Security

    Sse.encoder now removes CR and LF from event id and event values, and NUL from id values, so they cannot add fields or events to the encoded stream.

  • Security

    Fix Tool.unsafeSecureJsonParse accepting Unicode-escaped __proto__ and constructor keys. JSON text containing a \u escape is now always scanned, so escaped spellings throw a SyntaxError like their literal forms. Objects with a null constructor value are accepted instead of throwing a TypeError.

Release note

Patch Changes

  • Restore SchemaBinary.toCodec derivation for Prompt.FilePart and the AI response part schemas that include it.

  • Fix AtomRegistry.subscribe without immediate never notifying for an atom that has not been read yet. Subscribing now builds the atom, so the listener hears later changes. This also fixes get.subscribe, get.stream with withoutInitialValue, and useAtomSubscribe in @effect/atom-react.

    A failed build no longer makes subscribe throw: 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.decode and Base64Url.decodeString by decoding the URL-safe alphabet directly, instead of transliterating the input and decoding it again as standard Base64.

  • Limit BigDecimal scales to prevent resource exhaustion.

    • BigDecimal.fromString and Schema.BigDecimalFromString reject 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.fromStringUnsafe throws for them.

    • Operations that align scales (sum, subtract, remainder, scale, round, truncate, ceil, floor) throw a RangeError when the scales differ by more than 20,000.

    • round returns values already at or below the target scale unchanged.

  • Enforce MaxBodySize on buffered request body reads in BunHttpServer, DenoHttpServer, and HttpServerRequest.fromClientRequest.

  • Add onRejection to CircuitBreaker.execute. With "allow", a call the circuit would refuse with CircuitOpen or CircuitHalfOpen runs 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 } to CircuitBreaker classify callbacks, including HttpClient.withCircuitBreaker. probe is true when 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 as CircuitBreaker.Classifier.

  • Fix ClickhouseMigrator failing to create its migrations table or record applied migrations, by running those statements as ClickHouse commands instead of queries. Migrator.make accepts an optional transformWrites option for these statements, defaulting to identity.

  • 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.WithTransaction request 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 effect crypto declarations with @types/node 22 or 24 and without the DOM library. The *FromCryptoKey constructors in Aead, Cipher, KeyAgreement, KeyWrap, Mac and Signature now accept the new structural WebCrypto.CryptoKey type instead of the global CryptoKey, and DOM and Node Web Crypto keys are both assignable to it. The WebCrypto reference and WebCrypto.layer now use the type of globalThis.crypto instead of the global Crypto type.

  • Fix DateTime.Zoned exposing its adjustedEpochMilliseconds cache as an enumerable property after DateTime.toDate, which broke Object.keys, spread and deep equality.

  • Speed up DateTime construction by creating the partsUtc, adjustedEpochMilliseconds and partsAdjusted cache properties on first use. Reading and writing these fields is unchanged, but Object.hasOwn, Object.getOwnPropertyNames and Object.getOwnPropertyDescriptor no 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.equals and Hash.hash throwing 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.authorizeIdentity and the authorizeIdentity option of EventLogServer.layerRpcHandlers now also receive the presented signing public key. Use the new EventLogSessionAuth.deriveSigningPublicKey to 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 Deferred no longer keeps the ended span's parent chain, and the success values recorded on those spans, from being garbage collected.

  • Fix Host.domainNameFromString rejecting decomposed Unicode domain names.

  • Fix Effect.request retaining 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 a TransportError carrying the HTTP status, headers and Retry-After, so retry policies on isRetryable apply. A non-2xx body with data and errors fails with a ResponseError even with { partial: true }.

  • Add HttpClient.timeout, which fails requests that receive no response within the given duration with an HttpClientError wrapping a TransportError, so the timed client keeps the standard HttpClient service type and is retried by retryTransient. 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.takeWhile iterators yielding values or pulling from the source after they have returned done.

  • Fix SchemaRepresentation.fromJsonSchemaDocument rejecting objects whose anyOf / oneOf branches are combined with sibling properties that contain an enum, such as branches redeclaring an enum property already declared by the object.

  • Declare KeyFormat.JsonWebKey instead of referencing the DOM library's global JsonWebKey, so effect declarations type-check with Node-only types.

  • Add MCP Skills extension (SEP-2640) support. Servers publish skills with McpServer.skill or McpServer.registerSkill. Clients opt in with extensions: { skills: true } and use listSkills, getSkill, readResourceDirectory and readSkillResource, which verifies files against the listed digests and frontmatter.

  • Fix McpServer toolkit results whose encoded success is not JSON, such as a Schema.Void, Schema.Date or Schema.optional field, failing tools/call with an internal error. structuredContent and its text mirror now use the same JSON encoding as the advertised outputSchema.

  • Fix McpServer returning an internal error from resources/list and resources/templates/list on v2026_07_28 when an optional resource field is undefined.

  • Recognize .py and .sh files in Mime.getType.

  • Ndjson.decode and Ndjson.decodeString now also skip lines containing only spaces or tabs when ignoreEmptyLines is enabled.

  • Fix OtlpSerialization.layerJson writing bytesValue data as plain objects instead of base64 strings. Uint8Array views and Node Buffers are now encoded as OTLP/JSON expects.

  • Fix Path.format dropping the dot before extensions given without one, such as ext: "csv".

  • Stop PgClient transactions from staying open after a pooler drops their prepared statements.

  • Fix Pool.get and Pool.use hanging 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.glob by 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 a stat or readLink. 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 RateLimiter handling of zero and negative limits:

    • RateLimiterStore.fixedWindow now honors a zero limit in the memory and Redis stores.

    • The Redis fixed-window script now rejects an over-limit first request instead of charging it.

    • Delay-mode RateLimiter.consume now returns an infinite delay for a nonpositive limit instead of admitting requests.

  • Remove the Effect.request batch pool and allocate a new batch for each batch key.

  • Document that a request accepted by an RpcClient.Protocol stays pending until a reply names it, and how a transport that only delivers requests acknowledges discard calls 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 RpcClient acknowledging stream chunks dropped by an interrupted consumer, which could drain the entire server stream before the interrupt was sent.

  • Fix Rpc.SuccessChunk resolving to never for a union of RPCs.

  • Fail only the affected calls when an RpcClient.layerProtocolWorker worker crashes.

  • Brand SQL fragments and segments with the new Statement.FragmentTypeId and Statement.SegmentTypeId symbols, so sql interpolation binds plain objects shaped like fragments or segments as parameters instead of SQL; build fragments and segments with the Statement constructors.

  • Document how to retry serialization failures and deadlocks with SqlClient.withTransaction.

  • Encode HttpApiSchema.StreamSse data values with the schema's JSON codec, so schemas such as Schema.Date, Schema.BigInt and Schema.Option round-trip through SSE events and are documented accurately in OpenAPI.

  • Sse.encoder now removes CR and LF from event id and event values, and NUL from id values, so they cannot add fields or events to the encoded stream.

  • Speed up Glob.match by tracking match states as a bitmask and reading path segments without splitting the path. Patterns such as *.ts that are a literal prefix and suffix around one * are also checked without backtracking, which helps FileSystem.glob too.

  • Fix OtlpSerialization.layerProtobuf throwing on metric data points without startTimeUnixNano.

  • Add McpClient server capabilities, discovery page and item limits, and toolkit options for approved tool snapshots, complete results, returned failures, trusted annotations and tool customization.

  • Fix Tool.unsafeSecureJsonParse accepting Unicode-escaped __proto__ and constructor keys. JSON text containing a \u escape is now always scanned, so escaped spellings throw a SyntaxError like their literal forms. Objects with a null constructor value are accepted instead of throwing a TypeError.

  • Add unstable effect/jose modules 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 from Child.execute so 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.