affaan-m/ECC · error · Error

Cannot adapt Antigravity agent ${label}: missing YAML frontm

Error message

Cannot adapt Antigravity agent ${label}: missing YAML frontmatter

What it means

splitFrontmatter regex-matched the Antigravity agent markdown source and found no '--- ... ---' YAML frontmatter block at the top of the file. Without frontmatter the adapter cannot read the agent's name, description, or model, so adaptation aborts.

Source

Thrown at scripts/lib/install/antigravity-agent.js:23

  Write: 'write_to_file',
  Edit: 'replace_file_content',
  Grep: 'grep_search',
  Glob: 'find_by_name',
  Bash: 'run_command',
  WebSearch: 'search_web',
  WebFetch: 'read_url_content',
});

const MODEL_NAMES = Object.freeze({
  haiku: 'flash',
  sonnet: 'pro',
  opus: 'pro',
});

function splitFrontmatter(source, label) {
  const match = String(source || '').match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n/);
  if (!match) {
    throw new Error(`Cannot adapt Antigravity agent ${label}: missing YAML frontmatter`);
  }

  // Keep YAML loading behind the transform boundary. Public help commands load
  // the installer graph without executing a transform, including in hermetic
  // packed-artifact checks where runtime dependencies are intentionally absent.
  const frontmatter = require('js-yaml').load(match[1]);
  if (!frontmatter || typeof frontmatter !== 'object' || Array.isArray(frontmatter)) {
    throw new Error(`Cannot adapt Antigravity agent ${label}: frontmatter must be an object`);
  }

  return {
    frontmatter,
    body: source.slice(match[0].length),
  };
}

function normalizeToolNames(value) {
  const names = Array.isArray(value) ? value : String(value || '').split(',');

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Add YAML frontmatter (--- ... ---) with at least name and description to the agent markdown file.
  2. Copy the frontmatter shape from an existing working agent file.

Example fix

printf -- '---\nname: my-agent\ndescription: what it does\n---\n' | cat - agent.md > fixed.md
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/lib/install/antigravity-agent.js:23 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/b1d408c991f4a99e. Report an issue: GitHub.