From dbe08ddc3c405168c679a3dac0029ef64787b7af Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Tue, 20 Oct 2026 21:09:41 -0500 Subject: [PATCH] fix(tui): only show location unavailable when the server reports it missing (#57594) --- packages/tui/src/context/location.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/tui/src/context/location.tsx b/packages/tui/src/context/location.tsx index 8c668757e75..84fd6ae87b5 100644 --- a/packages/tui/src/context/location.tsx +++ b/packages/tui/src/context/location.tsx @@ -1,4 +1,5 @@ -import type { LocationGetOutput, LocationRef } from "@opencode/client" +import { isLocationNotFoundError, type LocationGetOutput, type LocationRef } from "@opencode/client" +import { retry } from "@opencode/util/retry" import { createContext, createMemo, createSignal, onCleanup, useContext, type ParentProps } from "solid-js" import { useClient } from "./client" import { useData } from "./data" @@ -28,9 +29,14 @@ export function LocationProvider(props: ParentProps) { ? undefined : location setError(undefined) - void data.location.sync(target).catch((cause) => { + // Only the server's typed LocationNotFoundError proves the folder is gone. Other failures, such as + // plugins still activating after a restart, are retried and never block the composer. + void retry(() => (generation === attempt ? data.location.sync(target) : Promise.resolve()), { + retryIf: (cause) => generation === attempt && !isLocationNotFoundError(cause), + }).catch((cause) => { const current = ref() if ( + !isLocationNotFoundError(cause) || generation !== attempt || current?.directory !== location.directory || current.workspaceID !== location.workspaceID