perf: streamline provider and agent startup loading #185

Avoids loading the full provider catalog on startup
Prewarms project config in the background
Prevents duplicate worktree-scoped config requests
This commit is contained in:
Bohdan Triapitsyn
2026-06-16 19:23:38 +03:00
parent fe99c455ae
commit a2a1cedf8d
10 changed files with 307 additions and 52 deletions
+10 -11
View File
@@ -1657,11 +1657,10 @@ export function SyncProvider(props: {
ingestDirectoryStateIntoRoutingIndex(routingIndex, directory, store.getState())
}
},
global: {
config: globalState.config,
projects: globalState.projects,
providers: globalState.providers,
},
global: {
config: globalState.config,
projects: globalState.projects,
},
loadSessions: (dir) => retry(async () => {
const rootSessions = (await listGlobalSessionPages(props.sdk, {
directory: dir,
@@ -1752,11 +1751,11 @@ export function SyncProvider(props: {
const generation = ++globalBootstrapGeneration
bootingRoot = true
const globalActions = useGlobalSyncStore.getState().actions
bootstrapGlobal(props.sdk, (patch) => {
if (globalBootstrapGeneration === generation) {
globalActions.set(patch)
}
})
bootstrapGlobal(props.sdk, (patch) => {
if (globalBootstrapGeneration === generation) {
globalActions.set(patch)
}
})
.then(() => {
if (globalBootstrapGeneration === generation) {
bootedAt = Date.now()
@@ -1772,7 +1771,7 @@ export function SyncProvider(props: {
bootingRoot = false
}
}
}, [props.sdk])
}, [props.sdk])
// Event pipeline — created once per mount. No class, no start/stop.
// Abort controller owned by the pipeline closure. Cleanup aborts + flushes.