github Effect-TS/effect effect@4.1.1

Patch Changes

  • #10186 8567117 Thanks @effect-bot! - Restore SchemaBinary.toCodec derivation for Prompt.FilePart and the AI response part schemas that include it.

  • #10119 3f5c6aa Thanks @Marve10s! - 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.

  • #10189 29b89b6 Thanks @tim-smart! - 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.

  • #10188 0b4cfbc Thanks @effect-bot! - 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.
  • #10192 088510f Thanks @effect-bot! - Enforce MaxBodySize on buffered request body reads in BunHttpServer, DenoHttpServer, and HttpServerRequest.fromClientRequest.

  • #10142 ad62cd7 Thanks @effect-bot! - 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.

  • #10169 ba406a5 Thanks @tim-smart! - 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.

  • #10126 5e56eba Thanks @baptisteArno! - 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.

  • #10206 6a95d51 Thanks @effect-bot! - 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.

  • #10205 24d5acd Thanks @effect-bot! - 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.

  • #10163 c38dfa0 Thanks @effect-bot! - 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.

  • #10197 f2755e7 Thanks @effect-bot! - 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.

  • #10137 a40cb20 Thanks @effect-bot! - Fix DateTime.Zoned exposing its adjustedEpochMilliseconds cache as an enumerable property after DateTime.toDate, which broke Object.keys, spread and deep equality.

  • #10174 bd6b9c2 Thanks @effect-bot! - 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.

  • #10082 49d84d6 Thanks @typedrat! - 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.

  • #10185 a8f77d5 Thanks @effect-bot! - 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.

  • #10164 7a9c22f Thanks @effect-bot! - 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.

  • #10145 efcb8cc Thanks @jpowersdev! - Fix Host.domainNameFromString rejecting decomposed Unicode domain names.

  • #10125 378f5f0 Thanks @pujitha24! - Fix Effect.request retaining completed requests and their async context in its batch pool.

  • #10208 d4272bd Thanks @effect-bot! - 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 }.

  • #10207 7d6ead4 Thanks @effect-bot! - 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.

  • #10166 59178ce Thanks @tkr109! - Fix Iterable.takeWhile iterators yielding values or pulling from the source after they have returned done.

  • #10070 9394b6d Thanks @effect-bot! - 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.

  • #10116 5d3f066 Thanks @skyaara! - Declare KeyFormat.JsonWebKey instead of referencing the DOM library's global JsonWebKey, so effect declarations type-check with Node-only types.

  • #10082 49d84d6 Thanks @typedrat! - 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.

  • #10089 2863a22 Thanks @creatifcoding! - 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.

  • #10082 49d84d6 Thanks @typedrat! - Fix McpServer returning an internal error from resources/list and resources/templates/list on v2026_07_28 when an optional resource field is undefined.

  • #10082 49d84d6 Thanks @typedrat! - Recognize .py and .sh files in Mime.getType.

  • #10204 20cca92 Thanks @jpowersdev! - Ndjson.decode and Ndjson.decodeString now also skip lines containing only spaces or tabs when ignoreEmptyLines is enabled.

  • #10191 1f22f02 Thanks @jpowersdev! - 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.

  • #10152 dd2b7a3 Thanks @jpowersdev! - Fix Path.format dropping the dot before extensions given without one, such as ext: "csv".

  • #10157 52f4e42 Thanks @effect-bot! - Stop PgClient transactions from staying open after a pooler drops their prepared statements.

  • #10129 194dd79 Thanks @Gourav224! - 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.

  • #10104 c5de00a Thanks @tim-smart! - 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.

  • #10098 460827e Thanks @effect-bot! - 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.

  • #10103 0325583 Thanks @effect-bot! - 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.
  • #10167 20bef50 Thanks @tim-smart! - Remove the Effect.request batch pool and allocate a new batch for each batch key.

  • #10171 2f50b91 Thanks @effect-bot! - 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.

  • #10121 b41529e Thanks @Marve10s! - 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.

  • #10138 80954c9 Thanks @effect-bot! - Fix RpcClient acknowledging stream chunks dropped by an interrupted consumer, which could drain the entire server stream before the interrupt was sent.

  • #10133 5daca23 Thanks @aidenlx! - Fix Rpc.SuccessChunk resolving to never for a union of RPCs.

  • #10120 c96c31e Thanks @Marve10s! - Fail only the affected calls when an RpcClient.layerProtocolWorker worker crashes.

  • #10190 136ddf9 Thanks @effect-bot! - 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.

  • #10141 5ca262e Thanks @effect-bot! - Document how to retry serialization failures and deadlocks with SqlClient.withTransaction.

  • #10148 898b049 Thanks @effect-bot! - 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.

  • #10182 73e6ea1 Thanks @effect-bot! - 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.

  • #10105 937f170 Thanks @tim-smart! - 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.

  • #10177 f5f96b2 Thanks @jpowersdev! - Fix OtlpSerialization.layerProtobuf throwing on metric data points without startTimeUnixNano.

  • #10049 1946637 Thanks @lloydrichards! - 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.

  • #10181 197ce1d Thanks @effect-bot! - 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.

  • #9883 b49120e Thanks @danieljvdm! - 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.

  • #10146 33d3088 Thanks @effect-bot! - 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.

Don't miss a new effect release

NewReleases is sending notifications on new releases.