Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fe20210
fix: load Antigravity plugin skills
fcakyon Nov 3, 2026
9403556
fix: address Antigravity plugin review
fcakyon Nov 4, 2026
7b31ce4
Merge branch 'main' into fatih/antigravity-plugins
fcakyon Nov 4, 2026
03c80e2
fix: keep valid Antigravity skills available
fcakyon Nov 4, 2026
cca73cc
Merge branch 'main' into fatih/antigravity-plugins
fcakyon Nov 4, 2026
1ca6f45
Merge branch 'main' into fatih/antigravity-plugins
fcakyon Nov 4, 2026
c4e03f9
fix: isolate invalid plugin preferences
fcakyon Nov 4, 2026
111c28d
Merge branch 'main' into fatih/antigravity-plugins
fcakyon Nov 4, 2026
b4df1cc
Merge branch 'main' into fatih/antigravity-plugins
fcakyon Nov 4, 2026
302bada
test: compare encoded plugin skill paths
fcakyon Nov 4, 2026
0cb8986
build: merge upstream main
fcakyon Nov 4, 2026
ee665f9
build: merge upstream main
fcakyon Nov 4, 2026
73bcc62
build: merge upstream main
fcakyon Nov 4, 2026
5c58b38
build: merge upstream main
fcakyon Nov 4, 2026
f60fdc9
build: merge upstream main
fcakyon Nov 5, 2026
dd1fd31
build: merge upstream main
fcakyon Nov 5, 2026
808f32f
build: merge upstream main
fcakyon Nov 5, 2026
7a93afa
build: merge upstream main
fcakyon Nov 5, 2026
7350af1
build: merge upstream main
fcakyon Nov 5, 2026
7821fb9
build: merge upstream main
fcakyon Nov 5, 2026
92cf21f
Merge remote-tracking branch 'github/main' into fatih/antigravity-plu…
maria-rcks Nov 7, 2026
bc9a828
Merge branch 'main' into fatih/antigravity-plugins
fcakyon Nov 7, 2026
00b8278
Merge remote-tracking branch 'origin/main' into fatih/antigravity-plu…
juliusmarminge Nov 14, 2026
eb5a729
fix(server): read Antigravity plugin config in full after main merge
juliusmarminge Nov 14, 2026
ac5e7da
fix(server): let Antigravity client reads reach prepared plugin skills
juliusmarminge Nov 14, 2026
1010be7
Merge remote-tracking branch 'origin/main' into fatih/antigravity-plu…
juliusmarminge Nov 19, 2026
e7a98e2
style(server): format Antigravity adapter after main merge
juliusmarminge Nov 19, 2026
ad673d7
fix(server): list Antigravity plugin skills without session wrappers
juliusmarminge Nov 19, 2026
cfbfeb0
Merge remote-tracking branch 'origin/main' into fatih/antigravity-plu…
juliusmarminge Nov 19, 2026
97566af
fix(server): read Antigravity plugin skills from the instance profile
juliusmarminge Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/src/provider/Drivers/AntigravityDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export const AntigravityDriver: ProviderDriver<
snapshotForCwd: (cwd) =>
!enabled
? provider.snapshot.getSnapshot
: discoverAntigravitySkills({ cwd, userHome }).pipe(
: discoverAntigravitySkills({ cwd, userHome, profileDirectory }).pipe(
Effect.provideService(FileSystem.FileSystem, fileSystem),
Effect.provideService(Path.Path, path),
Effect.flatMap((skills) => provider.snapshotForCwd(cwd, skills)),
Expand Down
80 changes: 80 additions & 0 deletions apps/server/src/provider/Drivers/AntigravitySkills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const makeWorkspace = Effect.fn("makeWorkspace")(function* () {
return {
cwd: path.join(temporaryDirectory, "workspace"),
userHome: path.join(temporaryDirectory, "home"),
profileDirectory: path.join(temporaryDirectory, "profile"),
};
});

Expand Down Expand Up @@ -93,6 +94,85 @@ it.layer(NodeServices.layer)("discoverAntigravitySkills", (it) => {
}),
);

it.effect("reads skills from enabled plugins under their own names", () =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const input = yield* makeWorkspace();
const config = path.join(input.profileDirectory, "config");
const expected = [];
for (const name of ["alpha", "beta", "broken", "off", "disabled", "unregistered"]) {
const plugin = path.join(config, "plugins", name);
const skillPath = yield* writeSkill(
path.join(plugin, "skills", "review"),
`---\nname: ${name}-review\ndescription: Review changes.\n---\n`,
);
if (name !== "unregistered") {
yield* fileSystem.writeFileString(
path.join(plugin, "plugin.json"),
name === "off" || name === "broken"
? "{ invalid"
: JSON.stringify({
name: `--- Display ${name} ---`,
disabled: name === "beta" || name === "disabled",
}),
);
}
if (name === "alpha" || name === "beta") {
expected.push({
name: `${name}-review`,
description: "Review changes.",
path: skillPath,
scope: "user",
enabled: true,
});
}
}
yield* fileSystem.writeFileString(
path.join(config, "config.json"),
JSON.stringify({ plugins: { beta: { enabled: true }, off: { enabled: false } } }),
);
// agy in a T3 thread cannot load plugins outside its profile, so the picker must not offer them.
const homePlugin = path.join(input.userHome, ".gemini", "config", "plugins", "home");
yield* writeSkill(path.join(homePlugin, "skills", "review"), "---\nname: home-review\n---\n");
yield* fileSystem.writeFileString(path.join(homePlugin, "plugin.json"), "{}");
for (const [directory, scope] of [
[path.join(input.cwd, ".agents", "skills"), "project"],
[path.join(input.userHome, ".gemini", "config", "skills"), "user"],
] as const) {
const name = `standalone-${scope}`;
const skillPath = yield* writeSkill(
path.join(directory, name),
`---\nname: ${name}\n---\n`,
);
expected.push({ name, path: skillPath, scope, enabled: true });
}
assert.deepEqual(yield* discoverAntigravitySkills(input), expected);
for (const contents of ["{ invalid", '{"plugins":{"alpha":{"enabled":"yes"}}}']) {
yield* fileSystem.writeFileString(path.join(config, "config.json"), contents);
assert.deepEqual(yield* discoverAntigravitySkills(input), expected.slice(2));
}
}),
);

