Skip to content

Effect

4.0.0-beta.37

Patch Changes

  • #1812 f7a0b71 Thanks @tim-smart! - Consolidate the SqlError changes to the new reason-based shape across effect and the SQL drivers, classifying native failures into structured reasons with Unknown fallback where native codes are unavailable.

  • #1816 1e223c3 Thanks @tim-smart! - unstable/http HttpClientRequest: add toWeb and fromWeb conversions for web Request objects

  • #1829 53740f4 Thanks @tim-smart! - Fix sql migrator lock handling to only treat duplicate migration-row inserts as a concurrent migration lock.

  • #1831 8c7cf89 Thanks @tim-smart! - Fix Schedule.fixed to run the next iteration immediately when the previous action takes longer than the configured interval.

  • #1833 b6b81a9 Thanks @tim-smart! - Fix Unify.unify so unions of Effect values collapse to a single unified Effect type again.

  • #1825 8f4c1f9 Thanks @skoshx! - Fix DevToolsClient not flushing final span events on teardown.

    The stream consumer was forkScoped, causing it to be interrupted before it could drain remaining queue items. Replaced with forkChild and Fiber.await in the finalizer so the stream drains naturally after the queue is failed.

  • #1824 f2479f9 Thanks @tim-smart! - Ignore unsupported Ctrl key combinations in interactive CLI prompts to avoid rendering control characters such as Ctrl+L form feed into prompt input.

  • #1819 c919921 Thanks @j! - HttpServerResponse: fix fromWeb to preserve Content-Type header when response has a body

    Previously, when converting a web Response to an HttpServerResponse via fromWeb, the Content-Type header was not passed to Body.stream(), causing it to default to application/octet-stream. This affected any code using HttpApp.fromWebHandler to wrap web handlers, as JSON responses would incorrectly have their Content-Type set to application/octet-stream instead of application/json.

  • #1821 7af90c2 Thanks @gcanti! - Schema: relax asserts and is constraints.

  • #1822 f3be185 Thanks @tim-smart! - improve runSync error when executing async effects

4.0.0-beta.36

Patch Changes

  • #1793 60fcbcc Thanks @tim-smart! - Ensure streamed tool results are emitted before the finish part so chat history includes tool outputs before stream termination.

  • #1762 0a60837 Thanks @kitlangton! - Allow unstable HttpApi middleware to declare multiple error schemas with arrays.

    Middleware errors now follow endpoint error behavior for response status resolution, client decoding, and generated API schemas.

  • #1805 49164d2 Thanks @tim-smart! - Fix Effect.cachedWithTTL and Effect.cachedInvalidateWithTTL to start TTL expiration when the cached value is produced instead of when computation starts.

  • #1808 334b6e4 Thanks @tim-smart! - Backport Cron.prev with reverse lookup tables and cron stepping logic, including DST-aware reverse traversal.

  • #1789 5700695 Thanks @mikearnaldi! - Fix Stream.scanEffect hanging and repeatedly emitting the initial state.

  • #1810 f8f4456 Thanks @tim-smart! - Support key-derived idleTimeToLive in LayerMap options (make, fromRecord, and LayerMap.Service) and add LayerMap tests for dynamic TTL behavior.

  • #1802 969d24f Thanks @kitlangton! - PubSub.publish and PubSub.publishAll now return false on shutdown instead of interrupting, matching Queue.offer semantics.

  • #1796 851eda0 Thanks @tim-smart! - Improve Prompt.file to support incremental filtering while typing, including backspace and ctrl-u handling.

  • #1806 8059c1c Thanks @tim-smart! - Fix a regression in PubSub.shutdown so shutting down a pubsub interrupts suspended subscribers (including takeAll) by ensuring subscriptions are scoped under the pubsub shutdown scope.

  • #1797 6f83295 Thanks @tim-smart! - Add `Ctrl-A` and `Ctrl-E` key handling for editable CLI text prompts to move the cursor to the beginning or end of the current input line.

  • #1633 65f7f57 Thanks @kitlangton! - Schema: add decodeUnknownResult / decodeResult and encodeUnknownResult / encodeResult helpers for synchronous Result-based parsing.

  • #1798 e7fabd2 Thanks @gcanti! - Schema: allow using Struct type helpers directly, e.g. Schema.Struct.Type<F> instead of Schema.Schema.Type<Schema.Struct<F>>.

  • #1794 89c3e98 Thanks @tim-smart! - Fix ai LanguageModel streaming finish parts so finish events are always emitted when a toolkit is provided.

  • #1785 53794ab Thanks @KhraksMamtsov! - add missing Equivalence.Date

