Skip to content

fix: strip Claude-schema tools frontmatter so cavecrew agents load on Gemini/Antigravity#709

Open
mvanhorn wants to merge 1 commit into
JuliusBrussee:mainfrom
mvanhorn:fix/497-gemini-antigravity-agent-tools
Open

fix: strip Claude-schema tools frontmatter so cavecrew agents load on Gemini/Antigravity#709
mvanhorn wants to merge 1 commit into
JuliusBrussee:mainfrom
mvanhorn:fix/497-gemini-antigravity-agent-tools

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

What

Fixes #497 - caveman fails to load on Google Antigravity / Gemini CLI.

Why

Installing the extension with gemini extensions install https://github.com/JuliusBrussee/caveman makes Gemini's ExtensionManager reject all three cavecrew agents:

Validation failed: Agent Definition: tools.0: Invalid tool name

The agents/cavecrew-*.md files carry Claude Code schema frontmatter (tools: [Read, Edit, Write, Grep, Glob]). Gemini validates each entry against its own tool vocabulary and refuses the Claude names, so the cavecrew subagents never load and the extension is broken on Antigravity. This is the same class of schema mismatch already fixed for opencode in #386 via stripOpencodeAgentTools().

How

Mirror the opencode #386 fix on the Gemini/Antigravity distribution path, reusing the proven transform:

  • bin/lib/opencode-agent.js: generalize the existing helper into a schema-agnostic stripAgentTools() that removes the frontmatter tools: key (and its wrapped continuation lines), keeping stripOpencodeAgentTools as a thin alias so the existing opencode call site and test stay unchanged.
  • bin/install.js: after gemini extensions install lands the extension at ~/.gemini/extensions/caveman/agents/, rewrite the three installed cavecrew agent files in place with the tools: line stripped (Gemini then falls back to its default tool set; the subagent prompts already self-restrict scope in their bodies). The same strip is applied to the Antigravity npx skills agent copies. Missing files are skipped silently, honoring the installer's fail-soft-on-filesystem-error invariant.

Top-level source-of-truth agents are untouched, so the Claude plugin mirror still ships the full tools: schema via CI. Only the Gemini/Antigravity on-disk copies are rewritten.

Tests

Adds tests/installer/gemini-agents.test.mjs (5 cases): only the frontmatter tools: key is stripped (inline body prose preserved), opencode-alias equivalence and idempotency, end-to-end Gemini install strips every distributed agent, --force re-run idempotency + missing-file skip, and the Antigravity path. The existing tests/installer/opencode-agent.test.mjs continues to pass unchanged.

$ node --test tests/installer/gemini-agents.test.mjs
# tests 5 | pass 5 | fail 0
$ node --test tests/installer/opencode-agent.test.mjs
# tests 9 | pass 9 | fail 0

AI was used for assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

It doesn't work on antigravity ide

1 participant