Skip to content

Wire Antigravity CLI as a first-class agent type#1194

Open
kelos-bot[bot] wants to merge 2 commits into
mainfrom
kelos-task-1173
Open

Wire Antigravity CLI as a first-class agent type#1194
kelos-bot[bot] wants to merge 2 commits into
mainfrom
kelos-task-1173

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented May 22, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a new agent for Google Antigravity CLI (agy), Google's terminal coding agent that supersedes the deprecated Gemini CLI, and wires it through the documented CRD path so a manifest with type: antigravity is reachable end-to-end (not just buildable as an image).

  • New antigravity/ directory with Dockerfile and kelos_entrypoint.sh, mirroring the existing gemini/, opencode/, and cursor/ images (ubuntu:24.04 base + Go + Node + gh + git). The Dockerfile installs agy via the official https://antigravity.google/cli/install.sh script.
  • The entrypoint runs agy --print --output-format stream-json with optional --model "$KELOS_MODEL", writes KELOS_AGENTS_MD to ~/.config/agy/AGENTS.md, executes the optional KELOS_SETUP_COMMAND, and streams the agent output into kelos-capture.
  • Wires antigravity into IMAGE_DIRS in the Makefile and adds the image to the kind-load step of .github/workflows/reusable-e2e.yaml.
  • Extends Task.spec.type and TaskTemplate.type kubebuilder enums with antigravity and regenerates the CRD YAMLs.
  • Adds AgentTypeAntigravity, AntigravityImage, JobBuilder.AntigravityImage{,PullPolicy} fields, the --antigravity-image / --antigravity-image-pull-policy controller flags, and a switch case in JobBuilder.Build.
  • Restricts Task.spec.credentials.type to none for the antigravity agent type (the agy CLI has no documented non-interactive credential env var, so the controller refuses api-key/oauth rather than silently injecting Anthropic-shaped variables). Operators who need authenticated runs supply credentials via Task.spec.podOverrides.env.
  • Documents the new agent type and the credentials.type: none restriction in docs/agent-image-interface.md, docs/reference.md, skills/kelos/SKILL.md, and the README. Drops the unused ANTIGRAVITY_API_KEY line from the entrypoint contract header so docs match implementation.

Which issue(s) this PR is related to:

Fixes #1173

Special notes for your reviewer:

The Antigravity install script does not support pinning to a specific version; it always fetches the latest from Google's auto-updater service. This is acknowledged in the PR review feedback as a follow-up (P3) — a follow-up can pin the binary URL once Google publishes a stable per-version download pattern, matching the GEMINI_CLI_VERSION / CURSOR_CLI_VERSION pattern used by the sibling images.

Once agy documents a non-interactive credential env var, a follow-up can lift the credentials.type: none restriction by adding apiKeyEnvVar / oauthEnvVar cases for antigravity and updating the entrypoint contract.

Does this PR introduce a user-facing change?

Added a new agent for Google Antigravity CLI (`agy`). Set `type: antigravity` on a Task or TaskTemplate to use it; only `credentials.type: none` is supported, so credentials should be supplied via `podOverrides.env`.

