[Bug]: Antigravity skill discovery drops all skills once SKILL.md files exceed the 8 MB scan budget #32161
Before submitting#
- I searched existing issues and did not find one tracking this case.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server (src/provider/Drivers/AntigravitySkills.ts)
Version#
T3 Code (Beta) 0.1.7, macOS (darwin arm64)
Summary#
Antigravity skill discovery drops every skill once the combined size of the SKILL.md files it reads crosses MAX_SCAN_BYTES (8 MB). This is the Antigravity counterpart of the Cursor case fixed in #23221: one shared byte budget, and exhausting it fails the whole probe instead of returning the skills that were already found.
Steps to reproduce#
- Put enough user-level skills in
~/.gemini/config/skills/(plus~/.gemini/antigravity-cli/skills/and the workspace.gemini/skills,.agents/skills,.agent/skills) that theSKILL.mdfiles total more than 8,000,000 bytes. No single file needs to be large. In my case it was 773 skills at 8.06 MB inconfig/skillsalone, with an averageSKILL.mdaround 10 KB. - Open an Antigravity thread in T3 Code and type
$in the composer.
Expected behavior#
Skills that were read before the budget ran out stay discoverable, and T3 tells "discovery incomplete" apart from "no skills". Ideally only the frontmatter is read, so a long skill body does not use up the budget.
Actual behavior#
readSkill throws AntigravitySkillsProbeError("scan-budget-exhausted") as soon as info.size > Math.min(MAX_SKILL_BYTES, budget.remainingBytes). The error propagates out of discoverAntigravitySkills, so the skill picker shows nothing for Antigravity, even though the native Antigravity CLI itself loads those skills.
Also relevant:
- The budget counts every byte of every
SKILL.md, but only the frontmatter (name,description) is used. - A duplicate name is skipped only after its file has been read and counted, so one skill linked into both
config/skillsandantigravity-cli/skills(a common setup) is paid for twice. - Workspace roots share the same budget, so the same user-level skills can work in one project and disappear in another.
Workaround#
Trim ~/.gemini/config/skills and ~/.gemini/antigravity-cli/skills until the total is under 8 MB. I had to take out about 30 skills to get there.
Suggested fix#
- On
scan-budget-exhausted, return the partial result (marked as truncated) instead of failing. - Read only up to the closing
---of the frontmatter, or cap each file at a few KB, before counting bytes. - Check
skillsByNamebefore reading the file, using the directory name as the provisional key.
tanstack-source added labelsbug
juliusmarminge closed this
Sign in to join this conversation.