fix(app): avoid suspending on pending child path (#30314)

This commit is contained in:
Luke Parker 2026-06-02 13:19:56 +10:00 committed by GitHub
parent 687c66248c
commit ab69f41067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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: [],