File tree Expand file tree Collapse file tree
packages/provider-opencode/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1142,6 +1142,8 @@ it.layer(
11421142 } satisfies ServerProvider ;
11431143 const unsettledPartialCatalog = {
11441144 ...unsettledEmptyCatalog ,
1145+ status : "ready" ,
1146+ auth : { status : "authenticated" } ,
11451147 checkedAt : "2026-07-17T00:07:00.000Z" ,
11461148 models : [
11471149 {
Original file line number Diff line number Diff line change @@ -192,11 +192,10 @@ const shouldRetainMissingProviderModels = (provider: ServerProvider): boolean =>
192192 isAntigravity && provider . status === "warning" && provider . auth . status === "unknown" ;
193193 const isPendingInitialProbe =
194194 provider . enabled && ! provider . installed && provider . status === "warning" ;
195- // OpenCode 2 can be running while its lazy catalog is still empty or partial.
196195 const isPendingOpenCodeCatalog =
197196 provider . driver === ProviderDriverKind . make ( "opencode" ) &&
198197 provider . installed &&
199- provider . status === "warning" &&
198+ ( provider . status === "ready" || provider . status === " warning") &&
200199 ( provider . message === OPENCODE_2_CATALOG_EMPTY_MESSAGE ||
201200 provider . message === OPENCODE_2_CATALOG_LOADING_MESSAGE ) ;
202201 const didInstalledProviderProbeFail = provider . installed && provider . status === "error" ;
Original file line number Diff line number Diff line change @@ -289,18 +289,17 @@ export const OpenCodeDriver: ProviderDriver<
289289 ) ,
290290 } ) ;
291291 let lastLoadedOpenCode2Models : ReadonlyArray < OpenCode2Model > | undefined ;
292- const loadOpenCode2Models = openCode2Server . withConnection ( ( { client, version } ) =>
293- makeOpenCode2ModelLoader (
294- loadOpenCode2Catalog ( client , host . paths . cwd ) ,
295- version ,
296- lastLoadedOpenCode2Models ,
297- ) . pipe (
298- Effect . tap ( ( catalog ) =>
299- Effect . sync ( ( ) => {
300- if ( catalog . _tag !== "Unsettled" ) lastLoadedOpenCode2Models = catalog . models ;
301- } ) ,
302- ) ,
303- ) ,
292+ const loadOpenCode2Models = openCode2Server . withConnection ( ( { client, version, external } ) =>
293+ Effect . gen ( function * ( ) {
294+ const catalogVersion = external ? ( yield * runtimeProbe . get ) . version : version ;
295+ const catalog = yield * makeOpenCode2ModelLoader (
296+ loadOpenCode2Catalog ( client , host . paths . cwd ) ,
297+ catalogVersion ,
298+ lastLoadedOpenCode2Models ,
299+ ) ;
300+ if ( catalog . _tag !== "Unsettled" ) lastLoadedOpenCode2Models = catalog . models ;
301+ return catalog ;
302+ } ) ,
304303 ) ;
305304 const listOpenCode2Workspace = ( cwd : string ) =>
306305 openCode2Server . withConnection ( ( { client, events } ) =>
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ export const loadOpenCode2Catalog = (
2020 return Effect . all (
2121 {
2222 models : client . model . list ( { location } ) . pipe (
23- // Plugin activation is the only retryable API failure. The loader bounds
24- // the whole read, including retries, so repeated 503s cannot hang refresh.
2523 Effect . retry ( {
2624 times : 5 ,
2725 while : ( error ) => error . _tag === "ServiceUnavailableError" && error . service === "plugin" ,
Original file line number Diff line number Diff line change @@ -580,7 +580,7 @@ const checkOpenCode2 = Effect.fn("checkOpenCode2")(function* (
580580 probe :
581581 result . value . _tag === "Unsettled"
582582 ? probe (
583- "warning" ,
583+ listedModels . length > 0 ? "ready" : "warning" ,
584584 listedModels . length > 0
585585 ? OPENCODE_2_CATALOG_LOADING_MESSAGE
586586 : OPENCODE_2_CATALOG_EMPTY_MESSAGE ,
You can’t perform that action at this time.
0 commit comments