@effect/ai-openai-compat
4.0.5 · 15 Oct 2026MIT41.4k / weekRepositoryHomepagenpmAtom feed
7 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
4.0.6
22 Oct 2026Add an optional
batchKeytoEmbeddingModel.maketo group concurrentembedcalls by provider-relevant context. OpenAI and OpenAI-compatible providers now separate batches with different configuration overrides or client transforms. Undeclared context, such as per-callFetchHttpClient.RequestInit, still uses the first caller's value.Add typed HTTP date and
Retry-Afterheader values toHeaders, and parse them consistently across the HTTP client, OTLP exporter, GraphQL client, AI clients and static server.Add non-retryable
AiError.InvalidResponseErrorfor provider response schema and SSE decoding failures, with optional HTTP context; model-generated output validation remains retryable. Update exhaustive matches onAiErrorReasonto handle the new tag, and update serialized-error consumers to accept it.
Patch Changes
Add an optional
batchKeytoEmbeddingModel.maketo group concurrentembedcalls by provider-relevant context. OpenAI and OpenAI-compatible providers now separate batches with different configuration overrides or client transforms. Undeclared context, such as per-callFetchHttpClient.RequestInit, still uses the first caller's value.Add typed HTTP date and
Retry-Afterheader values toHeaders, and parse them consistently across the HTTP client, OTLP exporter, GraphQL client, AI clients and static server.Headers.parseHttpDate/Headers.formatHttpDateread all three RFC 9110 date formats as UTC, whatever the process time zone, and emit IMF-fixdate.Headers.parseRetryAfter,Headers.formatRetryAfterandHeaders.retryAfterDelayaccept whole non-negative seconds of any size, read exactly, or an HTTP date, and the delay is never negative. HTTP dates accept the23:59:60leap second, read as the following second.Headers.RetryAfterholds either aDuration(RetryAfterDuration) or aDateTime.Utc(RetryAfterDateTime).Headers.retryAfterDurationbuilds the first from anyDuration.Input: infinite durations throw, finite negative ones become zero, and fractional seconds are rounded up when formatted.Parse failures are reported as
Headers.HeaderParseError.Schema.DateTimeUtcFromHttpDateandSchema.RetryAfterFromStringexpose the same parsing as string codecs for HTTP API headers.Invalid
Retry-Aftervalues such as-5,1.5,1e3orInfinityare now ignored everywhere.HttpClient.retryTransientandHttpClient.withRateLimiterno longer honour fractional seconds, and the AI clients no longer produce negative or infiniteretryAfterdurations.HttpStaticServerreadsIf-Modified-SinceandLast-Modifiedas UTC; asctime dates were previously shifted by the process time zone.
Add non-retryable
AiError.InvalidResponseErrorfor provider response schema and SSE decoding failures, with optional HTTP context; model-generated output validation remains retryable. Update exhaustive matches onAiErrorReasonto handle the new tag, and update serialized-error consumers to accept it.Consistently nest authentication, internal provider, and unknown error metadata under the
openaioropenai-compatprovider key, including error codes, error types, and request IDs.
4.0.5
15 Oct 2026Emit each streamed chat completion event's parts as one chunk instead of creating an inner stream per event.
Use
"openai-compat"instead of"openai"as the provider key for error metadata, prompt part options, and response part metadata, so@effect/ai-openai-compatno longer shares module augmentation keys with@effect/ai-openai.Avoid creating a child stream for each SSE event when streaming chat completions.
Patch Changes
Emit each streamed chat completion event's parts as one chunk instead of creating an inner stream per event.
Use
"openai-compat"instead of"openai"as the provider key for error metadata, prompt part options, and response part metadata, so@effect/ai-openai-compatno longer shares module augmentation keys with@effect/ai-openai.Avoid creating a child stream for each SSE event when streaming chat completions.
Avoid intermediate content allocations for single text-part user messages.
4.0.4
13 Oct 2026Add
toolCallValidation: "deferred"for callers usingdisableToolCallResolution: true. Model-generated tool calls return withunknownparameters, including invalid parameters and undeclared tool names, even without a toolkit. Supported by the Anthropic, OpenAI, and OpenAI-compatible providers. Strict validation remains the default; provider-executed calls remain validated.Replay assistant text, reasoning, and tool calls in Chat Completions requests even when their parts carry item IDs. Remove unused Responses API include bookkeeping and the unsupported
storeandconversationconfiguration options. Neither option is sent to the provider.Replay assistant reasoning alongside text and tool calls in a single chat message, preserving the provider’s reasoning field (defaulting to
reasoning_content).
Patch Changes
Add
toolCallValidation: "deferred"for callers usingdisableToolCallResolution: true. Model-generated tool calls return withunknownparameters, including invalid parameters and undeclared tool names, even without a toolkit. Supported by the Anthropic, OpenAI, and OpenAI-compatible providers. Strict validation remains the default; provider-executed calls remain validated.Replay assistant text, reasoning, and tool calls in Chat Completions requests even when their parts carry item IDs. Remove unused Responses API include bookkeeping and the unsupported
storeandconversationconfiguration options. Neither option is sent to the provider.Replay assistant reasoning alongside text and tool calls in a single chat message, preserving the provider’s reasoning field (defaulting to
reasoning_content).Convert each tool's parameter schema once per request, instead of again for every returned tool call.
4.0.3
10 Oct 2026Preserve tool call
extra_contentfrom OpenAI-compatible providers, so Gemini receives its thought signatures on follow-up tool turns. It is exposed asmetadata.openai.extraContenton tool call response parts and sent back from theopenai.extraContenttool call prompt option.Ignore empty
contentdeltas in streamed chat completions. Providers such as Ollama sendcontent: ""with every reasoning chunk, which split a single reasoning block into one part per token and opened the text part before the reasoning finished.
Patch Changes
Preserve tool call
extra_contentfrom OpenAI-compatible providers, so Gemini receives its thought signatures on follow-up tool turns. It is exposed asmetadata.openai.extraContenton tool call response parts and sent back from theopenai.extraContenttool call prompt option.Ignore empty
contentdeltas in streamed chat completions. Providers such as Ollama sendcontent: ""with every reasoning chunk, which split a single reasoning block into one part per token and opened the text part before the reasoning finished.
4.0.2
7 Oct 2026Update AI tracing to use current OpenTelemetry GenAI conventions:
Tag every module and directly importable export with an explicit
@stability.@stability stablefollows strict semver, and@stability unstablemay receive breaking changes in minor releases.
Patch Changes
Update AI tracing to use current OpenTelemetry GenAI conventions:
Replace
gen_ai.systemwithgen_ai.provider.name. Thesystemoption,BaseAttributesandWellKnownSystemare removed in favor ofprovider: { name },ProviderAttributesandWellKnownProviderName.Remove
gen_ai.token.type, which is not a span attribute in the current conventions, along with thetokenoption,TokenAttributesand theAllAttributestypes.LanguageModelspans are client spans and recordgen_ai.output.type(textorjson) for every provider. The OpenAIresponseFormattelemetry option andWellKnownResponseFormatare removed.Move OpenAI service-tier and system-fingerprint attributes from
gen_ai.openai.*toopenai.*.Rename
concurrency,toolChoiceandobjectNamespan attributes toeffect.ai.concurrency,effect.ai.tool_choiceandeffect.ai.object_name. Tool choices record the resolved value, defaulting to"auto"; object choices are JSON-encoded.Include cached tokens in Anthropic
gen_ai.usage.input_tokensand report cache reads and writes asgen_ai.usage.cache_read.input_tokensandgen_ai.usage.cache_write.input_tokens. The duplicate AnthropiccacheCreationInputTokensandcacheReadInputTokensresponse options are removed.
Tag every module and directly importable export with an explicit
@stability.@stability stablefollows strict semver, and@stability unstablemay receive breaking changes in minor releases.
4.0.1
4 Oct 2026Only updates a dependency:effect 4.0.1
4.0.0
1 Oct 2026Effect 4.0 is the first stable release of Effect v4. It replaces the 4.0.0 beta and release-candidate series, whose per-release notes remain below under the
4.0.0-beta.*and4.0.0-rc.*headings. To upgrade from Effect 3, follow the migration guide.Packaging and versioning
Core
Schema
Platform, HTTP and RPC
Cluster and Workflow
SQL
AI
CLI, Atom, observability and testing
Requirements
Patch Changes
Effect 4.0 is the first stable release of Effect v4. It replaces the 4.0.0 beta and release-candidate series, whose per-release notes remain below under the
4.0.0-beta.*and4.0.0-rc.*headings. To upgrade from Effect 3, follow the migration guide.Packaging and versioning
All Effect packages share one version number and are released together. Use the same version of
effectand every@effect/*package.@effect/platform,@effect/rpc,@effect/cluster,@effect/cli,@effect/ai,@effect/sql,@effect/workflow,@effect/experimentaland similar packages are merged intoeffect. Separate packages remain only for platforms (@effect/platform-*), SQL drivers (@effect/sql-*), AI providers (@effect/ai-*), framework bindings (@effect/atom-*), OpenTelemetry, Vitest and tooling.Modules such as
effect/http,effect/http-api,effect/rpc,effect/cluster,effect/workflow,effect/ai,effect/cli,effect/sqlandeffect/schemaimport fromeffect/<area>. APIs tagged@stability unstablemay have breaking changes in minor releases. APIs without a stability tag follow semver.APIs that expose a third-party dependency are tagged
@stability unstable, because that dependency's releases can change them. This coversNodeRedis,DenoRedis,BunRedis,@effect/platform-node/Undiciand the undici dispatcher APIs, thewsoptions and re-exports in the platform packages, driver-specific options and clients in@effect/sql-clickhouse,@effect/sql-d1,@effect/sql-libsql,@effect/sql-mssql,@effect/sql-mysql2,@effect/sql-pgliteand@effect/sql-sqlite-do, the provider clients, models and generated schemas in the@effect/ai-*packages,@effect/opentelemetry, and thevitestre-export in@effect/vitest.effecthas no runtime dependencies.New packages in v4:
@effect/platform-deno,@effect/sql-pglite,@effect/ai-openai-compat,@effect/ai-typesafe,@effect/atom-react,@effect/atom-solid,@effect/atom-vue,@effect/openapi-generatorand@effect/doctest.@effect/docgennow lives in this repository.
Core
The fiber runtime was rewritten for lower memory use and faster execution, with smaller bundles and better tree-shaking.
Services are defined with
Context.Service,FiberRefis replaced byContext.Reference,Causehas a flat structure, and many combinators were renamed. See the migration guide for the full list.Software transactional memory is built into
Effect.tx, withTxRef,TxQueue,TxHashMap,TxPubSub,TxSemaphoreand relatedTx*data types.Clockseparates wall-clock time from monotonic time.New modules include
Semaphore,Latch,LayerRef,ErrorReporter,ByteSize,NewtypeandCrypto.Arbitraryis now a native property-based testing module and no longer depends on fast-check.
Schema
Schema v4 is a new implementation with faster parsing, class-based schemas,
makeconstructors on every schema, and effectful decoding with services.SchemaRepresentationpowers JSON Schema (Draft-04, Draft-07, 2020-12 and OpenAPI 3.0/3.1) import and export, TypeScript code generation, and AI structured output.SchemaBinaryprovides a compact binary codec and is the default wire format for cluster transports.Optional JIT and AOT schema compilers are available as experimental modules.
Platform, HTTP and RPC
HttpApisupports typed response headers, streaming and SSE responses, the HTTPQUERYmethod,HttpApiTestfor in-memory testing, and much faster type checking for large APIs.The HTTP modules add static file serving, response compression, rate-limited clients and graceful server shutdown.
Sockethas a pull-based reader with backpressure and STARTTLS support. Network addresses are modeled byeffect/net.RPC serialization is schema-aware and supports server-originated requests and notifications.
@effect/platform-denoadds full Deno support. The Node, Bun, Deno and browser packages all provide the platformCryptoservice, and the browser package adds IndexedDB support.
Cluster and Workflow
Workflows can be declared with class syntax, and
DurableQueueand an in-memoryWorkflowEngineare available.Runner memory can be bounded with
ShardingConfiglimits. Shutdown, entity movement and persisted replies are more reliable.
SQL
@effect/sql-pguses a built-in PostgreSQL client with pipelining, prepared statements and binary codecs, and no longer depends onpg.@effect/sql-sqlite-nodeuses Node's built-innode:sqliteand requires Node 22.16 or newer.SqlErrorexposes structured reasons such asUniqueViolation.
AI
effect/aiaddsEmbeddingModel, theDecisionModelclassification and rating API, dynamic tools and tool approvals.The MCP server supports protocol versions 2024-11-05 through 2026-07-28, including elicitation, sampling with tools, resource subscriptions and typed tool output.
Provider packages cover Anthropic, OpenAI, OpenAI-compatible APIs and OpenRouter.
CLI, Atom, observability and testing
effect/cliadds global flags, command aliases and examples, an interactive wizard mode, and shell completions for Bash, Zsh and Fish.effect/reactivityand the@effect/atom-*bindings add SSR hydration, stale-while-revalidate atoms and serializable RPC and HttpApi queries.The OTLP exporters can be configured with standard OpenTelemetry environment variables, and
@effect/opentelemetryaligns logs and spans with the OpenTelemetry specification.@effect/vitestruns property tests with the nativeArbitrarymodule and supports Vitest fixtures.
Requirements
TypeScript 5.9 or newer. TypeScript 7 is recommended.
@effect/vitestand@effect/doctestrequire Vitest 5.@effect/atom-reactrequires React 19.@effect/platform-denorequires Deno 2.8.3 or newer.