4.0.0-beta.35

Patch Changes

  • #1782 9252b43 Thanks @gcanti! - Add Schema.ArrayEnsure.

  • #1784 7daf387 Thanks @gcanti! - Add Config.Success type utility, closes #1783.

  • #1778 e1664a3 Thanks @tim-smart! - Allow Effect.acquireRelease release finalizers to depend on the surrounding environment.

  • #1777 fdaa6e0 Thanks @tim-smart! - Remove an unreachable array branch in decodeJsonRpcRaw to simplify JSON-RPC decode logic without changing behavior.

  • #1774 19aa47e Thanks @tim-smart! - Align CLI help flag and global flag descriptions to a single column even when some flag names are very long.

  • #1780 c667dad Thanks @tim-smart! - Fix LanguageModel incremental prompt fallback to reliably retry with the full prompt when an incremental request fails with InvalidRequestError.

  • #1781 764d150 Thanks @gcanti! - Fix DateTime.makeUnsafe incorrectly appending “Z” to date strings containing “GMT”

  • #1772 3c27098 Thanks @tim-smart! - make Layer.mock work with Stream and Channel

4.0.0-beta.34

Patch Changes

  • #1758 f2f75ee Thanks @tim-smart! - Use a normal Map in ResponseIdTracker and clear it on divergence / reset instead of reallocating a WeakMap.

  • #1764 342fc4b Thanks @tim-smart! - Add unstable EmbeddingModel support across core and OpenAI providers.

    • Add the unstable EmbeddingModel module API surface in effect, including service, request, response, and provider types.
    • Implement the unstable EmbeddingModel runtime constructor in effect, with RequestResolver batching, embed / embedMany spans, provider error propagation, deterministic ordering, and empty-input embedMany fast-path behavior.
    • Add and align EmbeddingModel behavior tests in effect for embedding usage, batching, ordering, and error handling.
    • Add OpenAiEmbeddingModel in @effect/ai-openai, including model / make / layer constructors, config overrides, and provider output index validation with deterministic reordering.
    • Add OpenAI-compatible EmbeddingModel provider support in @effect/ai-openai-compat, including config overrides, layer constructors, and output index validation.
  • #1766 5d704ee Thanks @tim-smart! - Fix JSDoc wording for Effect.catch to consistently reference the current API name.

  • #1771 00add69 Thanks @tim-smart! - Add EmbeddingModel.ModelDimensions and require dimensions in embedding provider model constructors.

  • #1767 58217d3 Thanks @gcanti! - Add isMutableHashMap and isMutableHashSet, and align nominal guard implementations and tests across collections and transactional data types.

  • #1765 f4e2aba Thanks @tim-smart! - retry incremental prompt on invalid request

  • #1756 e3b44b6 Thanks @tim-smart! - add HttpApiMiddleware.layerSchemaErrorTransform

  • #1732 e1472b7 Thanks @KhraksMamtsov! - port Url module from v3

  • #1761 7686320 Thanks @gcanti! - Fix Tool.make type and runtime behavior when parameters is not provided.

4.0.0-beta.33

Patch Changes

  • #1754 571447d Thanks @tim-smart! - narrow types for Effect.retry/repeat while option

4.0.0-beta.32

