GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(antigravity): accept null plugin preference fields in config.json by fcakyon · Pull Request #44785 · pingdotgg/t3code Conversation
|
config.json fixture |
Live agy 1.5.18 |
upstream/main (13cda455bd) |
This branch (ac391a34a0) |
|---|---|---|---|
{ plugins: { off: { enabled: false } } } |
["ok"] |
["ok"] |
["ok"] |
\uFEFF + { plugins: { off: { enabled: false } } } |
["ok"] |
["ok"] |
["ok"] |
{ plugins: { ok: { enabled: null }, off: { enabled: false } } } |
["ok"] |
["off", "ok"] |
["ok"] |
\uFEFF + { plugins: { ok: { enabled: null }, off: { enabled: false } } } |
["ok"] |
["off", "ok"] |
["ok"] |
{ plugins: { other: {}, off: { enabled: false } } } |
["ok"] |
["ok"] |
["ok"] |
{ plugins: null } |
["off", "ok"] |
["off", "ok"] |
["off", "ok"] |
{ plugins: { other: null, off: { enabled: false } } } (control) |
["off", "ok"] |
["off", "ok"] |
["off", "ok"] |
{ plugins: { bad: { enabled: "no" }, off: { enabled: false } } } (control) |
["off", "ok"] |
["off", "ok"] |
["off", "ok"] |
{broken (control) |
["off", "ok"] |
["off", "ok"] |
["off", "ok"] |
Regression check. Running the new test case parses plugin preferences with a UTF-8 BOM and null enabled fields against upstream/main's AntigravitySkills.ts fails at the "enabled": null check:
AssertionError: expected [ 'off', 'ok' ] to deeply equal [ 'ok' ]
❯ src/provider/Drivers/AntigravitySkills.repro.test.ts:211:14
Checks on head ac391a34a0:
vp test run apps/server/src/provider/Drivers/AntigravitySkills.test.ts: 16 passed (16).vp run check:changed upstream/main: all stages passed (format 0.1s, lint 0.3s, knip 1/2 7.4s, knip 2/2 12.3s, graphql 0.3s, typecheck 3 packages 8.7s, test 2 files / 18 tests in 12.1s: AntigravitySkills.test.ts 16, AgentContextBudget.test.ts 2).Not checked:
available_commands_update only).Run from apps/server after copying git show upstream/main:apps/server/src/provider/Drivers/AntigravitySkills.ts > src/provider/Drivers/repro-main-skills.ts (delete repro-main-skills.ts afterwards):
node --input-type=module <<'JS' import { spawn } from "node:child_process"; import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; import * as NodeServices from "@effect/platform-node/NodeServices"; import * as Effect from "effect/Effect"; const mainMod = await import("./src/provider/Drivers/repro-main-skills.ts"); const branchMod = await import("./src/provider/Drivers/AntigravitySkills.ts"); const write = (file, text) => { mkdirSync(dirname(file), { recursive: true }); writeFileSync(file, text); }; async function runAgy(profile, cwd, home) { const child = spawn( process.env.AGY_BIN ?? "agy", ["acp", "--gemini-dir", profile, "--app-data-dir", "antigravity-acp", "--disable-telemetry"], { cwd, env: { PATH: process.env.PATH, HOME: home, GEMINI_API_KEY: "AIzaSyDummyKeyForSessionNewProbeOnly0000" }, stdio: ["pipe", "pipe", "ignore"], }, ); let nextId = 0; const pending = new Map(); const commands = new Set(); let buf = ""; child.stdout.on("data", (chunk) => { buf += chunk.toString("utf8"); let nl; while ((nl = buf.indexOf("\n")) !== -1) { const line = buf.slice(0, nl); buf = buf.slice(nl + 1); if (!line.startsWith("{")) continue; const msg = JSON.parse(line); if (msg.id !== undefined && pending.has(msg.id)) { pending.get(msg.id)(msg); pending.delete(msg.id); } else if (msg.params?.update?.sessionUpdate === "available_commands_update") { for (const cmd of msg.params.update.availableCommands) commands.add(cmd.name); } } }); const req = (method, params) => new Promise((resolve, reject) => { const id = ++nextId; const timer = setTimeout(() => reject(new Error(`${method} timeout`)), 20_000); pending.set(id, (msg) => { clearTimeout(timer); resolve(msg); }); child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", id, method, params })}\n`); }); try { const init = await req("initialize", { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false }, }); await req("authenticate", { methodId: "gemini-api-key" }); await req("session/new", { cwd, mcpServers: [] }); await new Promise((r) => setTimeout(r, 1200)); const version = init.result?.agentInfo?.version ?? "unknown"; const skills = [...commands].filter((n) => n === "ok" || n === "off").toSorted(); return { version, skills }; } finally { child.kill(); await new Promise((r) => child.once("close", r)); } } const fixtures = [ ["1. baseline {off:false}", JSON.stringify({ plugins: { off: { enabled: false } } })], ["2. BOM + {off:false}", `\uFEFF${JSON.stringify({ plugins: { off: { enabled: false } } })}`], ["3. {ok:{enabled:null}, off:false}", JSON.stringify({ plugins: { ok: { enabled: null }, off: { enabled: false } } })], ["4. BOM + {ok:{enabled:null}, off:false}", `\uFEFF${JSON.stringify({ plugins: { ok: { enabled: null }, off: { enabled: false } } })}`], ["5. {other:{}, off:false}", JSON.stringify({ plugins: { other: {}, off: { enabled: false } } })], ["6. {plugins:null}", JSON.stringify({ plugins: null })], ["7. {other:null, off:false}", JSON.stringify({ plugins: { other: null, off: { enabled: false } } })], ["8. {bad:{enabled:'no'}, off:false}", JSON.stringify({ plugins: { bad: { enabled: "no" }, off: { enabled: false } } })], ["9. malformed {broken", "{broken"], ]; for (const [label, configText] of fixtures) { const root = mkdtempSync(join(tmpdir(), "t3-44785-repro-")); const home = join(root, "home"); const profile = join(root, "profile"); const cwd = join(root, "workspace"); mkdirSync(home, { recursive: true }); mkdirSync(profile, { recursive: true }); mkdirSync(cwd, { recursive: true }); try { for (const plugin of ["ok", "off"]) { write(join(profile, "config", "plugins", plugin, "skills", plugin, "SKILL.md"), `---\nname: ${plugin}\ndescription: ${plugin}\n---\n`); write(join(profile, "config", "plugins", plugin, "plugin.json"), JSON.stringify({ name: plugin })); } write(join(profile, "config", "config.json"), configText); const runDisc = (mod) => Effect.runPromise( mod.discoverAntigravitySkills({ cwd, userHome: home, profileDirectory: profile }).pipe( Effect.map((skills) => skills.map((s) => s.name)), Effect.provide(NodeServices.layer), ), ); const before = await runDisc(mainMod); const after = await runDisc(branchMod); const agyRes = await runAgy(profile, cwd, home); console.log(`${label} | agy ${agyRes.version}: ${JSON.stringify(agyRes.skills)} | main: ${JSON.stringify(before)} | branch: ${JSON.stringify(after)}`); } finally { rmSync(root, { recursive: true, force: true }); } } JS
1. baseline {off:false} | agy 1.5.18: ["ok"] | main: ["ok"] | branch: ["ok"]
2. BOM + {off:false} | agy 1.5.18: ["ok"] | main: ["ok"] | branch: ["ok"]
3. {ok:{enabled:null}, off:false} | agy 1.5.18: ["ok"] | main: ["off","ok"] | branch: ["ok"]
4. BOM + {ok:{enabled:null}, off:false} | agy 1.5.18: ["ok"] | main: ["off","ok"] | branch: ["ok"]
5. {other:{}, off:false} | agy 1.5.18: ["ok"] | main: ["ok"] | branch: ["ok"]
6. {plugins:null} | agy 1.5.18: ["off","ok"] | main: ["off","ok"] | branch: ["off","ok"]
7. {other:null, off:false} | agy 1.5.18: ["off","ok"] | main: ["off","ok"] | branch: ["off","ok"]
8. {bad:{enabled:'no'}, off:false} | agy 1.5.18: ["off","ok"] | main: ["off","ok"] | branch: ["off","ok"]
9. malformed {broken | agy 1.5.18: ["off","ok"] | main: ["off","ok"] | branch: ["off","ok"]
Model: GPT-6.2 Astra (Codex) and Gemini 4 Neon (Antigravity)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Preference decoding and tests apps/server/src/provider/Drivers/AntigravitySkills.ts, apps/server/src/provider/Drivers/AntigravitySkills.test.ts |
The preference schema accepts null plugin maps and null enabled values. Configuration text has a leading UTF-8 BOM removed before decoding. Tests cover disabled plugins, null values, and invalid preference data. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: lucenx9, hazemkya
138c3This change makes Antigravity skill discovery tolerate null plugin preference fields and a BOM in config.json, while keeping disabled plugins excluded. The scope is small and covered by tests, so no merge-blocking risk is evident.
Explanation
The title names the main change: null plugin preference fields in config.json are now accepted for the Antigravity provider. It follows the conventional commit format and matches the diff, which makes Schema.NullOr changes to plugins and enabled and strips a leading UTF-8 BOM.
Explanation
The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug, the expected behavior, and reproduction steps. The Change section lists the three code edits. The Scope section says the fix is small and obvious, names the two touched files, and links related PRs. The Verification section gives a fixture matrix against live agy 1.5.18 and upstream/main, a regression test failure output, and the commands run on head ac391a3. It also lists what was not checked, including Windows, macOS, and live model turns. The agent model is named at the end, as the template asks. The description does not link a tracked issue, but it explains why none is needed, which the template allows. The Problem section's reproduction is detailed. Minor gaps: the title is not restated in the description, and the template's conventional commit title is not shown in the body. These gaps are non-critical.
c50a0368-a8da-4c74-9127-7a7ee28c8855apps/server/src/provider/Drivers/AntigravitySkills.test.tsapps/server/src/provider/Drivers/AntigravitySkills.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4bdd1af to
5589e27
Compare
…in preference fields in config.json
Allow plugins: null and enabled: null when decoding profile config.json (matching agy Go JSON decoding and stripping any leading UTF-8 BOM like decodePluginManifest), while keeping invalid plugin entries fail-open so disabled sibling plugins stay excluded from the skill picker. verification: vp test run AntigravitySkills.test.ts (16 passed), live agy 1.5.18 9/9 matrix matched, vp run check:changed upstream/main passed (2 files, 18 passed)
ac391a3 to
01bc669
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.