The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
fix(server): Antigravity refreshes no longer erase scanned folders' project skills (#39037)
fatih akyon committed
Nov 19, 2026 at 12:29 UTC
bb234221cefe1dfdc64d754ee14d0456c5d09ec6
2 files changed
+64
-5
apps/server/src/provider/ProviderRegistry.test.ts
+49
@@ -2117,6 +2117,55 @@ it.layer(
2117
signedIn.auth,
2118
);
2119
});
2120
+
2121
+ it("keeps scanned folders through health checks until Antigravity cannot run", () => {
2122
+ const scanned = ["/project", "/plain"].reduce<ServerProvider>(
2123
+ (provider, cwd) =>
2124
+ ProviderRegistry.upsertProviderWorkspaceSnapshot(provider, cwd, {
2125
+ ...signedIn,
2126
+ skills: [{ name: "review", path: `${cwd}/SKILL.md`, enabled: true }],
2127
+ }),
2128
+ signedIn,
2129
+ );
2130
+ const healthCheck = { ...signedIn, checkedAt: "2026-09-05T00:01:00.000Z" };
2131
+ const sessionFolder = {
2132
+ cwd: "/project",
2133
+ checkedAt: healthCheck.checkedAt,
2134
+ slashCommands: [{ name: "swarm" }],
2135
+ skills: [],
2136
+ };
2137
+ const kept = [
2138
+ healthCheck,
2139
+ restartProbe,
2140
+ { ...restartProbe, installed: false, version: null },
2141
+ ] satisfies ReadonlyArray<ServerProvider>;
2142
+ for (const next of kept) {
2143
+ assert.deepStrictEqual(
2144
+ ProviderRegistry.mergeProviderSnapshot(scanned, { ...next, workspaceSnapshots: [] })
2145
+ .workspaceSnapshots,
2146
+ scanned.workspaceSnapshots,
2147
+ );
2148
+ }
2149
+ assert.deepStrictEqual(
2150
+ ProviderRegistry.mergeProviderSnapshot(scanned, {
2151
+ ...healthCheck,
2152
+ workspaceSnapshots: [sessionFolder],
2153
+ }).workspaceSnapshots,
2154
+ [...scanned.workspaceSnapshots!.slice(1), sessionFolder],
2155
+ );
2156
+ const cleared = [
2157
+ { ...healthCheck, auth: { status: "unauthenticated" } },
2158
+ { ...healthCheck, status: "disabled", enabled: false },
2159
+ { ...healthCheck, status: "error", installed: false },
2160
+ ] satisfies ReadonlyArray<ServerProvider>;
2161
+ for (const next of cleared) {
2162
+ assert.deepStrictEqual(
2163
+ ProviderRegistry.mergeProviderSnapshot(scanned, { ...next, workspaceSnapshots: [] })
2164
+ .workspaceSnapshots,
2165
+ [],
2166
+ );
2167
+ }
2168
+ });
2169
});
2170
2171
it("fills missing capabilities from the previous provider snapshot", () => {
apps/server/src/provider/ProviderRegistry.ts
+15
-5
@@ -337,15 +337,25 @@ export const mergeProviderSnapshot = (
337
...snapshot,
338
modelsPending: true,
339
}));
340
+ const nextWorkspaceSnapshots = nextProvider.workspaceSnapshots;
341
+ // A provider reports only folders its own sessions saw, so registry scans of other folders stay.
342
+ const workspaceSnapshots =
343
+ nextWorkspaceSnapshots === undefined ||
344
+ !nextProvider.enabled ||
345
+ nextProvider.auth.status === "unauthenticated" ||
346
+ (!nextProvider.installed && nextProvider.status === "error")
347
+ ? (nextWorkspaceSnapshots ?? previousWorkspaceSnapshots)
348
+ : [
349
+ ...(previousWorkspaceSnapshots ?? []).filter(
350
+ ({ cwd }) => !nextWorkspaceSnapshots.some((snapshot) => snapshot.cwd === cwd),
351
+ ),
352
+ ...nextWorkspaceSnapshots,
353
+ ].slice(-MAX_WORKSPACE_SNAPSHOTS_PER_PROVIDER);
354
return {
355
...(savedAccount?.status === "ready" ? nextWithoutMessage : nextProvider),
356
...savedAccount,
357
models,
344
- ...(nextProvider.workspaceSnapshots !== undefined
345
- ? { workspaceSnapshots: nextProvider.workspaceSnapshots }
346
- : previousWorkspaceSnapshots !== undefined
347
- ? { workspaceSnapshots: previousWorkspaceSnapshots }
348
- : {}),
358
+ ...(workspaceSnapshots === undefined ? {} : { workspaceSnapshots }),
359
...(nextProvider.workspaceRescannedAt === undefined &&
360
previousProvider.workspaceRescannedAt !== undefined
361
? { workspaceRescannedAt: previousProvider.workspaceRescannedAt }