Skip to content

0.9.0-preview.2

Pre-release
Pre-release

Choose a tag to compare

@Blind-Striker Blind-Striker released this 21 Sep 06:15

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 with npm 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.Settings is a
    ProviderSettings (Timeout, ChunkTimeout, Compaction, Transport) and ModelInfo.Settings
    and ModelVariant.Settings are a ModelSettings (Compaction) instead of
    IReadOnlyDictionary<string, JsonElement>; ProviderRequestOptions.Settings is the same
    ProviderSettings. Every other member the server puts in settings — baseURL, apiKey,
    region, and whatever a provider adds — is in AdditionalProperties, 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 the ValueKind you expect.
    Compaction and Transport are removed from ModelInfo and ProviderInfo themselves: upstream
    moved them under settings. Timeout is a ProviderSettingsTimeout structural union
    (Number, Boolean for the wire's false, Unknown).
  • The compaction union changed its arms and marker. IProviderCompaction now dispatches on
    type with ProviderCompactionSummary (summary) and ProviderCompactionNative (native);
    ProviderCompactionLocal, ProviderCompactionProvider, its Threshold, and the mode marker 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 of create, get, list, remove, rename, timeout, or
    update; a GET without one is a read and names Get<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…, or Delete…. Three consequences reach your code:
    • Every Post…/Put…/Patch…/Delete… method is renamed. On SessionClient:
      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. On IntegrationClient:
      PostConnectKeyAsync → ConnectWithKeyAsync, PostOauthConnectAsync →
      BeginOauthConnectionAsync, PostOauthCompleteAsync → CompleteOauthConnectionAsync,
      DeleteOauthCancelAsync → CancelOauthConnectionAsync, PostCommandConnectAsync →
      BeginCommandConnectionAsync, DeleteCommandCancelAsync → CancelCommandConnectionAsync.
      On ExperimentalClient: PostSessionImportAsync → ImportSessionAsync,
      PostSessionSkillAsync → ActivateSessionSkillAsync, PostSessionWaitAsync →
      WaitForSessionAsync, PutSessionInstructionsEntryAsync →
      SetSessionInstructionsEntryAsync. On PtyClient: 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, and PersistentPtyClient.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, …DeleteRequest and the matching
      …Response / …Data type 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
      body session.interrupt answers with was upstream's SessionInterruptResponse and is now
      SessionInterruptOutcome, so that the operation's own response record can carry
      SessionInterruptResponse (response.Interrupt.Interrupted reads as before); and the three
      update responses whose payload was mislabelled Update now name their subject —
      PtyUpdateResponse.Pty, PersistentPtyUpdateResponse.PersistentPty,
      ProjectUpdateResponse.Project. The route builders in OpenCodeRoutes follow their methods
      (Sessions.PostPrompt(id) → Sessions.Prompt(id), Sessions.GetSession(id) →
      Sessions.Get(id), …Template constants alike).
  • McpProtocol.Value20260728 is McpProtocol.Revision20260728. The wire value 2026-07-28
    is unchanged; a reviewed enum member-name row names the member.

✨ Added

  • OpenCodeServer.StopAsync stops the registered background service — opencode's
    service stop for your code, shaped by OpenCodeServerStopOptions (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, then SIGKILL;
    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
    OpenCodeServerException and 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_PROXY without NO_PROXY no longer hides a running
    service. Nothing changes for the SDK's other calls.