refactor: carry local runtime metadata through startup

This commit is contained in:
LukeParkerDev 2026-04-16 14:46:48 +10:00
parent 710469cf09
commit 482dc3a15d
3 changed files with 13 additions and 2 deletions

View file

@ -153,10 +153,12 @@ async function initialize() {
throw error
})
server = listener
const runtime = localServer.getState().runtime
serverReady.resolve({
url,
username: "opencode",
password,
local: runtime,
})
const loadingTask = (async () => {

View file

@ -4,6 +4,11 @@ export type ServerReadyData = {
url: string
username: string | null
password: string | null
local: {
key: string
mode: LocalServerMode
distro: string | null
}
}
export type SqliteMigrationProgress = { type: "InProgress"; value: number } | { type: "Done" }

View file

@ -291,7 +291,9 @@ render(() => {
const server: ServerConnection.Sidecar = {
displayName: "Local Server",
type: "sidecar",
variant: "base",
...(data.local.mode === "wsl" && data.local.distro
? { variant: "wsl", distro: data.local.distro }
: { variant: "base" }),
http: {
url: data.url,
username: data.username ?? undefined,
@ -341,7 +343,9 @@ render(() => {
{(_) => {
return (
<AppInterface
defaultServer={defaultServer.latest ?? ServerConnection.Key.make("local:windows")}
defaultServer={
defaultServer.latest ?? ServerConnection.Key.make(sidecar.latest?.local.key ?? "local:windows")
}
servers={servers()}
router={MemoryRouter}
>