Repository navigation
0.9.0-preview.2
Pre-release
Pre-release
Three things changed since 0.9.0-preview.1. The SDK follows upstream release tag v2.0.11
instead of v2.0.8, which reshapes the provider and model catalog entries. Public names no
longer carry the HTTP method, so a wave of methods and types is renamed; the breaking changes
come first, each with what to change. And OpenCodeServer gained StopAsync, the stop door
beside discovery.
💥 Breaking changes
- The accepted snapshot moved to upstream release tag
v2.0.11
(9eb6902aaf3c35ce985b67c605a775992249066b), which published as@opencode/cli@2.0.11; install
it withnpm install -g @opencode/cli@2.0.11. No operation was added, removed, or moved since
v2.0.8; the change is in the provider and model catalog entries. The Restore patch for
upstream's lost SSE payload schemas
(anomalyco/opencode#44911) is still
required at this tag and applies unchanged. - Provider and model settings are typed open objects.
ProviderInfo.Settingsis a
ProviderSettings(Timeout,ChunkTimeout,Compaction,Transport) andModelInfo.Settings
andModelVariant.Settingsare aModelSettings(Compaction) instead of
IReadOnlyDictionary<string, JsonElement>;ProviderRequestOptions.Settingsis the same
ProviderSettings. Every other member the server puts insettings—baseURL,apiKey,
region, and whatever a provider adds — is inAdditionalProperties, an
IReadOnlyDictionary<string, JsonElement>keyed by wire name that is empty, never null, when
the body carried none; read it the way upstream does, by checking theValueKindyou expect.
CompactionandTransportare removed fromModelInfoandProviderInfothemselves: upstream
moved them undersettings.Timeoutis aProviderSettingsTimeoutstructural union
(Number,Booleanfor the wire'sfalse,Unknown). - The compaction union changed its arms and marker.
IProviderCompactionnow dispatches on
typewithProviderCompactionSummary(summary) andProviderCompactionNative(native);
ProviderCompactionLocal,ProviderCompactionProvider, itsThreshold, and themodemarker are
gone with upstream's schema. - The HTTP method is no longer part of any name. An operation's verb is its closing identifier
segment when that segment is one ofcreate,get,list,remove,rename,timeout, or
update; aGETwithout one is a read and namesGet<Subject>Async; every other operation is
named by a reviewed, reason-bearing curation row, and the generator refuses to fall back to
Post…,Put…,Patch…, orDelete…. Three consequences reach your code:- Every
Post…/Put…/Patch…/Delete…method is renamed. OnSessionClient:
PostPromptAsync→PromptAsync,PostGenerateAsync→GenerateTextAsync,
PostCommandAsync→RunCommandAsync,PostShellAsync→RunShellCommandAsync,
PostCompactAsync→CompactAsync,PostForkAsync→ForkAsync,PostMoveAsync→
MoveAsync,PostInterruptAsync→InterruptAsync,PostBackgroundAsync→
MoveToolsToBackgroundAsync,PostViewAsync→MarkViewedAsync,PostSyntheticAsync→
AddSyntheticMessageAsync,PostSwitchAgentAsync→SwitchAgentAsync,
PostSwitchModelAsync→SwitchModelAsync,PutEnvironmentAsync→SetEnvironmentAsync,
PostFormReplyAsync→ReplyToFormAsync,DeleteFormCancelAsync→CancelFormAsync,
PostPermissionReplyAsync→ReplyToPermissionAsync,DeleteInboxCancelAsync→
CancelInboxAsync,PostRevertStageAsync→StageRevertAsync,PostRevertCommitAsync→
CommitRevertAsync,DeleteRevertClearAsync→ClearRevertAsync. OnIntegrationClient:
PostConnectKeyAsync→ConnectWithKeyAsync,PostOauthConnectAsync→
BeginOauthConnectionAsync,PostOauthCompleteAsync→CompleteOauthConnectionAsync,
DeleteOauthCancelAsync→CancelOauthConnectionAsync,PostCommandConnectAsync→
BeginCommandConnectionAsync,DeleteCommandCancelAsync→CancelCommandConnectionAsync.
OnExperimentalClient:PostSessionImportAsync→ImportSessionAsync,
PostSessionSkillAsync→ActivateSessionSkillAsync,PostSessionWaitAsync→
WaitForSessionAsync,PutSessionInstructionsEntryAsync→
SetSessionInstructionsEntryAsync. OnPtyClient:PutUpdateAsync→UpdateAsync. - A handle names itself, not its family. A handle client's own read, update, and remove
drop the family word:SessionClient.GetSessionAsync/UpdateSessionAsync/
RemoveSessionAsync→GetAsync/UpdateAsync/RemoveAsync; likewise
ShellClient.GetShellAsync/RemoveShellAsync,IntegrationClient.GetIntegrationAsync,
PtyClient.GetPtyAsync/RemovePtyAsync, andPersistentPtyClient.GetPersistentPtyAsync/
UpdatePersistentPtyAsync/RemovePersistentPtyAsync. Collection clients are unchanged
(Sessions.ListSessionsAsync,Sessions.CreateSessionAsync). - Request, response, and payload types drop the verb the same way. Every
…PostRequest,…PutRequest,…PatchRequest,…DeleteRequestand the matching
…Response/…Datatype loses the method word:SessionPromptPostRequest→
SessionPromptRequest,SessionPromptPostResponse→SessionPromptResponse,
SessionUpdatePatchRequest→SessionUpdateRequest,PtyUpdatePutResponse→
PtyUpdateResponse,LocationReloadPostResponse→LocationReloadResponse,
PluginCheckPostRequest→PluginCheckRequest,SessionGeneratePostData→
SessionGenerateData, and so on for all 104 such types; grammar verbs keep their word
(SessionListResponse,SessionRemoveResponse). Two names needed more than the rule: the
bodysession.interruptanswers with was upstream'sSessionInterruptResponseand is now
SessionInterruptOutcome, so that the operation's own response record can carry
SessionInterruptResponse(response.Interrupt.Interruptedreads as before); and the three
update responses whose payload was mislabelledUpdatenow name their subject —
PtyUpdateResponse.Pty,PersistentPtyUpdateResponse.PersistentPty,
ProjectUpdateResponse.Project. The route builders inOpenCodeRoutesfollow their methods
(Sessions.PostPrompt(id)→Sessions.Prompt(id),Sessions.GetSession(id)→
Sessions.Get(id),…Templateconstants alike).
- Every
McpProtocol.Value20260728isMcpProtocol.Revision20260728. The wire value2026-07-28
is unchanged; a reviewed enum member-name row names the member.
✨ Added
OpenCodeServer.StopAsyncstops the registered background service — opencode's
service stopfor your code, shaped byOpenCodeServerStopOptions(Channel,
RegistrationFilePath,InstalledVersion). It resolves the registration the way discovery does,
asks a ready daemon to shut its persistent terminals down, clears the handoff sidecar, ends the
registered process with the CLI's own ladder (SIGTERM, about five seconds, thenSIGKILL;
hard kills on Windows), and removes the registration once the process is gone. The registration
is re-read before every signal and the process is identified by pid and start time, so a service
that re-registered under the file or a pid the operating system reused is never signalled. A
missing registration completes successfully; a process still running after the hard kill throws
OpenCodeServerExceptionand leaves the registration in place. Disposing a discovered handle
still stops nothing.
🔧 Changes
- Discovery answers a stale registration at once on Windows.
OpenCodeServer.DiscoverAsync
probes the registered loopback address without SYN retransmission, so a registration whose
daemon is gone returns null in milliseconds instead of waiting out the two-second bound, and a
refused port is classified as "no service" rather than a timeout on every operating system and
target framework — the classification the Ensure door will rely on. The probe also never routes
a loopback request through a proxy:HTTP_PROXYwithoutNO_PROXYno longer hides a running
service. Nothing changes for the SDK's other calls.