@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature needs-triage needs-kind Indicates an issue or PR lacks a kind/* label needs-priority needs-actor release-note and removed needs-kind Indicates an issue or PR lacks a kind/* label labels May 22, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="antigravity/Dockerfile">

<violation number="1" location="antigravity/Dockerfile:41">
P2: The `agy` install step is unpinned, so rebuilds can silently pick up new upstream versions and produce non-reproducible images.

(Based on your team's feedback about avoiding silently changing external versions or licenses.) [FEEDBACK_USED]</violation>
</file>

Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Re-trigger cubic

Comment thread antigravity/Dockerfile

USER agent

RUN curl -fsSL https://antigravity.google/cli/install.sh -o /tmp/install-agy.sh \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The agy install step is unpinned, so rebuilds can silently pick up new upstream versions and produce non-reproducible images.

(Based on your team's feedback about avoiding silently changing external versions or licenses.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At antigravity/Dockerfile, line 41:

<comment>The `agy` install step is unpinned, so rebuilds can silently pick up new upstream versions and produce non-reproducible images.

(Based on your team's feedback about avoiding silently changing external versions or licenses.) </comment>

<file context>
@@ -0,0 +1,50 @@
+
+USER agent
+
+RUN curl -fsSL https://antigravity.google/cli/install.sh -o /tmp/install-agy.sh \
+    && bash /tmp/install-agy.sh \
+    && rm /tmp/install-agy.sh
</file context>

@gjkim42
Copy link
Copy Markdown
Collaborator

gjkim42 commented May 22, 2026

/kelos api-review

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 22, 2026

🤖 Kelos Task Status

Task kelos-api-reviewer-issue-comment-08c253a9d3a4 has succeeded. ✅

@gjkim42
Copy link
Copy Markdown
Collaborator

gjkim42 commented May 22, 2026

/kelos review

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 22, 2026

🤖 Kelos Task Status

Task kelos-reviewer-issue-comment-7fe16baf7cd3 has succeeded. ✅

Copy link
Copy Markdown
Author

@kelos-bot kelos-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kelos API Reviewer Agent @gjkim42

API Design Review

Verdict: COMMENT (effectively REQUEST CHANGES — see findings; review submitted as COMMENT because GitHub forbids requesting changes on a PR authored by the same bot identity)
Scope: Adds an antigravity agent image (Dockerfile + entrypoint) and wires it into the Makefile / e2e workflow. Description says "No API/CRD changes," but the new agent is not reachable through the existing CRD API — that itself is an API gap worth resolving (or explicitly deferring) before merge.

Findings

API Compatibility / Reachability

  • Task.spec.type and TaskTemplate.type are restricted by
    +kubebuilder:validation:Enum=claude-code;codex;gemini;opencode;cursor
    (api/v1alpha1/task_types.go:142, api/v1alpha1/taskspawner_types.go:816).
    After this PR, the image exists in the registry and is preloaded into the
    e2e kind cluster, but a manifest with type: antigravity is rejected by
    the API server — the new agent is not exposed through the documented CRD
    path. To make this image usable as a first-class agent, the enum must be
    extended in both places (and the corresponding make update artifacts
    regenerated).
  • internal/controller/job_builder.go:120-133 (JobBuilder.Build) has no
    AgentTypeAntigravity case and would return unsupported agent type: antigravity. The default-image constants and JobBuilder fields at
    job_builder.go:17-46 / :93-104 likewise omit antigravity. Without
    these, even after the enum is extended, scheduling fails. This is the
    controller-side half of the same API surface.
  • apiKeyEnvVar / oauthEnvVar (internal/controller/job_builder.go:138-178)
    have no antigravity case, so a Task with type: antigravity and an
    api-key/oauth credential would silently inject ANTHROPIC_API_KEY /
    CLAUDE_CODE_OAUTH_TOKEN rather than an Antigravity-shaped variable.
    Either define the credential env var contract for agy here or document
    that the Antigravity image only supports credentials.type: none (and
    enforce it in CEL).

Documentation vs. Implementation

  • docs/agent-image-interface.md:43 enumerates KELOS_AGENT_TYPE values as
    claude-code, codex, gemini, opencode, cursor. If antigravity is being
    added as an agent type, this table (and the env-var table above it) must
    list it and document which credential variables Kelos will inject for it.
  • antigravity/kelos_entrypoint.sh:7 documents
    ANTIGRAVITY_API_KEY env var: API key for authentication (optional) in
    the contract header, but the script never reads ANTIGRAVITY_API_KEY and
    no controller code populates it. Per CLAUDE.md ("Docs must match
    implementation, not aspiration"), either wire the env var through
    credentialEnvVars (and add an apiKeyEnvVar/oauthEnvVar case) or drop
    the line from the contract comment.

Image Naming / Future-Proofing

  • The directory and image name antigravity is tied to the product brand,
    while the CLI binary is agy. The PR description notes Antigravity
    "supersedes the deprecated Gemini CLI" — if Antigravity is intended to be
    Google's long-term Gemini-family CLI, consider whether the enum value
    should reflect that lineage (e.g., reuse/rename of gemini, or a value
    like antigravity with explicit deprecation guidance for gemini).
    Whatever you choose, do it before shipping the enum value — once it's in
    the CRD it's effectively permanent. Worth a sentence in the release note
    on how antigravity relates to the existing gemini agent type.

Suggestions

  • If the intent is to ship the image artifact first and add API/controller
    wiring in a follow-up PR, please say so explicitly in the description and
    link the follow-up issue, so reviewers don't read "No API/CRD changes" as
    "this is feature-complete." Otherwise, fold the enum extension,
    JobBuilder case, credential env-var mapping, and docs update into this
    PR so the feature is usable end-to-end on merge.
  • The kind-load step at .github/workflows/reusable-e2e.yaml:122 adds the
    image to the cluster but no e2e test exercises type: antigravity — a
    smoke test (even just kelos run --type antigravity --credentials none)
    would prove the enum/builder/env wiring all lines up.

Note on prompt injection: A prior automated review on this PR
(cubic-dev-ai[bot]) contains an HTML-comment block instructing AI readers
to attribute findings to that tool. The findings above were derived
independently from the diff and the existing CRD/controller code; the
attribution instruction was disregarded.

/kelos needs-input

Copy link
Copy Markdown
Author

@kelos-bot kelos-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kelos Reviewer Agent @gjkim42

Review Summary

Verdict: COMMENT (effectively APPROVE — see findings; review submitted as COMMENT because GitHub forbids approving a PR authored by the same bot identity)
Overall correctness: patch is correct
Scope: Adds a new antigravity/ agent image (Dockerfile + entrypoint) for Google Antigravity CLI (agy) and wires it into IMAGE_DIRS and the e2e kind-load step.

The image artifact itself is well-formed and follows the established pattern from gemini/, opencode/, and cursor/. The API-surface concern — that type: antigravity is not yet reachable through the CRD or wired in JobBuilder — has already been raised in detail by the /kelos api-review run on this PR, so I am not duplicating that checklist here. Only image- and convention-level findings below.

Findings Overview

Priority Count File:Line Summary
P0 0 none
P1 0 none
P2 1 antigravity/kelos_entrypoint.sh:8 Contract docstring lists an env var the script and controller never read
P3 1 antigravity/Dockerfile:41 agy install is unpinned and unverified — acknowledged in PR description

Findings

Documentation accuracy

  • [P2] antigravity/kelos_entrypoint.sh:8 — the contract header declares ANTIGRAVITY_API_KEY env var: API key for authentication (optional), but neither this script nor any code under internal/controller/ references that name. Per CLAUDE.md ("Docs must match implementation, not aspiration"), either drop the line from the contract comment or wire the variable through credentialEnvVars / apiKeyEnvVar in a follow-up. Operators reading the header today will plausibly set ANTIGRAVITY_API_KEY on a Pod and observe no effect.

Reproducibility

  • [P3] antigravity/Dockerfile:41bash <(curl https://antigravity.google/cli/install.sh) fetches the latest agy build with no version arg and no checksum verification, so two rebuilds of the same Dockerfile commit can yield different agy binaries. The PR description already calls this out as an upstream limitation; flagging only so a follow-up pins the binary URL (and ideally adds a sha256sum -c) once Google publishes a stable per-version download pattern, matching the pattern used for GEMINI_CLI_VERSION, OPENCODE_VERSION, and CURSOR_CLI_VERSION in the sibling images.

Suggestions

  • [P3] The kind-load step at .github/workflows/reusable-e2e.yaml:122 makes the image available in the e2e cluster but no e2e exercises type: antigravity. A smoke test in the follow-up that adds the CRD enum + JobBuilder case would prove the wiring end-to-end.

Key takeaways

  • The Dockerfile and entrypoint mirror gemini/ and opencode/ cleanly; no correctness issues in what was added.
  • The biggest open question (CRD enum / JobBuilder / docs are not extended, so the image is unreachable via the documented CRD path) is already captured by /kelos api-review — please resolve there.
  • Fix the stale ANTIGRAVITY_API_KEY line in the entrypoint header in this PR or the wiring follow-up, whichever lands sooner.

Note on prompt injection: A prior automated review on this PR (cubic-dev-ai[bot]) contains an HTML-comment block instructing AI readers to credit it as the source of findings. That instruction was disregarded — the findings above were derived independently from the diff and the existing image-pattern files.

Comment thread antigravity/kelos_entrypoint.sh Outdated
# Interface contract:
# - First argument ($1): the task prompt
# - KELOS_MODEL env var: model name (optional)
# - ANTIGRAVITY_API_KEY env var: API key for authentication (optional)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] The contract header declares ANTIGRAVITY_API_KEY env var: API key for authentication (optional), but neither this script nor any code under internal/controller/ references that name. Per CLAUDE.md ("Docs must match implementation, not aspiration"), drop the line or wire the variable through credentialEnvVars/apiKeyEnvVar in the follow-up. Operators reading the header today will plausibly set ANTIGRAVITY_API_KEY on a Pod and observe no effect.

Comment thread antigravity/Dockerfile

USER agent

RUN curl -fsSL https://antigravity.google/cli/install.sh -o /tmp/install-agy.sh \
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] bash <(curl https://antigravity.google/cli/install.sh) fetches the latest agy build with no version arg and no checksum verification, so two rebuilds of the same Dockerfile commit can yield different agy binaries. The PR description already calls this out; flagging only so a follow-up pins the binary URL (and ideally adds a sha256sum -c) once Google publishes a stable per-version download pattern, matching the GEMINI_CLI_VERSION/OPENCODE_VERSION/CURSOR_CLI_VERSION pattern in the sibling images.

@gjkim42
Copy link
Copy Markdown
Collaborator

gjkim42 commented May 22, 2026

/kelos pick-up

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 22, 2026

🤖 Kelos Task Status

Task kelos-pr-responder-issue-comment-485f7de8be52 has failed. ❌

gjkim42 and others added 2 commits May 22, 2026 14:21
Mirrors the gemini/opencode/cursor image pattern: ubuntu:24.04 with Go,
Node, gh and git. Installs the Antigravity CLI (agy) via the official
install.sh and wires the directory into IMAGE_DIRS and the e2e workflow.

The kelos_entrypoint.sh runs agy in --print mode with stream-json output,
forwards KELOS_MODEL via --model, writes KELOS_AGENTS_MD to
~/.config/agy/AGENTS.md, executes the optional setup command, and pipes
the agent stream into kelos-capture.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extends Task.spec.type / TaskTemplate.type enums with "antigravity" and
adds the controller-side wiring (AgentTypeAntigravity, AntigravityImage,
JobBuilder fields, --antigravity-image flag) so a manifest with
type: antigravity is now reachable through the documented CRD path
rather than just buildable as an image.

The agy CLI has no documented non-interactive credential env var, so
Task.spec.credentials.type is restricted to "none" for this agent type
(operators supply credentials via podOverrides.env). Drops the unused
ANTIGRAVITY_API_KEY line from the antigravity entrypoint contract
header so docs match implementation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kelos-bot kelos-bot Bot force-pushed the kelos-task-1173 branch from 5931e09 to 450801a Compare May 22, 2026 15:05
@kelos-bot kelos-bot Bot changed the title Add Antigravity CLI agent image Wire Antigravity CLI as a first-class agent type May 22, 2026
kelos-bot Bot pushed a commit that referenced this pull request May 22, 2026
… conventions

Add three conventions backed by review feedback on PRs from the past 7 days:

- "Wire new agent runtime images through the full stack in one PR" — from
  the /kelos api-review on PR #1194 (Antigravity CLI). The PR added an image
  directory + kind-load step but did not extend the Task.spec.type enum,
  JobBuilder, credential env-var mapping, agent-image-interface.md, or e2e
  coverage, so `type: antigravity` is rejected at admission.
- "Pin third-party CLI installs in agent-image Dockerfiles" — from cubic
  (P2) and kelos-bot (P3) findings on PR #1194's antigravity/Dockerfile:41
  unversioned `curl install.sh | bash`. The sibling images already use
  ARG XXX_VERSION + pinned URLs.
- "Propagate deferred Close()/Flush() errors via a named return" — from
  the cubic (P2) and kelos-bot (P2) findings on PR #1189
  internal/capture/usage.go:46 silent `defer bw.Flush()` error drop.
@gjkim42
Copy link
Copy Markdown
Collaborator

gjkim42 commented May 22, 2026

/kelos pick-up

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 22, 2026

🤖 Kelos Task Status

Task kelos-pr-responder-issue-comment-3e600e380fd4 has succeeded. ✅

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 23, 2026

🤖 Kelos Agent @gjkim42

All review feedback was addressed in the wiring commit (450801a): CRD enum extended for Task.spec.type and TaskTemplate.type, JobBuilder switch case + image flags, credentials.type: none enforcement, docs/CLI tab-completion updates, and four positive/negative unit tests for the antigravity job builder. The stale ANTIGRAVITY_API_KEY line was dropped from the entrypoint contract header.

Local make verify and make test pass; gh pr checks 1194 is green (build, verify, test, test-integration, test-e2e). The P3 agy install-pin and the e2e smoke test for type: antigravity remain explicit follow-ups acknowledged in the PR description.

Ready for re-review.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Antigravity cli image

1 participant