{"record":{"id":"554ccac49c21f9ea","repo":"google-gemini/gemini-cli","slug":"google-antigravity-sdk-is-not-installed","errorCode":null,"errorMessage":"Google Antigravity SDK is not installed.","messagePattern":"Google Antigravity SDK is not installed\\.","errorType":"exception","errorClass":"AgentRunnerError","httpStatus":null,"severity":"critical","filePath":"tools/caretaker-agent/cloudrun/pr-generator/workflow/agent_runner.py","lineNumber":145,"sourceCode":"        repo_path: str,\n        system_prompt_file: str | None = None,\n    ) -> str:\n        \"\"\"Launches and manages an asynchronous conversation with an Antigravity Agent.\n\n        Args:\n            role: Label representing the agent's role (e.g., 'Coding Agent').\n            prompt: User message prompt guiding the immediate task.\n            repo_path: Target directory root of the repository to execute in.\n            system_prompt_file: Optional filename of system prompt markdown.\n\n        Returns:\n            A reconstructed single text block combining thoughts and outputs.\n\n        Raises:\n            AgentRunnerError: If Agent fails to run or execution fails.\n        \"\"\"\n        if Agent is None:\n            raise AgentRunnerError(\"Google Antigravity SDK is not installed.\")\n\n        logging.info(\"Initializing Agent '%s' inside %s\", role, repo_path)\n\n        # Build fallback / configured system instructions\n        system_instructions = f\"You are the {role}. You must complete the requested tasks in the workspace.\"\n        if system_prompt_file:\n            loaded_instructions = self._load_prompt_file(system_prompt_file)\n            if loaded_instructions:\n                system_instructions = loaded_instructions\n                logging.info(\n                    \"System prompt successfully loaded from %s\",\n                    system_prompt_file\n                )\n            else:\n                logging.warning(\n                    \"Requested system prompt file '%s' not found. Reverting to default instructions.\",\n                    system_prompt_file,\n                )","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/tools/caretaker-agent/cloudrun/pr-generator/workflow/agent_runner.py#L127-L163","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add the Antigravity SDK to the image's requirements and rebuild.","Verify the import works in the deployed environment: `python -c 'from antigravity import Agent'`.","Check that the service account / build step has access to the private package registry hosting the SDK."],"exampleFix":"# before\n# requirements.txt missing antigravity\n# after\nantigravity>=<required-version>","handlingStrategy":"validation","validationCode":"# fail fast at startup\ntry:\n    from antigravity import Agent  # noqa\nexcept ImportError:\n    raise SystemExit('antigravity SDK missing — rebuild image with requirement')","typeGuard":"def is_agent_sdk_missing(e: Exception) -> bool:\n    return isinstance(e, AgentRunnerError) and 'not installed' in str(e)","tryCatchPattern":"try:\n    runner.run(role, prompt, repo_path)\nexcept AgentRunnerError as e:\n    if 'not installed' in str(e):\n        raise SystemExit('redeploy with antigravity SDK')\n    raise","preventionTips":["Pin the SDK in requirements and run an import smoke test in the image build.","Fail the deployment if the import check exits non-zero."],"tags":["dependencies","antigravity-sdk","cloudrun","python"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}