From ab69f41067cf960d7eabd612e9a8a7f153fc0d8c Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:19:56 +1000 Subject: [PATCH] fix(app): avoid suspending on pending child path (#30314) --- 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 88634b877..c0ad67cc2 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 ab5c0dc01..22bd26271 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: [],