Repository navigation
0.9.0-preview.10
Pre-releaseThe packages target netstandard2.0, net472, net10.0, and net11.0: net8.0 and net9.0
leave ahead of their end of support, and net11.0 joins on its go-live release candidate. A
project on .NET 8 or 9 still installs the packages through the netstandard2.0 asset, now with a
build warning. The pin moves to upstream release tag v2.0.29, which adds provider compatibility
defaults, request-body encoding and top-level config policies. OpenCodeServer.Exited reports how
a started server ended, and on Windows a server's exit is observed on the operating system's own
wait thread, so a busy host no longer reports a crashed start as a closed stdout. The breaking
changes come first: besides the target frameworks, OpenCodeServerOptions refuses an out-of-range
timeout when it is set, IOpenCodeClientOptions is removed,
OpenCodeStreamFailureException.Cause is now Causes, and PersistentPtyReplayBounds takes
camelCase constructor parameters.
💥 Breaking changes
- The packages target
netstandard2.0,net472,net10.0, andnet11.0.net8.0and
net9.0leave ahead of their end of support on 2026-11-10, andnet11.0joins on its go-live
release candidate.0.9.0-preview.9is the last version withnet8.0andnet9.0assets. A
net8.0ornet9.0project still installs the packages through thenetstandard2.0asset, now
with a build warning, because that runtime is not one the packages are tested on; set
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>to silence it, or move
the project tonet10.0or later. A project that treats warnings as errors fails its build on it
until it does one or the other. OpenCodeServerOptionsrefuses an out-of-range timeout when it is set.ReadinessTimeout
takes a value above zero and at mostint.MaxValuemilliseconds, or
Timeout.InfiniteTimeSpanto wait until the start's cancellation token fires;
GracefulShutdownTimeouttakes zero toint.MaxValuemilliseconds. A value outside that range
throwsArgumentOutOfRangeExceptionfrom the setter. A zero or negative readiness timeout and a
negative grace were refused byOpenCodeServer.StartAsyncbefore; a value past the ceiling was
accepted and failed only after the server had been spawned.IOpenCodeClientOptionsis removed. No public API accepted it, and every option added
later would have broken its implementers, becausenet472andnetstandard2.0have no default
interface members. Configure clients throughOpenCodeClientOptions, which a client still
snapshots at construction. Code that declared a variable or parameter as
IOpenCodeClientOptionsusesOpenCodeClientOptionsinstead.OpenCodeStreamFailureException.Causeis nowCauses. It is a list of causes, so the name
is now plural. The constructor parameter is nowcausesas well. Readfailure.Causeswhere
you readfailure.Cause, and passcauses:where you named the argument.PersistentPtyReplayBoundstakes camelCase constructor parameters. They are
requestedOffset,availableOffset,endOffsetandtruncated, like the other frame types'
constructors. The properties keep their names, and positional construction,withand
deconstruction are unchanged. Only a call that named an argument (RequestedOffset: 0) changes.
✨ Added
OpenCodeServer.Exitedreports how a started server ended. The task completes with an
OpenCodeServerExit. It holds an exit code (on Windows the full 32-bit code), a terminating
signal by name and number, orUnknownwhen the exit status could not be read, for example
because something else reaped the server. It completes whether the server ended on its own or
disposal ended it, once its output has ended or one second after the exit, as upstream's
exiteddoes. It never faults. On a handle from
DiscoverAsyncorEnsureAsyncit throwsInvalidOperationException, because that handle owns
no process.- The accepted snapshot moved to upstream release tag
v2.0.29
(042d0832f5f3a73eaa039a58a7d565776f6d4290), published as@opencode/cli@2.0.29; install it
withnpm install -g @opencode/cli@2.0.29. It adds and changes no operation, so all 142 remain
callable. - Provider compatibility defaults.
ProviderInfo.Compatibilityand
ConfigProvider.Compatibilitycarry aProviderCompatibility, the defaults a provider's models
inherit:ReasoningField,RequireReasoning,MaxTokensField,RequireFinishReason,
RequireAssistantAfterTool,SupportsPromptCacheKey, andCacheFormat. - Prompt-cache marker format.
ModelCompatibility.CacheFormatand
ProviderCompatibility.CacheFormatname the marker syntax the endpoint accepts, as the new
ModelCacheFormatenum (Anthropic,Alibaba). - Request-body encoding.
ProviderSettings.Encoding,ConfigProviderSettings.Encoding,
ModelSettings.Encoding, andConfigModelSettings.Encodingname the compression upstream applies
to the provider request body, as the newProviderEncodingenum (Zstd,Gzip,None). - Top-level config policies.
ConfigInfo.Policiescarries the ordered policies that control
access to providers, tools, and integrations, as the newConfigInfoPolicies(Action,
Resource,Effect) with the newConfigInfoPoliciesAction(ProviderUse,ToolUse,
IntegrationUse) andConfigInfoPoliciesEffect(Allow,Deny) enums. Upstream deprecates
experimental.policies: a 2.0.29 server reports those policies here, and
ConfigInfoExperimental.Policiesstaysnull.
🔧 Changes
-
The packages depend on the .NET 10.0.13 servicing builds of their dependencies.
OpenCodeDotNet.SdkrequiresSystem.Text.Json,Microsoft.Bcl.AsyncInterfaces,
Microsoft.Bcl.Memory,Microsoft.Bcl.TimeProvider,System.Collections.Immutable, and
System.Threading.Channels10.0.13 onnetstandard2.0andnet472, up from 10.0.11; its
net10.0andnet11.0assets declare no dependency.OpenCodeDotNet.Sdk.Extensionsrequires
Microsoft.Extensions.DependencyInjection.Abstractionsand
Microsoft.Extensions.Options.ConfigurationExtensions10.0.13 on every target, up from 10.0.10.
No security advisory covers the versions they replace. A project that references one of these
packages directly at a lower version must raise it, or restore reports a package downgrade
(NU1605, an error by default). -
A server that does not report readiness in time fails with the timeout as the inner
exception. TheOpenCodeServerExceptionthatOpenCodeServer.StartAsyncthrows then carries
the readiness bound'sOperationCanceledExceptionas itsInnerException, which wasnull. -
A settings
encodingmember is read as the typedEncoding. OnProviderSettings,
ConfigProviderSettings,ModelSettings, andConfigModelSettingsit is no longer in
AdditionalProperties, where0.9.0-preview.9kept it as an undeclared member. -
The source is laid out in feature folders, and the internal namespaces are flattened into
OpenCode.Sdk.Internal. The public API is unchanged, byte for byte. Only the names of internal
types differ, as a stack trace or reflection shows them.
🐛 Fixes
- On a busy Windows host, a server's exit is no longer reported late. The launcher learned of a
Windows server's exit through a callback queued to the .NET thread pool, so under load it could
arrive seconds after the server had exited. A server that exited before readiness then failed
its start as one that closed its stdout, without its exit code;OpenCodeServer.Exited
completed late; and ending a server that had already exited could still end the descendants it
left running. The exit is now observed on the operating system's own wait thread, as libuv
observes it, so each of these reads the exit as soon as the kernel reports it. OpenCodeServer.EnsureAsyncstarted through a.cmdor.batshim on Windows opens no
console window. With a batch shim such as npm'sopencode.cmdas the command, the background
service took a new console of its own, with a visible terminal window that took the focus and
stayed open for the service's life, and its startup output went to that window instead of to
the SDK. The shim now starts with a console that has no window, which the service inherits, so
its window stays hidden and its startup output reaches the SDK again. A service started from an
.exestill starts detached, with no console.- On Unix under Mono, a failed
chmodof an owner-only file fails its write. The
netstandard2.0andnet472assets set mode0600on the files discovery andEnsureAsync
write through achmodchild process after the create. That process now receives a quoted path,
and a nonzero exit removes the file and fails the create, as the modern targets' atomic
owner-only create does. Behaviour change: such a file was kept at the process umask before.
📋 Important Notes
- This release is built on the .NET 11 release-candidate SDK. A preview package may build on a
go-live release candidate (ADR-0002); the first non-preview package waits for the GA SDK. The
net11.0asset needs the .NET 11 runtime, and anet10.0app keeps using thenet10.0asset. - From
1.0.0, a minor version may move the protocol pin and change the generated surface the
way upstream changed it, each change listed under protocol changes; only a major version breaks
the hand-written design (ADR-0034).