Patch Changes

  • #1717 bf8fff8 Thanks @gcanti! - Schema: add OptionFromOptionalNullOr schema, closes #1707.

  • #1722 1af3ef3 Thanks @tim-smart! - Fix RpcSerialization.json decode so JSON array payloads are not wrapped in an extra outer array.

  • #1725 27fea0f Thanks @tim-smart! - Improve unstable HttpApi runtime failures for missing server middleware and missing group implementations.

    • HttpApiBuilder.applyMiddleware now resolves middleware services via Context.getUnsafe, so missing middleware fails with a clear “Service not found: ” error instead of an opaque is not a function TypeError.
    • HttpApiBuilder.layer now reports missing groups with actionable context (group identifier, service key, suggested HttpApiBuilder.group(…) call, and available group keys).
    • Added regression tests in packages/platform-node/test/HttpApi.test.ts covering:
      • addHttpApi + API-level middleware applied across merged groups
      • missing middleware service diagnostics
      • missing addHttpApi group layer diagnostics
  • #1727 2ad6c1b Thanks @tim-smart! - Make all built-in HttpApiError classes implement HttpServerRespondable, so they can be returned directly from plain HTTP server handlers outside of HttpApi.

  • #1739 398ac3e Thanks @tim-smart! - Use predicate-based dual dispatch for Stream.merge so data-last calls with optional options are handled correctly.

  • #1741 51fe22f Thanks @tim-smart! - Add Layer.tap, Layer.tapError, and Layer.tapCause APIs for effectful observation of layer success and failure without changing layer outputs.

  • #1740 4605db6 Thanks @tim-smart! - Refactor call sites with multiple Context mutations to use Context.mutate for batched updates.

  • #1750 f4de1b0 Thanks @gcanti! - Improve unstable AI structured output handling for empty tool params and add Tool.EmptyParams, closes #1749.

  • #1525 60214f2 Thanks @tim-smart! - use Option instead of undefined | A

  • #1747 c4b8b0f Thanks @tim-smart! - seperate scheduler dispatch from yield decisions

  • #1729 6d9393a Thanks @tim-smart! - add Context.mutate

  • #1753 6de4efe Thanks @tim-smart! - Add dtslint coverage for Stream.catchIf to lock in predicate and refinement inference behavior in both data-first and data-last forms.

  • #1716 4f969d1 Thanks @gcanti! - Remove unused effect/NullOr module.

  • #1721 6cc67c8 Thanks @IMax153! - Correct the type of the schema parameter accepted by the fileSchema methods in the CLI to be Schema.Decoder<A>

  • #1709 8531a22 Thanks @mikearnaldi! - Add module-level helpers for Semaphore, Latch, and extracted PartitionedSemaphore operations.

  • #1752 b226760 Thanks @tim-smart! - simplify SubscriptionRef

  • #1743 47a51ab Thanks @tim-smart! - default ws close codes to 1001 in case they are undefined

  • #1728 1521d02 Thanks @tim-smart! - add graceful shutdown to http servers

4.0.0-beta.31

Patch Changes

  • #1696 5a84853 Thanks @krzkaczor! - Add DurationObject to Duration.Input to support Temporal-style object input.

    Durations can now be created from objects with named unit properties like { hours: 1, minutes: 30 }, similar to Temporal.Duration.from(). Supported fields: weeks, days, hours, minutes, seconds, millis, micros, nanos.

  • #1705 6f23f0e Thanks @tim-smart! - Preserve message item ordering in the default logger when logging a Cause with message values.

  • #1711 654aaec Thanks @tim-smart! - Fix RpcGroup.toLayer and RpcGroup.toLayerHandler service requirement inference so handler dependencies are preserved for non-stream RPC handlers.

  • #1712 2958a42 Thanks @tim-smart! - Expose CLI completions as a public unstable module at effect/unstable/cli/Completions.

  • #1713 95d27a2 Thanks @tim-smart! - Make Layer.mock a dual API so it supports both Layer.mock(Service)(impl) and Layer.mock(Service, impl).

  • #1704 0fbaea8 Thanks @tim-smart! - Support toolkit unions in LanguageModel options.

  • #1701 21d5d5e Thanks @tim-smart! - wrap httpapi request context with HttpRouter.Request

  • #1696 5a84853 Thanks @krzkaczor! - allow assigning Temporal types to DateTime & Duration input

  • #1698 6e49959 Thanks @tim-smart! - Include toolkit tool handler requirements in AI generation API environment inference.

  • #1703 8f5805d Thanks @tim-smart! - Relax Ndjson byte-stream channel signatures to accept plain Uint8Array.

  • #1710 990df2c Thanks @gcanti! - Schema: toCodecJson now returns Codec<T, Json, RD, RE> instead of Codec<T, unknown, RD, RE>.

    Http: the json property on HttpIncomingMessage, HttpClientResponse, HttpServerRequest, and HttpServerResponse now returns Effect<Schema.Json, E> instead of Effect<unknown, E>.

4.0.0-beta.30