it.effect("keeps standalone skills when plugin discovery fails", () =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const input = yield* makeWorkspace();
const skillPath = yield* writeSkill(
path.join(input.userHome, ".gemini", "config", "skills", "standalone"),
"---\nname: standalone\n---\n",
);
const plugin = path.join(input.profileDirectory, "config", "plugins", "broken");
yield* writeSkill(path.join(plugin, "skills", "review"), "---\nname: review\n---\n");
yield* fileSystem.writeFileString(path.join(plugin, "plugin.json"), "x".repeat(1_000_001));
assert.deepEqual(yield* discoverAntigravitySkills(input), [
{ name: "standalone", path: skillPath, scope: "user", enabled: true },
]);
}),
);

it.effect("uses native root order for duplicate names", () =>
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
Expand Down
169 changes: 145 additions & 24 deletions apps/server/src/provider/Drivers/AntigravitySkills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,32 +162,17 @@ const readSkillFrontmatter = Effect.fn("readAntigravitySkill")(function* (
return bytes.toString("utf8", 0, frontmatterEnd);
});

/** Keep read errors typed so workspace snapshots cannot cache partial results. */
export const discoverAntigravitySkills = Effect.fn("discoverAntigravitySkills")(function* (input: {
readonly cwd: string;
readonly userHome: string;
}): Effect.fn.Return<
ReadonlyArray<ServerProviderSkill>,
AntigravitySkillsProbeError,
FileSystem.FileSystem | Path.Path
> {
interface SkillRoot {
readonly directory: string;
readonly scope: string;
}

const scanSkillDirectories = Effect.fn("scanAntigravitySkillDirectories")(function* (
roots: ReadonlyArray<SkillRoot>,
budget: ScanBudget,
) {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const [configSkills, cliSkills] = antigravityUserSkillDirectories(
path,
path.join(input.userHome, ".gemini"),
);
const roots = [
{ directory: configSkills, scope: "user" },
{ directory: path.resolve(input.cwd, ".gemini", "skills"), scope: "project" },
{ directory: cliSkills, scope: "user" },
{ directory: path.resolve(input.cwd, ".agents", "skills"), scope: "project" },
{ directory: path.resolve(input.cwd, ".agent", "skills"), scope: "project" },
];
const budget: ScanBudget = {
remainingBytes: MAX_SCAN_BYTES,
remainingEntries: MAX_SCAN_ENTRIES,
};
const skillsByName = new Map<string, ServerProviderSkill>();

const scanDirectory = Effect.fn("scanAntigravitySkillDirectory")(function* (
Expand Down Expand Up @@ -241,3 +226,139 @@ export const discoverAntigravitySkills = Effect.fn("discoverAntigravitySkills")(
}
return [...skillsByName.values()].sort((left, right) => left.name.localeCompare(right.name));
});

const readJsonFile = Effect.fn("readAntigravityPluginConfig")(function* (
filePath: string,
budget: ScanBudget,
) {
const fileSystem = yield* FileSystem.FileSystem;
const info = yield* readIfPresent(fileSystem.stat(filePath), filePath);
if (info?.type !== "File") return undefined;
if (info.size > BigInt(Math.min(MAX_SKILL_BYTES, budget.remainingBytes))) {
return yield* new AntigravitySkillsProbeError({
reason: "scan-budget-exhausted",
path: filePath,
});
}
const contents = yield* readIfPresent(fileSystem.readFileString(filePath), filePath);
if (contents === undefined) return undefined;
budget.remainingBytes -= Buffer.byteLength(contents);
return contents;
});

const PluginManifest = Schema.fromJsonString(
Schema.Struct({ disabled: Schema.optional(Schema.Boolean) }),
);
const PluginPreferences = Schema.fromJsonString(
Schema.Struct({
plugins: Schema.optional(
Schema.Record(Schema.String, Schema.Struct({ enabled: Schema.optional(Schema.Boolean) })),
),
}),
);

const decodePluginManifest = Schema.decodeEffect(PluginManifest);
const decodePluginPreferences = Schema.decodeEffect(PluginPreferences);

/** agy runs with GEMINI_HOME set to the instance profile, so it loads plugins from there only. */
const discoverAntigravityPlugins = Effect.fn("discoverAntigravityPlugins")(function* (
profileDirectory: string,
) {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const config = path.join(profileDirectory, "config");
const directory = path.join(config, "plugins");
const entries = yield* readIfPresent(fileSystem.readDirectory(directory), directory);
if (entries === undefined) return [];
const budget: ScanBudget = {
remainingBytes: MAX_SCAN_BYTES,
remainingEntries: MAX_SCAN_ENTRIES,
};
if (entries.length > budget.remainingEntries) {
return yield* new AntigravitySkillsProbeError({
reason: "scan-budget-exhausted",
path: directory,
});
}
budget.remainingEntries -= entries.length;
const preferencesPath = path.join(config, "config.json");
const preferencesContents = yield* readJsonFile(preferencesPath, budget);
const preferences =
preferencesContents === undefined
? { plugins: {} }
: yield* decodePluginPreferences(preferencesContents).pipe(
Effect.catchTags({
SchemaError: () =>
Effect.logWarning("Antigravity plugin preferences are invalid.", {
errorTag: "invalid-config",
}).pipe(Effect.as(undefined)),
}),
);
if (preferences === undefined) return [];
const roots: Array<SkillRoot> = [];
for (const entry of entries.toSorted()) {
const pluginDirectory = path.join(directory, entry);
if (
(yield* readIfPresent(fileSystem.stat(pluginDirectory), pluginDirectory))?.type !==
"Directory"
)
continue;
const enabled = preferences.plugins?.[entry]?.enabled;
if (enabled === false) continue;
const manifestPath = path.join(pluginDirectory, "plugin.json");
const contents = yield* readJsonFile(manifestPath, budget);
if (contents === undefined) continue;
const manifest = yield* decodePluginManifest(contents).pipe(
Effect.catchTags({
SchemaError: () =>
Effect.logWarning("Skipped an Antigravity plugin with an invalid manifest.", {
errorTag: "invalid-config",
}).pipe(Effect.as(undefined)),
}),
);
if (manifest === undefined) continue;
if (manifest.disabled && enabled !== true) continue;
roots.push({ directory: path.join(pluginDirectory, "skills"), scope: "user" });
}
return yield* scanSkillDirectories(roots, budget);
});

/** Keep read errors typed so workspace snapshots cannot cache partial results. */
export const discoverAntigravitySkills = Effect.fn("discoverAntigravitySkills")(function* (input: {
readonly cwd: string;
readonly userHome: string;
readonly profileDirectory: string;
}): Effect.fn.Return<
ReadonlyArray<ServerProviderSkill>,
AntigravitySkillsProbeError,
FileSystem.FileSystem | Path.Path
> {
const path = yield* Path.Path;
const [configSkills, cliSkills] = antigravityUserSkillDirectories(
path,
path.join(input.userHome, ".gemini"),
);
const skills = yield* scanSkillDirectories(
[
{ directory: configSkills, scope: "user" },
{ directory: path.resolve(input.cwd, ".gemini", "skills"), scope: "project" },
{ directory: cliSkills, scope: "user" },
{ directory: path.resolve(input.cwd, ".agents", "skills"), scope: "project" },
{ directory: path.resolve(input.cwd, ".agent", "skills"), scope: "project" },
],
{ remainingBytes: MAX_SCAN_BYTES, remainingEntries: MAX_SCAN_ENTRIES },
);
const pluginSkills = yield* discoverAntigravityPlugins(input.profileDirectory).pipe(
Effect.catchTags({
AntigravitySkillsProbeError: (cause) =>
Effect.logWarning("Antigravity plugin skills are unavailable.", {
reason: cause.reason,
}).pipe(Effect.as([])),
}),
);
// agy lists plugin skills under their own names, so the picker keeps one entry per name.
const names = new Set(skills.map((skill) => skill.name));
return [...skills, ...pluginSkills.filter((skill) => !names.has(skill.name))].sort(
(left, right) => left.name.localeCompare(right.name),
);
});
Loading