Skip to content

Commit 3ccb016

Browse files
committed
fix(server): late PATH recovery probes each rebuilt instance
A refresh failure elsewhere no longer skips the rebuild, and a shared pass holding retired instances no longer leaves the rebuilt one unchecked.
1 parent c3050c9 commit 3ccb016

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎apps/server/src/provider/ProviderRegistry.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ export const layer = Layer.effect(
705705
// and timeout errors are not, since a rebuild would close their sessions.
706706
const rebuildMissingAndRefresh = Effect.fn("rebuildMissingAndRefresh")(function* () {
707707
const instances = yield* instanceRegistry.listInstances;
708-
yield* refresh();
708+
yield* refresh().pipe(Effect.catchCause(recoverRefreshFailure));
709709
const missing = yield* Effect.filter(instances, (instance) =>
710710
Effect.gen(function* () {
711711
// ACP also reports installed:false for setup states unrelated to executable discovery.
@@ -725,7 +725,14 @@ export const layer = Layer.effect(
725725
);
726726
if (missing.length === 0) return yield* Ref.get(providersRef);
727727
yield* instanceRegistryMutator.rebuild(missing);
728-
return yield* refresh();
728+
// A shared pass already in flight may hold the retired instances, so probe each rebuilt one.
729+
yield* Effect.forEach(
730+
missing,
731+
(instance) =>
732+
refreshInstance(instance.instanceId).pipe(Effect.catchCause(recoverRefreshFailure)),
733+
{ concurrency: "unbounded", discard: true },
734+
);
735+
return yield* Ref.get(providersRef);
729736
});
730737

731738
const refreshAfterUpdate = Effect.fn("refreshAfterUpdate")(function* (

0 commit comments

Comments
 (0)