Skip to content

Commit 12a661e

Browse files
authored
fix(app): drop the dead plugin-boot retry on catalog syncs (#62830)
1 parent 4de7680 commit 12a661e

3 files changed

Lines changed: 4 additions & 12 deletions

File tree

‎packages/app/src/providers/catalog/providers.ts‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { useData } from "@/runtime/server/current"
22
import { useServerSDK } from "@/runtime/server/client"
33
import { normalizeProviderList } from "@/runtime/server/global-sync/utils"
4-
import { isServiceUnavailableError } from "@opencode/client/promise"
5-
import { retry } from "@opencode/util/retry"
64
import { Iterable, pipe } from "effect"
75
import { createEffect, createMemo, type Accessor } from "solid-js"
86
import type { ProviderListResponse } from "@/runtime/server/types"
@@ -15,10 +13,6 @@ const emptyProviderCatalog: ProviderListResponse = { all: new Map(), connected:
1513

1614
const popularProviderSet = new Set(popularProviders)
1715

18-
// A cold Location lists its catalogs once its plugins activate, which can take longer than the server's 5 s wait.
19-
export const syncWhileBooting = <A>(load: () => Promise<A>) =>
20-
retry(load, { attempts: 12, delay: 1000, maxDelay: 5000, retryIf: isServiceUnavailableError })
21-
2216
export function useProviders(directory: Accessor<string | undefined>) {
2317
const data = useData()
2418
const sdk = useServerSDK()
@@ -35,9 +29,7 @@ export function useProviders(directory: Accessor<string | undefined>) {
3529
void (async () => {
3630
if (!ref) await data.location.syncInfo()
3731
const resolved = ref ?? data.location.default()
38-
await syncWhileBooting(() =>
39-
Promise.all([data.location.provider.sync(resolved), data.location.model.sync(resolved)]),
40-
)
32+
await Promise.all([data.location.provider.sync(resolved), data.location.model.sync(resolved)])
4133
})().catch(() => undefined)
4234
})
4335
const integrations = useIntegrations(directory)

‎packages/app/src/providers/models/selection.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { batch, createEffect, createMemo, createRoot, createSignal, onCleanup, u
55
import { Predicate, Schema, SchemaGetter } from "effect"
66
import { useModels } from "@/providers/models/models"
77
import { useSettings } from "@/settings/model"
8-
import { syncWhileBooting, useProviders } from "@/providers/catalog/providers"
8+
import { useProviders } from "@/providers/catalog/providers"
99
import { Persist, persisted } from "@/runtime/persistence/storage"
1010
import { Persistence } from "@/runtime/persistence/schema"
1111
import { usePlatform, type Platform } from "@/runtime/platform/platform"
@@ -331,7 +331,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
331331
const directory = sdk().directory
332332

333333
if (!directory) return
334-
void syncWhileBooting(() => data.location.agent.sync({ directory })).catch(() => undefined)
334+
void data.location.agent.sync({ directory }).catch(() => undefined)
335335
})
336336

337337
const agentsVisible = createMemo(() => settings.visibility.customAgents() || hasCustomAgent(list()))

‎packages/stories/mocks/app/hooks/use-providers.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Accessor } from "solid-js"
22
import { useServer } from "@/runtime/server/current"
33
import { useProviders } from "../../../../app/src/providers/catalog/providers"
44

5-
export { popularProviders, syncWhileBooting } from "../../../../app/src/providers/catalog/providers"
5+
export { popularProviders } from "../../../../app/src/providers/catalog/providers"
66

77
export { useStoryProviders as useProviders }
88

0 commit comments

Comments
 (0)