google-gemini/gemini-cli · critical · AgentRunnerError

Google Antigravity SDK is not installed.

Error message

Google Antigravity SDK is not installed.

What it means

AgentRunnerError 'Google Antigravity SDK is not installed.' is raised at the very start of run() when the module-level `Agent` symbol (imported from the Antigravity SDK) is None. This is a hard environment defect: the CloudRun image lacks the SDK, so no agent execution can proceed.

Source

Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/agent_runner.py:145

        repo_path: str,
        system_prompt_file: str | None = None,
    ) -> str:
        """Launches and manages an asynchronous conversation with an Antigravity Agent.

        Args:
            role: Label representing the agent's role (e.g., 'Coding Agent').
            prompt: User message prompt guiding the immediate task.
            repo_path: Target directory root of the repository to execute in.
            system_prompt_file: Optional filename of system prompt markdown.

        Returns:
            A reconstructed single text block combining thoughts and outputs.

        Raises:
            AgentRunnerError: If Agent fails to run or execution fails.
        """
        if Agent is None:
            raise AgentRunnerError("Google Antigravity SDK is not installed.")

        logging.info("Initializing Agent '%s' inside %s", role, repo_path)

        # Build fallback / configured system instructions
        system_instructions = f"You are the {role}. You must complete the requested tasks in the workspace."
        if system_prompt_file:
            loaded_instructions = self._load_prompt_file(system_prompt_file)
            if loaded_instructions:
                system_instructions = loaded_instructions
                logging.info(
                    "System prompt successfully loaded from %s",
                    system_prompt_file
                )
            else:
                logging.warning(
                    "Requested system prompt file '%s' not found. Reverting to default instructions.",
                    system_prompt_file,
                )

View on GitHub (pinned to 5024443c72)

Solutions

  1. Add the Antigravity SDK to the image's requirements and rebuild.
  2. Verify the import works in the deployed environment: `python -c 'from antigravity import Agent'`.
  3. Check that the service account / build step has access to the private package registry hosting the SDK.

Example fix

# before
# requirements.txt missing antigravity
# after
antigravity>=<required-version>
Defensive patterns

Strategy: validation

Validate before calling

# fail fast at startup
try:
    from antigravity import Agent  # noqa
except ImportError:
    raise SystemExit('antigravity SDK missing — rebuild image with requirement')

Type guard

def is_agent_sdk_missing(e: Exception) -> bool:
    return isinstance(e, AgentRunnerError) and 'not installed' in str(e)

Try / catch

try:
    runner.run(role, prompt, repo_path)
except AgentRunnerError as e:
    if 'not installed' in str(e):
        raise SystemExit('redeploy with antigravity SDK')
    raise

Prevention

When it happens

Trigger: AgentRunner.run(...) called -> `if Agent is None: raise AgentRunnerError("Google Antigravity SDK is not installed.")`. Agent is None because the try/except ImportError at import time failed to find the antigravity package.

Common situations: CloudRun image built without the antigravity dependency; requirements.txt / pyproject.toml missing the SDK line; SDK was pin-locked to a yanked version; running the workflow locally without installing the private SDK.

Related errors


AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12). Data as JSON: /api/errors/554ccac49c21f9ea. Report an issue: GitHub.