Repository navigation
0.9.0-preview.3
Pre-releaseThe launcher is complete: OpenCodeServer.EnsureAsync joins discovery and stop, so the three
connection modes upstream's CLI offers are all in the SDK. The SDK follows upstream release tag
v2.0.15 instead of v2.0.11, which makes two wire members required — the breaking changes
come first — and adds session metadata updates. Generated models stop printing secrets, and the
background-service door reads registrations the way upstream does in every case the fixes below
list.
💥 Breaking changes
- The accepted snapshot moved to upstream release tag
v2.0.15
(6f3639d82ed0760091792189b78f8eeb44f699b1), which published as@opencode/cli@2.0.15; install
it withnpm install -g @opencode/cli@2.0.15. No operation was added, removed, or moved since
v2.0.11. The Restore patch for upstream's lost SSE payload schemas
(anomalyco/opencode#44911) is still
required at this tag and applies unchanged. ConnectionCredentialInfo.Methodis required. A stored connection credential now says how it
was obtained,ConnectionCredentialInfoMethod.KeyorConnectionCredentialInfoMethod.Oauth; a
credential from a server that omits it no longer deserializes.ProjectTime.Activeis required. It is the project's most recent activity, in the same unit
asCreatedandUpdated, and upstream now orders the project list by it; a project from a
server that omits it no longer deserializes.
✨ Added
-
Session metadata updates.
SessionUpdateRequest.Metadatareplaces a session's metadata as a
whole — keys the update leaves out are removed, not kept — and the server logs the replacement as
the durableSessionMetadataUpdatedevent (session.metadata.updated), which the event stream
and the session log deliver. -
OpenCodeServer.EnsureAsync, the managed-service election beside discovery and stop.
It reuses a ready compatible daemon, replaces a version-mismatched one according to
OpenCodeServerEnsureOptions.VersionPolicy(Ignore,Replace,Error), and otherwise
spawns detached contenders until one registers or the 120-second wall-clock bound expires.
The persistent-terminal handoff sidecar travels with replacement, andOnStartfires at
most once before a new service process is spawned.
🔒 Security
- Generated models no longer print secrets. A model's
ToString()— string interpolation,
logging templates, the debugger — printed every member, so logging anMcpOAuthConfig, or the
McpRemoteConfigholding it, wrote itsClientSecret. Members upstream's own recorder redacts
(client_secret,password,api_key,token, …) now print[REDACTED], as do
IntegrationConnectKeyRequest.Keyand the user-configured header and environment maps; an
absent secret prints empty, and every other member prints as before. Equality and JSON are
unchanged.
🐛 Fixes
- Discovery reaches a background service bound to every interface. A daemon started with
hostname: 0.0.0.0(or::) registers that address, which .NET refuses as a connect target, so
DiscoverAsyncreturned null andStopAsynccould not ask it to shut its terminals down while
the CLI worked. The connect target is now the same family's loopback, as Bun's is; the
registered URL still identifies the daemon. - A registration file that is not valid UTF-8 reads as absent.
DiscoverAsyncand
StopAsyncthrewInvalidOperationExceptionfor a registration holding an invalid UTF-8
string, outside their documented failures; such a file is now no registration, like any other
undecodable one. A byte-order mark at the start of a registration or service-config file is
skipped, as the CLI skips it. - A whitespace password is sent as written.
OpenCodeClientOptions.Passwordrefused an empty
or whitespace value at client construction, and a background-service registration carrying a
whitespace password read as passwordless, so discovery skipped a daemon the CLI reached. The
CLI's server runs with any configured password, whitespace included; only a null password now
means "no credential", as in the pinned client. - Reading a registration no longer blocks its removal on Windows. A service that exits removes
its registration while clients may be reading it; the SDK now opens the file with delete sharing,
as libuv does, so the removal never fails on the SDK's account. OpenCodeServer.StopAsynctreats a zombie as stopped on Linux. A service process that had
exited but was not yet reaped by its parent kept its start time readable, so the stop read it
as still running, sent the kill rung, and failed with "still running after the kill rung",
leaving the registration behind. The identity read now checks the process state and treats a
zombie as gone, the way macOS already did.- Structural union values print themselves.
ToString()onFormValue,FormWhenValue,
McpRemoteConfigOauth, andProviderSettingsTimeoutthrewInvalidOperationException
("The structural value does not contain the requested arm."): a record's compiler-synthesized
PrintMembersread every arm, and an inactive arm throws by design. Each union now prints its
kind and its active arm only —ProviderSettingsTimeout { Kind = Number, Number = 30000 },
FormValue { Kind = TextList, TextList = [a, b] }— with numbers in the invariant culture and an
Unknownarm as its raw JSON. String interpolation, logging templates, and the debugger were
the paths that hit this; equality and JSON were never affected.