From 4ae6fd7017c82376691e18c51a09d1698e80bdbe Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:04:46 +1000 Subject: [PATCH] fix(app): avoid suspending on pending child path --- packages/app/src/context/global-sync/child-store.test.ts | 1 + packages/app/src/context/global-sync/child-store.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app/src/context/global-sync/child-store.test.ts b/packages/app/src/context/global-sync/child-store.test.ts index 88634b87786c..c0ad67cc2491 100644 --- a/packages/app/src/context/global-sync/child-store.test.ts +++ b/packages/app/src/context/global-sync/child-store.test.ts @@ -56,6 +56,7 @@ beforeAll(async () => { return options().queryKey?.[1] === "path" }, get data() { + if (options().queryKey?.[1] === "path") throw new Error("pending path data read") if (options().queryKey?.[1] === "mcp") return options().enabled ? { demo: { status: "disabled" } } : undefined if (options().queryKey?.[1] === "lsp") return [] if (options().queryKey?.[1] === "providers") return provider diff --git a/packages/app/src/context/global-sync/child-store.ts b/packages/app/src/context/global-sync/child-store.ts index ab5c0dc017f9..22bd26271529 100644 --- a/packages/app/src/context/global-sync/child-store.ts +++ b/packages/app/src/context/global-sync/child-store.ts @@ -200,8 +200,9 @@ export function createChildStoreManager(input: { }, config: {}, get path() { - if (pathQuery.data) return pathQuery.data - return { state: "", config: "", worktree: "", directory, home: "" } + const EMPTY = { state: "", config: "", worktree: "", directory, home: "" } + if (pathQuery.isLoading) return EMPTY + return pathQuery.data ?? EMPTY }, status: "loading" as const, agent: [],