Patch Changes

  • #1675 c88e5b7 Thanks @gijsbartman! - Fix consolePretty ignoring explicit colors option in non-TTY environments.

    When colors is explicitly set to true, prettyLoggerTty was still gating it with processStdoutIsTTY check, making it impossible to enable colors in non-TTY environments like Vite dev server.

  • #1690 947d0e4 Thanks @gcanti! - Fix Cause.hasInterruptsOnly to return false for empty causes.

  • #1620 7517908 Thanks @kitlangton! - Fix TaggedUnion.match to use Unify for return types, allowing branches to return distinct Effect types that are properly merged.

  • #1680 a49ecd5 Thanks @KhraksMamtsov! - make HttpClientResponse pipeable

  • #1681 6993e33 Thanks @mikearnaldi! - Add an optional message field to Effect.ignore and Effect.ignoreCause for custom log output.

  • #1695 514f2a2 Thanks @gcanti! - Remove unused APIs from the Utils module.

  • #1644 3214b47 Thanks @patroza! - fix: update Service interface to use ‘this: void’ in ‘of’ method signatures

  • #1693 95ec5ed Thanks @tim-smart! - fix cli subcommand context

4.0.0-beta.29

Patch Changes

  • #1672 9d93adb Thanks @gcanti! - Add Newtype module.

  • #1677 b52721c Thanks @gcanti! - Fix Schema.isUUID so the version parameter is optional in its public signature.

  • #1667 a891c7b Thanks @tim-smart! - Preserve Atom.withReactivity(...) refresh behavior when registry initial values seed the wrapped atom.

  • #1678 ef26cdf Thanks @tim-smart! - Abort HTTP client requests when response streams are consumed only partially.

  • #1665 82fd3ed Thanks @tim-smart! - Remove placeholder fallback behavior from CLI prompt inputs now that default values are prefilled.

4.0.0-beta.28

Minor Changes

  • #1637 42bc7ce Thanks @tim-smart! - Add a new effect/unstable/http/HttpStaticServer module for static file serving with MIME resolution, directory index fallback, SPA fallback, and safe path resolution.

Patch Changes

  • #1659 ff533f2 Thanks @tim-smart! - Persist MCP HTTP session and protocol headers after initialize so follow-up JSON-RPC requests include MCP-Protocol-Version.

  • #1663 dc803ee Thanks @tim-smart! - Add HttpServerResponse.fromClientResponse for directly converting client responses into server responses.

  • #1657 d660b1c Thanks @tim-smart! - Add Ctrl-U line clearing support to editable CLI prompts.

  • #1645 93a05e3 Thanks @gijsbartman! - ensure transformed Atom’s don’t extend idle ttl

  • #1655 2a65cf6 Thanks @tim-smart! - Make AtomRpc.query and AtomHttpApi.query return serializable atoms by default when query results are schema-backed.

    The atom serialization key now uses each API’s built-in request schemas so dehydrated state can be keyed consistently across server and client.

  • #1662 a561a40 Thanks @tim-smart! - Add HttpServerRequest.toClientRequest for direct server-to-client request conversion.

  • #1648 29cd24d Thanks @gcanti! - Fix Types.VoidIfEmpty to correctly detect empty object types. Remove deprecated Types.MatchRecord in favor of the simplified implementation, closes #1647.

  • #1664 662a8e6 Thanks @tim-smart! - Add HttpServerRequest.fromClientRequest for direct client-request-backed server request conversion.

  • #1656 d2b52ba Thanks @tim-smart! - Persist MCP client capability context across HTTP requests by resolving initialized payloads through the standard Mcp-Session-Id HTTP header in McpServer.

    Adds a regression test that initializes an MCP HTTP client, verifies the MCP server echoes Mcp-Session-Id, and then checks a later tool call can still read McpServer.clientCapabilities.

  • #1639 407c3b4 Thanks @tim-smart! - Add Scheduler.PreventSchedulerYield and expose it via References so fibers can skip scheduler shouldYield checks when needed.

  • #1649 e741322 Thanks @tim-smart! - Set Schema.TaggedErrorClass instance name to the tag value, matching Data.TaggedError behavior.

  • #1646 5c75fa8 Thanks @tim-smart! - Simplify internal and documented request usage by passing request resolvers directly to Effect.request instead of wrapping them with Effect.succeed.

  • #1641 747177b Thanks @tim-smart! - Don’t transform Tool result schemas, as they aren’t sent to the providers as json schemas

  • #1636 326cd48 Thanks @tim-smart! - Add Cookies.expireCookie / expireCookieUnsafe and HttpServerResponse.expireCookie / expireCookieUnsafe for emitting expired cookies.

  • #1653 627e922 Thanks @tim-smart! - expose mcp client capabilities

  • #1660 662287e Thanks @tim-smart! - Add HttpServerResponse.toClientResponse for converting server responses into HttpClientResponse values.