fix(server): refresh workspace skills with provider status #11532
Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/11532/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/provider/Layers/ProviderRegistry.ts line 548Resolvedby yashranaway(GitHub profile, opens in a new tab)@@ -530,3 +527,18 @@530- Effect.flatMap(syncProvider),531- ),532- ),527+ const nextProvider = yield* providerSource.refresh;528+ const correlated = yield* correlateSnapshotWithSource(providerSource, nextProvider);529+ const instance = (yield* Ref.get(liveSubsRef)).get(providerSource.instanceId);530+ // Explicit refreshes invalidate workspace catalogs. Background snapshots531+ // still retain them, and active clients request their cwd again on demand.532+ const cached = (yield* Ref.get(providersRef)).find(533+ (provider) => provider.instanceId === providerSource.instanceId,534+ )?.workspaceSnapshots;535+ let hadPending = false;536+ if (instance) {537+ hadPending = yield* Ref.modify(workspaceRefreshesRef, (refreshes) => {538+ const next = new Map(refreshes);539+ next.delete(instance);540+ return [refreshes.has(instance), next] as const;541+ });542+ }543+ return yield* syncProvider(544+ cached !== undefined || hadPending ? { ...correlated, workspaceSnapshots: [] } : correlated,
- apps/server/src/provider/Layers/ProviderRegistry.ts lines 529 to 540OutdatedResolvedby yashranaway(GitHub profile, opens in a new tab)@@ -526,7 +526,15 @@526526 ) {527- return yield* providerSource.refresh.pipe(528- Effect.flatMap((nextProvider) =>529- correlateSnapshotWithSource(providerSource, nextProvider).pipe(530- Effect.flatMap(syncProvider),531- ),532- ),527+ const nextProvider = yield* providerSource.refresh;528+ const correlated = yield* correlateSnapshotWithSource(providerSource, nextProvider);529+ const instance = (yield* Ref.get(liveSubsRef)).get(providerSource.instanceId);530+ // Explicit refreshes invalidate workspace catalogs. Background snapshots531+ // still retain them, and active clients request their cwd again on demand.532+ const cached = (yield* Ref.get(providersRef)).find(533+ (provider) => provider.instanceId === providerSource.instanceId,534+ )?.workspaceSnapshots;535+ let hadPending = false;536+ if (instance) {537+ hadPending = yield* Ref.modify(workspaceRefreshesRef, (refreshes) => {538+ const next = new Map(refreshes);539+ next.delete(instance);540+ return [refreshes.has(instance), next] as const;
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
DazKins(GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.
Bugbot is paused — on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.