@@ -50,21 +50,15 @@ type GlobalStore = {
5050 reload : undefined | "pending" | "complete"
5151}
5252
53- export const loadSessionsQueryKey = ( directory : string ) => [ directory , "loadSessions" ] as const
54-
55- export const mcpQueryKey = ( directory : string ) => [ directory , "mcp" ] as const
56-
5753export const loadMcpQuery = ( directory : string , sdk : OpencodeClient ) =>
5854 queryOptions ( {
59- queryKey : mcpQueryKey ( directory ) ,
55+ queryKey : [ directory , "mcp" ] as const ,
6056 queryFn : ( ) => sdk . mcp . status ( ) . then ( ( r ) => r . data ?? { } ) ,
6157 } )
6258
63- export const lspQueryKey = ( directory : string ) => [ directory , "lsp" ] as const
64-
6559export const loadLspQuery = ( directory : string , sdk : OpencodeClient ) =>
6660 queryOptions ( {
67- queryKey : lspQueryKey ( directory ) ,
61+ queryKey : [ directory , "lsp" ] as const ,
6862 queryFn : ( ) => sdk . lsp . status ( ) . then ( ( r ) => r . data ?? [ ] ) ,
6963 } )
7064
@@ -101,11 +95,7 @@ function createGlobalSync() {
10195 agents : ( directory : string ) => loadAgentsQuery ( directory , sdkFor ( directory ) ) ,
10296 mcp : ( directory : string ) => loadMcpQuery ( directory , sdkFor ( directory ) ) ,
10397 lsp : ( directory : string ) => loadLspQuery ( directory , sdkFor ( directory ) ) ,
104- keys : {
105- lsp : lspQueryKey ,
106- mcp : mcpQueryKey ,
107- sessions : loadSessionsQueryKey ,
108- } ,
98+ sessions : ( directory : string ) => ( { queryKey : [ directory , "loadSessions" ] as const } ) ,
10999 }
110100
111101 const [ configQuery , providerQuery , pathQuery ] = useQueries ( ( ) => ( {
@@ -254,7 +244,7 @@ function createGlobalSync() {
254244 const limit = Math . max ( store . limit + SESSION_RECENT_LIMIT , SESSION_RECENT_LIMIT )
255245 const promise = queryClient
256246 . fetchQuery ( {
257- queryKey : loadSessionsQueryKey ( key ) ,
247+ ... queryOptionsApi . sessions ( key ) ,
258248 queryFn : ( ) =>
259249 loadRootSessionsWithFallback ( {
260250 directory,
0 commit comments