effect@4.0.0-beta.104
Pre-releaseMinor Changes
- #7076
0f721d4Thanks @tim-smart! - Return the new file offset as aSizefromFile.seek.
Patch Changes
-
#6934
1001bccThanks @tim-smart! - httpapi: add typed response headers across handlers, generated clients (includingHttpApiTest), streaming responses, and OpenAPI withHttpApiSchema.WithHeaders. AddHttpApiSchema.encodeToWithHeadersfor folding response headers into domain types such as error classes. Explicitcontent-typeandcontent-lengthvalues applied withHttpServerResponse.setHeaderorsetHeadersnow override body-derived values. -
#7044
993ba60Thanks @fubhy! - Commit SQL event journal entries only after their write callback succeeds. -
#6957
67faacdThanks @fubhy! - Select Bash completions for the active positional argument. -
#6941
b78acdfThanks @fubhy! - Generate even and odd safe integers in Crypto random APIs. -
#6965
fbb9ce5Thanks @fubhy! - Correct the runtime tag spelling forCliError.UnknownSubcommand. -
#6963
722ea48Thanks @fubhy! - Exclude disabled choices from multi-select prompt selection and submission. -
#7001
3058fd5Thanks @fubhy! - Keep ordered SQL resolver results aligned when batched request encoding fails. -
#6937
62d0575Thanks @fubhy! - Fix the encoded output type ofTestSchema.Encoding.encodeUnknownEffect. -
#7014
99dd6b5Thanks @tim-smart! - Add lightweight INI, YAML, and TOML parsers undereffect/unstable/encodingand remove their runtime dependencies. -
#7053
7963ce1Thanks @fubhy! - Fix arbitrary generation for tuples with multiple optional elements. -
#7047
af14e75Thanks @fubhy! - FixTuple.pickreturn types to preserve the requested index order and duplicate indices. -
#7066
24e22d2Thanks @fubhy! - CloseResourceMapacquisition scopes when a lookup fails. -
#7036
647d14eThanks @fubhy! - Fix scoped reentrant lock finalizers releasing under the wrong fiber owner. -
#6983
1434eecThanks @fubhy! - Apply byte range and chunk size options to default Web file responses. -
#7071
a5278b1Thanks @fubhy! - Fix MCP sampling metadata optionality and validate it as an object. -
#6946
6af04a5Thanks @fubhy! - Defer memoized Layer state installation until Effect execution. -
#6943
cb6c837Thanks @fubhy! - Reject zero execution attempts inExecutionPlansteps. -
#7026
d44ceadThanks @tim-smart! - Add execution-plan lifecycle events via an optionalonEventhandler onEffect.withExecutionPlanandStream.withExecutionPlan.The handler receives an
ExecutionPlan.Event, a tagged union ofAttemptStart,AttemptSuccess, andAttemptFailure, allowing attempt outcomes to be observed from outside the effect for logging and metrics:import { Effect } from "effect" Effect.withExecutionPlan(program, plan, { onEvent: (event) => Effect.log("execution plan event", event) })
Every
AttemptStartis followed by exactly one terminal event.AttemptFailurecarries the full failureCause, so defects and interruption are reported as well as expected errors, and terminal events run like finalizers so they are emitted even when the attempt is interrupted. Event numbering matchesExecutionPlan.CurrentMetadata:attemptis cumulative across steps, whilestepAttemptis 1-based within the current step. -
#7077
88c7632Thanks @tim-smart! - RenameSchedule.andThenandSchedule.andThenResulttoSchedule.concatandSchedule.concatResult. -
#6975
abcbb2aThanks @fubhy! - Encode SSE events with empty data as dispatchable events. -
#7037
8f63cceThanks @fubhy! - Preserve OTLP metric delta checkpoints when an export fails. -
#7057
d56dfcfThanks @fubhy! - Fix the error type exposed by the curriedSink.catchoverload. -
#6947
a98cda9Thanks @fubhy! - Check symbol-keyed properties in Match object patterns. -
#6956
6704bb8Thanks @fubhy! - Emit valid CSI sequences from the unstable CLIcursorTohelper. -
#7008
6143de2Thanks @tim-smart! - Prevent Bash completions from treating flag values as subcommands. -
#7032
936b135Thanks @marbemac! - Fix a@effect/clustershutdown deadlock on single-runner topologies (e.g. single-node deployments andTestRunner), whereSharding.sendOutgoingretriedEntityNotAssignedToRunnerforever during teardown. -
#6940
1bbae84Thanks @fubhy! - Omit services removed byContext.addOrOmitfrom the returned context type. -
#7065
d795ee7Thanks @tim-smart! - Fix DevTools span requests to preserve their state when queued for sending. -
#7016
0a82d88Thanks @brandon-julio-t! - Normalize cluster durable clock wake-up timestamps to whole milliseconds. -
#6945
9215bc5Thanks @fubhy! - Preserve integral precision when parsing decimal nano and micro duration inputs -
#7050
a1b5df2Thanks @fubhy! - Include schedule errors in the error channel ofEffect.scheduleandEffect.scheduleFrom. -
#7062
92a9ac5Thanks @fubhy! - Fix the inspectable JSON identity ofFiberSet. -
#6959
6bde7f2Thanks @fubhy! - Match Fish completions against the full nested command path. -
#6951
a712131Thanks @fubhy! - Use the supplied hash forHashMap.modifyHashinsertions, updates, and removals. -
#6989
2e6f760Thanks @fubhy! - Support standardBodyInitvalues when reading converted client request bodies throughHttpServerRequest. -
#6986
aa05804Thanks @fubhy! - Synchronize HTTP server response content headers when replacing the body. -
#6944
badd3bfThanks @fubhy! - MakeIterable.flattenstack safe across empty iterables. -
#6968
02b0265Thanks @fubhy! - Allow MCP tool calls to omit optional arguments. -
#7033
3437e21Thanks @fubhy! - Fix memory journal conflict detection skipping the first newer entry. -
#7034
41a550dThanks @fubhy! - Return the first unused remote sequence from the in-memory event journal. -
#7042
17b5d50Thanks @fubhy! - Relay entries imported into an in-memory event journal to other remotes. -
#7074
96e5e95Thanks @fubhy! - Preserve and update runner health in the in-memory cluster runner storage. -
#7038
e4d589eThanks @fubhy! - Clear in-memory message primary-key indexes when clearing an entity address. -
#7005
ae4cf7bThanks @fubhy! - Generate valid MSSQL upserts for multi-table persistence. -
#6998
6ef5f1aThanks @fubhy! - Decode split UTF-8 sequences correctly in NDJSON streams. -
#6972
2235a29Thanks @tim-smart! - Persist a serializable defect when a cluster reply cannot be encoded, preventing persisted entity callers from hanging. -
#6962
b32f4cbThanks @fubhy! - Support empty records and non-array iterables inPrompt.all. -
#7023
7f4c095Thanks @tim-smart! - RenameRateLimiter.makeSleeptoRateLimiter.sleepand support self-first partially applied and uncurried usage. -
#7041
5f3fb81Thanks @fubhy! - End runner streams after emitting their terminal replies. -
#7020
17f0b91Thanks @gcanti! - FixSchema.maketo preserve existing nestedSchema.Classinstances, including in array fields, while recursively constructing plain class inputs provided at runtime inside unions. Constructor defaults remain scoped to structural field and element occurrences, withSchemaAST.Context.constructorDefaultrepresenting the single default link for each occurrence.Optimize
Function.memoizeto use a singleWeakMaplookup for cached values. Its callback no longer acceptsundefinedas a return type becauseundefinedrepresents a cache miss.The performance of the two array paths can be reproduced by saving the following program as
scratchpad/schema-make-6890-benchmark.tsand runningnode scratchpad/schema-make-6890-benchmark.tsfrom the repository
root:import { Schema } from "effect" import { performance } from "node:perf_hooks" class Row extends Schema.Class<Row>("Row")({ value: Schema.String }) {} class DirectTable extends Schema.Class<DirectTable>("DirectTable")({ rows: Schema.Array(Row) }) {} class UnionTable extends Schema.Class<UnionTable>("UnionTable")({ rows: Schema.Array(Schema.Union([Row])) }) {} const rows = Array.from({ length: 30_000 }, (_, value) => Row.make({ value: String(value) })) function benchmark(label: string, make: () => { readonly rows: ReadonlyArray<Row> }) { const samples: Array<number> = [] for (let i = 0; i < 6; i++) { const start = performance.now() const result = make() samples.push(performance.now() - start) if (result.rows[0] !== rows[0] || result.rows.at(-1) !== rows.at(-1)) { throw new Error(`${label} did not preserve Row identity`) } } console.log(`${label}: ${samples.slice(1).map((n) => n.toFixed(3)).join(", ")} ms`) } benchmark("Array(Class)", () => DirectTable.make({ rows })) benchmark("Array(Union([Class]))", () => UnionTable.make({ rows }))
Representative local results on Node 24.12.0 (six runs, with the first discarded):
Array(Class): 0.639, 0.498, 0.447, 0.448, 0.451 ms Array(Union([Class])): 3.141, 2.195, 2.126, 2.108, 2.057 ms -
#7055
0cdadd7Thanks @fubhy! - FixStream.slidingSizeto produce the same windows regardless of upstream chunk boundaries. -
#6978
39b57d7Thanks @fubhy! - Retain the last SSE event ID across dispatched events. -
#6976
5a6a573Thanks @fubhy! - Recognize and ignore a leading UTF-8 byte order mark in server-sent event streams. -
#7048
59f5e99Thanks @fubhy! - Ignore malformed retry directives when parsing server-sent event streams. -
#7028
45379d6Thanks @fubhy! - FixTrie.insertto replace existing values without mutating the original trie or increasing its size. -
#6973
1949439Thanks @fubhy! - Separate the defaultVariantSchemacache from named variant entries. -
#7072
e443403Thanks @fubhy! - Keep MCP tool calls that return void successful. -
#7000
03af7e8Thanks @fubhy! - Close suspended workflow scopes after resumed completion. -
#7027
130b28dThanks @pawelblaszczyk5! - Prevent Effect.updateService and Effect.updateServiceScoped supertype widening -
#6948
c987a12Thanks @fubhy! - Honor numeric zero time-to-live values inCache.makeandScopedCache.make. -
#6974
4158562Thanks @fubhy! - Handle accepted undefined fields during variant extraction. -
#7013
306014aThanks @tim-smart! - Fix several edge cases in the vendored FindMyWay router. -
#6949
729a663Thanks @fubhy! - Keep TestClock nanosecond access total after infinite adjustments. -
#6997
caf84b6Thanks @fubhy! - Isolate compiled SQL fragment caches by compiler instance. -
#6960
ce067f7Thanks @fubhy! - Mark omittable CLI flags and arguments as optional in structured help. -
#7025
7a41f5aThanks @pawelblaszczyk5! - Prevent Effect.provideServiceEffect supertype widening -
#7056
781022aThanks @fubhy! - Fix Map and Set equality allowing a right-side entry to match multiple left-side entries. -
#7063
39f1297Thanks @fubhy! - Preserve literal element types inTuple.make. -
#6955
2db266bThanks @fubhy! - Include plain variant structs in the default variant union. -
#6954
2141e28Thanks @fubhy! - Preserve CRLF state across SSE input chunk boundaries. -
#6950
3c5e429Thanks @fubhy! - Preserve nanosecond precision for largeTestClockwall-clock timestamps. -
#6958
20ddc63Thanks @fubhy! - Preserve hidden command metadata when adding subcommands or shared flags. -
#6939
841b3eaThanks @fubhy! - Preserve sibling provider input evidence whenConfig.allevaluates a failing child. -
#6836
82a3fbfThanks @mkdynamic! - Route provider-executed tool results into the assistant message inPrompt.fromResponseParts -
#7003
eb9ee83Thanks @fubhy! - Persist permanent entries in KVSsetManyoperations. -
#7039
64dc7c7Thanks @fubhy! - Fix failedResourceRefrebuilds permanently blocking waiters. -
#6971
84dc8abThanks @tim-smart! - Serialize concurrent nested SQL transactions to prevent savepoint collisions. Cross-dependent sibling nested
transactions now deadlock instead of interleaving and risking silent data corruption. -
#6952
b4463f4Thanks @fubhy! - Register alternate flags used byParam.orElseandParam.orElseResult. -
#6732
592dd36Thanks @tim-smart! - Rename the Schema error constructors to align with theirDatacounterparts.Schema.ErrorClassis nowSchema.Error.Schema.TaggedErrorClassis nowSchema.TaggedError.- The JavaScript
Errorinstance schema is nowSchema.ErrorInstance. Schema.ErrorReviveris nowSchema.ErrorInstanceReviver.
-
#7068
85d2b44Thanks @tim-smart! - Report retried RPC socket open failures through theonTransientErrorprotocol hook and fail in-flight requests when the retry policy is exhausted. -
#7006
32e4a69Thanks @fubhy! - Scope custom persisted queue ID deduplication to each named queue. -
#6938
13c5872Thanks @fubhy! - Honor populated variables before dotenv expansion defaults inConfigProvider. -
#7040
3454cdbThanks @fubhy! - FixSynchronizedRef.getAndUpdateSometo update its backing ref. -
#7018
e930804Thanks @tim-smart! - Hold persisted cluster messages while entity layers are still registering, while retaining a bounded failure when
registration never begins. -
#6987
7f12d4bThanks @fubhy! - Map WebSocket send exceptions and transform stream write rejections to typedSocketErrorfailures. -
#6977
181c9efThanks @fubhy! - Default empty Server-Sent Event types tomessage. -
#7010
dd9f891Thanks @tim-smart! - RenameCommand.withHiddentoCommand.unlisted, along with thehiddencommand property which is nowunlisted. -
#7054
433fb81Thanks @fubhy! - Fix the return type ofChannel.runCountto expose its numeric result. -
#7012
8459cdbThanks @tim-smart! - Vendor the multipart parser aseffect/unstable/http/MultipartParser, add the Node.js adapter at@effect/platform-node/NodeMultipartParser, and remove the externalmultipastadependency. -
#6953
6124ab3Thanks @fubhy! - Reject truncated MessagePack frames at the end of a stream. -
#6961
01bd954Thanks @fubhy! - Preserve file and directory semantics in CLI completion descriptors. -
#6990
ba2c3aaThanks @fubhy! - Generate unique persisted paths for multipart files with duplicate filenames. -
#7019
0a45ef3Thanks @tim-smart! - Round Redis persistence TTLs up to whole milliseconds before passing them to integer-only expiration commands. -
#7012
8459cdbThanks @tim-smart! - Prevent malformed encoded multipart filenames from throwing during parsing. -
#7029
eaa7e71Thanks @fubhy! - Fix unencrypted event log conflict scanning to inspect the newer history suffix. -
#6988
db4c2ccThanks @fubhy! - Preserve lexical ordering in streaming template interpolation. -
#6964
22f150aThanks @fubhy! - Correct year, ordinal, and meridiem date-mask formatting. -
#6966
90ffb08Thanks @fubhy! - Preserve fractional leading zeros while editing float prompts. -
#6982
d517692Thanks @fubhy! - Reject NDJSON values without a JSON representation. -
#6942
01af079Thanks @fubhy! - Validate object-based DateTime instants before construction. -
#6985
32a59e8Thanks @fubhy! - Preserve original HTTP response bytes when reading response text first.