Effect 4.0.1 is a patch release with fixes across core, cluster, RPC, HTTP, and MCP modules.
AI/language-model: Anthropic system instructions are fully preserved, mid-conversation system messages are supported, and LanguageModel.supportsSystemMessagesInHistory allows querying support with scoped overrides; per-tool response schemas are now cached to reduce schema construction in generateText/streamText.
Caching/concurrency: interruption in Effect.cached*, Cache, ScopedCache, RcRef, RcMap is treated as abandonment — concurrent callers share one computation interrupted only when all are interrupted, interrupted results are never cached; cachedInvalidateWithTTL types now accept Exit-based TTL callbacks; ScopedCache sets expiry before waking waiters; Pool TTL only expires idle unreserved items.
Cluster: entity registration is blocked on shard-ownership loss, workflow replay avoids duplicate dispatches, PostgreSQL deadlocks between message claims and shard resets are fixed via row-lock ordering, and shard lock refresh/singleton reassignment no longer cancel or release in-flight work.
Core/runtime: fibers preserve AsyncLocalStorage context across wakes/interruptions, pending interruptions survive uninterruptible failure, Stream.scan emits initial state on empty streams, Stream.throttle "shape" avoids rate drift using monotonic time, and schedules pause during idle aggregation.
Other fixes: HashRing shard assignment is deterministic (ordered weight summing, tie-break by node key, with note that fractional-weight/tie assignments may change), HttpStaticServer honors If-Range, B3/W3C trace context decoding fixed, HttpApiSchemaError no longer reported as server failure, JSON Schema pattern importing handles canonicalized RegExp, and MCP fixes cover optional field encoding, stateful capability preservation, and SSE keepalives on Cloudflare Workers.