Skip to content

feat: integrate the optional Antigravity role into the image - #75

Open
eXPerience83 wants to merge 30 commits into
mainfrom
feat/antigravity-role-integration
Open

feat: integrate the optional Antigravity role into the image#75
eXPerience83 wants to merge 30 commits into
mainfrom
feat/antigravity-role-integration

Conversation

@eXPerience83

@eXPerience83 eXPerience83 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Progresses #27. This PR does not close #27 or claim supported Antigravity integration; real vendor login and lifecycle validation remain gated by #29.

What changed

  • Integrate the reviewed optional Antigravity runtime core from feat: add the optional Antigravity runtime core #74 into the shared Remote Dev image.
  • Add the antigravity role, dedicated tmux session, neutral menu/direct/shell routing, diagnostics, health behavior and role-specific state hardening.
  • Install only Remote Dev wrappers and immutable inspection evidence in the image; the Google agy executable remains absent until an explicit runtime installation.
  • Make the runtime manager consume one root-owned canonical path map for the executable, manifest, local state, vendor state and inspection evidence.
  • Keep the role disabled by default. Controlled validation deployments must set exactly REMOTE_DEV_ENABLE_EXPERIMENTAL_ANTIGRAVITY=1 together with REMOTE_DEV_ROLE=antigravity.
  • Treat Antigravity status code 3 as the expected non-fatal “reviewed update required” state in diagnostics.

Impact

  • Default Codex, Shell and launcher behavior is unchanged.
  • The image grows only by project-owned Bash wrappers and a small path-definition file; it does not redistribute the proprietary Antigravity binary or add it to the build-time SBOM.
  • Normal container startup, health checks and Codex sessions never download, install or update Antigravity.
  • Antigravity is not advertised as a supported role: diagnostics identify it as experimental and gated pending test: validate Antigravity free-plan login and lifecycle on TrueNAS #29.
  • No Compose/TrueNAS service, host port, launcher card, password file or persistence mount is added in this slice.

Validation

  • Repository configuration validation completed in Build AMD64
  • Test optional Antigravity runtime fixture lifecycle workflow completed
  • AMD64 image build and runtime smoke tests completed
  • Codex start/resume/policy compatibility remained green
  • Experimental role default-deny and explicit opt-in paths were exercised
  • Antigravity diagnostic status 3 regression was exercised inside the built image
  • Canonical-path consumption and absence of /root/.local/bin/agy were asserted during image build
  • Notices, base/final SPDX SBOM generation, Trivy scans and critical-vulnerability gate completed
  • Documentation update deferred until the real TrueNAS result in test: validate Antigravity free-plan login and lifecycle on TrueNAS #29 establishes the supported or blocked outcome
  • CHANGELOG.md update deferred because this PR does not expose a supported user-facing integration

Safety and release checks

  • No credentials, tokens, private hostnames or personal infrastructure paths were added
  • No privileged mode, host networking, additional capabilities or Docker socket mount was introduced
  • Public ttyd exposure remains authenticated and is not presented as Internet-safe
  • The image contains no Antigravity installer payload or agy executable
  • Antigravity automatic updates remain disabled during supported launcher execution
  • The role fails closed unless the exact experimental validation flag is present
  • Image tags, digests and rollback guidance remain unchanged by this slice
  • This change does not publish or promote a stable release unintentionally

Follow-up

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eXPerience83, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d037f1d9-45db-434a-b9b5-2c04b28e18d1

📥 Commits

Reviewing files that changed from the base of the PR and between b924154 and 4a89d02.

📒 Files selected for processing (5)
  • images/codex/Dockerfile
  • scripts/remote-dev-antigravity.sh
  • scripts/run-antigravity.sh
  • scripts/runtime-smoke-test.sh
  • scripts/test-antigravity-runtime.sh

Summary by CodeRabbit

  • New Features
    • Added Antigravity as an experimental remote development role.
    • Added an interactive menu for starting, installing, updating, authentication, diagnostics, and shell access.
    • Added role-aware startup, session management, health checks, and status reporting.
  • Security
    • Added permission hardening for Antigravity binaries and persistent state.
    • Added validation for required installation paths and protected configuration.
  • Tests
    • Expanded runtime and container checks to validate Antigravity availability, setup, feature gating, and role behavior.

Walkthrough

Antigravity is added as an experimental remote development role. The PR defines canonical paths, gates role resolution, provisions image assets, initializes and hardens persistent state, adds launch and menu support, and extends diagnostics and tests.

Changes

Antigravity integration

Layer / File(s) Summary
Image assets and path contract
images/codex/Dockerfile, scripts/lib/antigravity-paths.sh
The image copies Antigravity scripts and path definitions, applies permissions, creates persistence directories, and validates the uninstalled state.
Role routing and execution
scripts/lib/remote-dev-runtime.sh, scripts/run-antigravity.sh, scripts/remote-dev-antigravity.sh, scripts/attach-remote-dev-tmux.sh, scripts/remote-dev-healthcheck.sh, scripts/start-remote-dev-web.sh
Antigravity is gated by an environment flag, routed through matching start modes, mapped to a tmux session, launched with canonical paths, and initialized with required directories.
Persistent state hardening
scripts/secure-persistent-state.sh
Antigravity binary and state trees receive private permissions after path-library validation.
Diagnostics and interactive controls
scripts/remote-dev-doctor.sh, scripts/remote-dev-menu.sh
Diagnostics check Antigravity paths, commands, status, trust boundaries, authentication, and executable permissions. The menu adds start, install, update, GitHub login, diagnostics, and shell actions.
Runtime validation
scripts/runtime-smoke-test.sh, scripts/test-role-neutral-runtime.sh
Tests cover experimental gating, role and start-mode validation, diagnostic output, and the default Antigravity tmux session.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant RemoteDevMenu
  participant RemoteDevRuntime
  participant RunAntigravity
  participant AntigravityBinary
  User->>RemoteDevMenu: select start or lifecycle action
  RemoteDevMenu->>RemoteDevRuntime: resolve antigravity role
  RemoteDevRuntime->>RunAntigravity: validate and export role
  RunAntigravity->>AntigravityBinary: launch validated executable
  AntigravityBinary-->>User: return command status
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes cover runtime integration but do not implement required #27 installation, update, documentation, recovery, and launcher workflows. Implement or separately link the missing installer, updater, documentation, recovery, and end-to-end acceptance requirements before treating #27 as complete.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: integrating the optional Antigravity role into the image.
Description check ✅ Passed The description covers changes, impact, validation, safety checks, and follow-up work, including deferred documentation and lifecycle validation.
Out of Scope Changes check ✅ Passed The changes are related to the stated experimental Antigravity runtime integration and do not introduce unrelated functionality.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/antigravity-role-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@eXPerience83
eXPerience83 marked this pull request as ready for review August 2, 2026 20:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/remote-dev-doctor.sh`:
- Around line 138-145: Update the Antigravity status handling in the role branch
to capture remote-dev-antigravity’s output and exit code through an || guard, so
exit code 3 does not terminate the script under set -euo pipefail. Preserve the
existing status assignment behavior: codes 0 and 3 leave status unchanged, while
other nonzero codes set status=1.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 41fb812b-6577-4f89-b158-7ed5dafe030d

📥 Commits

Reviewing files that changed from the base of the PR and between 68be9d1 and 0dc5e4c.

📒 Files selected for processing (11)
  • images/codex/Dockerfile
  • scripts/attach-remote-dev-tmux.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-doctor.sh
  • scripts/remote-dev-healthcheck.sh
  • scripts/remote-dev-menu.sh
  • scripts/runtime-smoke-test.sh
  • scripts/secure-persistent-state.sh
  • scripts/start-remote-dev-web.sh
  • scripts/test-role-neutral-runtime.sh
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{yml,yaml,Dockerfile,sh,bash,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{yml,yaml,Dockerfile,sh,bash,js,ts,tsx}: Never use privileged containers, Docker or Podman sockets, SYS_ADMIN, host-root mounts, or broad persistence mounts such as /root, /home, /opt, /usr/local, or a parent data root.
Preserve mandatory ttyd authentication for agent terminals, origin checking for all web endpoints, tmux reconnect behavior, image identity checks, and existing Codex login, start, and resume behavior.

Files:

  • scripts/remote-dev-healthcheck.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/runtime-smoke-test.sh
  • scripts/start-remote-dev-web.sh
  • scripts/attach-remote-dev-tmux.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-menu.sh
  • scripts/secure-persistent-state.sh
  • scripts/test-role-neutral-runtime.sh
**/*.{sh,bash,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never use eval, sourced editable state, or user-controlled shell fragments for role, mode, installer, routing, or command dispatch.

Files:

  • scripts/remote-dev-healthcheck.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/runtime-smoke-test.sh
  • scripts/start-remote-dev-web.sh
  • scripts/attach-remote-dev-tmux.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-menu.sh
  • scripts/secure-persistent-state.sh
  • scripts/test-role-neutral-runtime.sh
**/*.{sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{sh,bash}: Use fixed, validated enums for roles and start modes; reject unknown values with a deterministic non-zero exit status and a clear message.
Build command invocations with Bash arrays, preserve arguments without re-evaluating them, preserve command exit status, and run persistent-state hardening after supported interactive sessions.

Files:

  • scripts/remote-dev-healthcheck.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/runtime-smoke-test.sh
  • scripts/start-remote-dev-web.sh
  • scripts/attach-remote-dev-tmux.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-menu.sh
  • scripts/secure-persistent-state.sh
  • scripts/test-role-neutral-runtime.sh
**/*.{yml,yaml,sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

Implement issue #25 in separately reviewed slices: role-neutral commands and validation, configurable Codex approval modes, canonical image and variable naming with time-bounded aliases, shared image digest, Compose and state migration, and outer hardening with cross-service canaries.

Files:

  • scripts/remote-dev-healthcheck.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/runtime-smoke-test.sh
  • scripts/start-remote-dev-web.sh
  • scripts/attach-remote-dev-tmux.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-menu.sh
  • scripts/secure-persistent-state.sh
  • scripts/test-role-neutral-runtime.sh
**/*.{sh,bash,js,ts,tsx,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Run the narrowest relevant tests during development and complete required CI before merge; preserve or extend coverage for role/start-mode validation, wrappers, launcher security, mounts, image identity, health checks, Codex flows, credential hardening, ttyd, tmux, provenance, notices, SBOM, Trivy, and the critical-vulnerability gate.

Files:

  • scripts/remote-dev-healthcheck.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/runtime-smoke-test.sh
  • scripts/start-remote-dev-web.sh
  • scripts/attach-remote-dev-tmux.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-menu.sh
  • scripts/secure-persistent-state.sh
  • scripts/test-role-neutral-runtime.sh
scripts/**/*.sh

⚙️ CodeRabbit configuration file

scripts/**/*.sh: Review as production Bash. Check quoting, set -euo pipefail behavior, cleanup traps,
bounded retries and timeouts, non-interactive execution, idempotency and useful failure messages.
Flag commands that can hang, leak credentials, silently ignore failures or mutate persistent data unexpectedly.

Files:

  • scripts/remote-dev-healthcheck.sh
  • scripts/lib/antigravity-paths.sh
  • scripts/runtime-smoke-test.sh
  • scripts/start-remote-dev-web.sh
  • scripts/attach-remote-dev-tmux.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-menu.sh
  • scripts/secure-persistent-state.sh
  • scripts/test-role-neutral-runtime.sh
images/**/Dockerfile

⚙️ CodeRabbit configuration file

images/**/Dockerfile: Review for reproducibility, supply-chain security and minimal image growth.
Require pinned upstream versions and checksum or digest verification for downloaded binaries.
Flag secrets, floating base tags, unsafe remote-script execution, broken multi-architecture logic,
cache misuse, unnecessary packages and changes that weaken the secure-by-default runtime.

Files:

  • images/codex/Dockerfile
🪛 Shellcheck (0.11.0)
scripts/lib/antigravity-paths.sh

[warning] 3-3: ANTIGRAVITY_EVIDENCE appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 4-4: ANTIGRAVITY_BIN_DIR appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 5-5: ANTIGRAVITY_BINARY appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 6-6: ANTIGRAVITY_STATE_DIR appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 7-7: ANTIGRAVITY_MANIFEST appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 8-8: ANTIGRAVITY_VENDOR_STATE_DIR appears unused. Verify use (or export if used externally).

(SC2034)

scripts/test-role-neutral-runtime.sh

[info] 53-53: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 54-54: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 55-55: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 57-57: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 58-58: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 59-59: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 60-60: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 61-61: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)

🔇 Additional comments (11)
images/codex/Dockerfile (1)

13-19: LGTM!

Also applies to: 60-63, 72-72, 87-90, 103-103, 120-121

scripts/lib/antigravity-paths.sh (1)

3-8: LGTM!

scripts/lib/remote-dev-runtime.sh (1)

16-24: LGTM!

Also applies to: 47-63, 86-86

scripts/attach-remote-dev-tmux.sh (1)

17-17: LGTM!

Also applies to: 29-38

scripts/remote-dev-healthcheck.sh (1)

33-33: LGTM!

scripts/start-remote-dev-web.sh (1)

30-38: LGTM!

scripts/secure-persistent-state.sh (1)

6-6: LGTM!

Also applies to: 33-45, 70-85

scripts/remote-dev-doctor.sh (1)

14-14: LGTM!

Also applies to: 40-40, 49-60, 91-95, 192-198

scripts/remote-dev-menu.sh (1)

150-158: LGTM!

Also applies to: 221-269, 305-305

scripts/runtime-smoke-test.sh (1)

166-166: LGTM!

scripts/test-role-neutral-runtime.sh (1)

53-61: LGTM!

Also applies to: 71-72

Comment thread scripts/remote-dev-doctor.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0dc5e4c529

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/remote-dev-runtime.sh Outdated

case "$role" in
launcher|codex|shell)
launcher|codex|shell|antigravity)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the Antigravity role unavailable until its gates pass

Do not accept antigravity as implemented here: third_party/optional-agents.md:46-49 still records the integration as pending and unsupported, while third_party/antigravity-cli-inspection.md:106-116 says exact post-login state paths still require manual validation. Accepting this enum exposes install/start menus and advertises the role from the public image before those gates have passed; keep it reserved until the owning integration and real-environment validation are complete.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

Comment on lines +4 to +8
readonly ANTIGRAVITY_BIN_DIR=/root/.local/bin
readonly ANTIGRAVITY_BINARY=/root/.local/bin/agy
readonly ANTIGRAVITY_STATE_DIR=/root/.local/share/remote-dev/antigravity
readonly ANTIGRAVITY_MANIFEST=/root/.local/share/remote-dev/antigravity/install.json
readonly ANTIGRAVITY_VENDOR_STATE_DIR=/root/.gemini/antigravity-cli

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 Badge Make the runtime manager consume the canonical paths

antigravity-paths.sh is now consumed by startup, diagnostics, and hardening as the immutable path map, but remote-dev-antigravity.sh:5-8 still independently hard-codes the same binary and state paths. When a canonical path or mount changes, the manager can install and verify one tree while startup and hardening initialize another, potentially leaving credentials outside the protected persistent tree; source this map from the manager or otherwise derive every consumer from one definition.

AGENTS.md reference: AGENTS.md:L53-L53

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fac659858

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread images/codex/Dockerfile
Comment on lines +60 to +63
COPY scripts/remote-dev-antigravity.sh /usr/local/bin/remote-dev-antigravity
COPY scripts/remote-dev-install-antigravity.sh /usr/local/bin/remote-dev-install-antigravity
COPY scripts/remote-dev-update-antigravity.sh /usr/local/bin/remote-dev-update-antigravity
COPY scripts/run-antigravity.sh /usr/local/bin/run-antigravity

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate the Antigravity entry points by role

In a default Codex or shell container, these executable wrappers let a terminal user run remote-dev-install-antigravity --yes and then run-antigravity without ever invoking remote_dev_resolve_role or setting the experimental gate. That installs Google state into the Codex/shell service and reuses its workspace and credentials instead of the intended isolated Antigravity service; run-antigravity also invokes hardening under the original role, so the vendor state is not hardened. Fresh evidence beyond the earlier role-enum comment is that the direct entry points copied here completely bypass that enum gate; make each Antigravity entry point reject calls unless the gated Antigravity role has been resolved.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
images/codex/Dockerfile (1)

115-123: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Set the Antigravity role and experimental gate for this build check.

remote-dev-antigravity now calls require_antigravity_role before status. At Line 122, the image still has REMOTE_DEV_ROLE=codex and no experimental gate. The command exits with status 2, so the RUN instruction fails.

Proposed fix
-    && remote-dev-antigravity status --menu | grep -Fx 'Antigravity: not installed' \
+    && REMOTE_DEV_ROLE=antigravity REMOTE_DEV_ENABLE_EXPERIMENTAL_ANTIGRAVITY=1 \
+      remote-dev-antigravity status --menu | grep -Fx 'Antigravity: not installed' \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@images/codex/Dockerfile` around lines 115 - 123, Update the Dockerfile
build-check environment before invoking remote-dev-antigravity status: set
REMOTE_DEV_ROLE to the Antigravity role and enable the required experimental
gate. Keep the existing status assertion and /root/.local/bin/agy absence check
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/remote-dev-antigravity.sh`:
- Around line 45-48: Remove the is_testing-based bypass from
require_antigravity_role and relocate the fixture path injection and role-bypass
behavior into a test-only harness excluded from the shipped image. Ensure
install and update operations always require the production
REMOTE_DEV_ROLE=antigravity and REMOTE_DEV_ENABLE_EXPERIMENTAL_ANTIGRAVITY
checks.

In `@scripts/remote-dev-doctor.sh`:
- Around line 141-142: Update status_command and its Antigravity status probe to
execute through run_binary_no_update, ensuring read_version_with_identity does
not invoke the installed agy binary without the existing timeout bound. In
scripts/remote-dev-doctor.sh, map a timeout result to status=1 while retaining
exit code 3 as non-fatal.

In `@scripts/runtime-smoke-test.sh`:
- Around line 118-121: Update the default-gate docker exec invocation in the
runtime smoke test to explicitly set
REMOTE_DEV_ENABLE_EXPERIMENTAL_ANTIGRAVITY=0 alongside
REMOTE_DEV_ROLE=antigravity, ensuring the command always exercises the
disabled-by-default path.

---

Outside diff comments:
In `@images/codex/Dockerfile`:
- Around line 115-123: Update the Dockerfile build-check environment before
invoking remote-dev-antigravity status: set REMOTE_DEV_ROLE to the Antigravity
role and enable the required experimental gate. Keep the existing status
assertion and /root/.local/bin/agy absence check unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e2897bfd-e1e1-4abb-88f5-6394dbf4b4fd

📥 Commits

Reviewing files that changed from the base of the PR and between 0dc5e4c and b924154.

📒 Files selected for processing (7)
  • images/codex/Dockerfile
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
  • scripts/remote-dev-doctor.sh
  • scripts/run-antigravity.sh
  • scripts/runtime-smoke-test.sh
  • scripts/test-role-neutral-runtime.sh
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: build
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{yml,yaml,Dockerfile,sh,bash,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{yml,yaml,Dockerfile,sh,bash,js,ts,tsx}: Never use privileged containers, Docker or Podman sockets, SYS_ADMIN, host-root mounts, or broad persistence mounts such as /root, /home, /opt, /usr/local, or a parent data root.
Preserve mandatory ttyd authentication for agent terminals, origin checking for all web endpoints, tmux reconnect behavior, image identity checks, and existing Codex login, start, and resume behavior.

Files:

  • scripts/run-antigravity.sh
  • scripts/test-role-neutral-runtime.sh
  • scripts/runtime-smoke-test.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
**/*.{sh,bash,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never use eval, sourced editable state, or user-controlled shell fragments for role, mode, installer, routing, or command dispatch.

Files:

  • scripts/run-antigravity.sh
  • scripts/test-role-neutral-runtime.sh
  • scripts/runtime-smoke-test.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
**/*.{sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{sh,bash}: Use fixed, validated enums for roles and start modes; reject unknown values with a deterministic non-zero exit status and a clear message.
Build command invocations with Bash arrays, preserve arguments without re-evaluating them, preserve command exit status, and run persistent-state hardening after supported interactive sessions.

Files:

  • scripts/run-antigravity.sh
  • scripts/test-role-neutral-runtime.sh
  • scripts/runtime-smoke-test.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
**/*.{yml,yaml,sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

Implement issue #25 in separately reviewed slices: role-neutral commands and validation, configurable Codex approval modes, canonical image and variable naming with time-bounded aliases, shared image digest, Compose and state migration, and outer hardening with cross-service canaries.

Files:

  • scripts/run-antigravity.sh
  • scripts/test-role-neutral-runtime.sh
  • scripts/runtime-smoke-test.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
**/*.{sh,bash,js,ts,tsx,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Run the narrowest relevant tests during development and complete required CI before merge; preserve or extend coverage for role/start-mode validation, wrappers, launcher security, mounts, image identity, health checks, Codex flows, credential hardening, ttyd, tmux, provenance, notices, SBOM, Trivy, and the critical-vulnerability gate.

Files:

  • scripts/run-antigravity.sh
  • scripts/test-role-neutral-runtime.sh
  • scripts/runtime-smoke-test.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
scripts/**/*.sh

⚙️ CodeRabbit configuration file

scripts/**/*.sh: Review as production Bash. Check quoting, set -euo pipefail behavior, cleanup traps,
bounded retries and timeouts, non-interactive execution, idempotency and useful failure messages.
Flag commands that can hang, leak credentials, silently ignore failures or mutate persistent data unexpectedly.

Files:

  • scripts/run-antigravity.sh
  • scripts/test-role-neutral-runtime.sh
  • scripts/runtime-smoke-test.sh
  • scripts/remote-dev-doctor.sh
  • scripts/lib/remote-dev-runtime.sh
  • scripts/remote-dev-antigravity.sh
images/**/Dockerfile

⚙️ CodeRabbit configuration file

images/**/Dockerfile: Review for reproducibility, supply-chain security and minimal image growth.
Require pinned upstream versions and checksum or digest verification for downloaded binaries.
Flag secrets, floating base tags, unsafe remote-script execution, broken multi-architecture logic,
cache misuse, unnecessary packages and changes that weaken the secure-by-default runtime.

Files:

  • images/codex/Dockerfile
🪛 Checkov (3.3.8)
images/codex/Dockerfile

[low] 1-164: Ensure that a user for the container has been created

(CKV_DOCKER_3)

🪛 Shellcheck (0.11.0)
scripts/test-role-neutral-runtime.sh

[info] 54-54: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 55-55: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)


[info] 57-57: Expressions don't expand in single quotes, use double quotes for that.

(SC2016)

🔇 Additional comments (16)
images/codex/Dockerfile (4)

13-19: LGTM!


60-63: LGTM!

Also applies to: 72-72, 87-90, 103-103


148-155: LGTM!


164-164: LGTM!

scripts/lib/remote-dev-runtime.sh (2)

12-35: LGTM!


58-74: 🎯 Functional Correctness

Start-mode and tmux-session contract is covered.

START_MODE=codex and START_MODE=antigravity reject mismatched roles with status 2, Antigravity maps to the antigravity tmux session, and the role-neutral test suite covers these cases.

scripts/remote-dev-antigravity.sh (3)

5-6: LGTM!

Also applies to: 64-69


121-130: LGTM!


552-553: LGTM!

scripts/run-antigravity.sh (1)

6-6: LGTM!

Also applies to: 16-25

scripts/remote-dev-doctor.sh (2)

40-41: LGTM!


143-150: LGTM!

scripts/runtime-smoke-test.sh (3)

116-117: LGTM!

Also applies to: 122-152


203-204: LGTM!


222-222: LGTM!

scripts/test-role-neutral-runtime.sh (1)

53-57: LGTM!

Comment thread scripts/remote-dev-antigravity.sh Outdated
Comment on lines +141 to +142
antigravity_status_code=0
antigravity_status="$(remote-dev-antigravity status --menu 2>&1)" || antigravity_status_code=$?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 8 \
  'remote-dev-antigravity|status --menu|timeout' \
  scripts/remote-dev-doctor.sh scripts/remote-dev-antigravity.sh

Repository: eXPerience83/remote-dev-containers

Length of output: 9325


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '--- outline remote-dev-antigravity.sh relevant functions ---\n'
ast-grep outline scripts/remote-dev-antigravity.sh --match 'antigravity_do|run_antigravity_status|status' --view expanded || true

printf '\n--- relevant regions in remote-dev-antigravity.sh ---\n'
sed -n '1,35p;135,160p;190,225p;430,520p' scripts/remote-dev-antigravity.sh

printf '\n--- doctor section around antigravity call ---\n'
sed -n '120,170p' scripts/remote-dev-doctor.sh

Repository: eXPerience83/remote-dev-containers

Length of output: 263


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- relevant sections in scripts/remote-dev-antigravity.sh ---'
sed -n '1,35p;135,160p;190,225p;430,520p' scripts/remote-dev-antigravity.sh

printf '%s\n' '--- doctor section around antigravity call ---'
sed -n '120,170p' scripts/remote-dev-doctor.sh

printf '%s\n' '--- search for status implementation ---'
rg -n -C 6 'status|antigravity_do|run_antigravity|execute|AGY_CLI_DISABLE_AUTO_UPDATE' scripts/remote-dev-antigravity.sh

Repository: eXPerience83/remote-dev-containers

Length of output: 11215


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

sed -n '516,570p' scripts/remote-dev-antigravity.sh

Repository: eXPerience83/remote-dev-containers

Length of output: 1452


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 8 'load_evidence\(\)|read_current_installation\(\)|load_evidence=' scripts/remote-dev-antigravity.sh

Repository: eXPerience83/remote-dev-containers

Length of output: 1746


Bound the Antigravity status probe.

status_command is only file/local-metadata limited, while read_current_installation still runs the installed agy binary via read_version_with_identity. That call does not use the existing bounded wrapper, so remote-dev-antigravity status --menu can hang. Route status_command through run_binary_no_update, and in scripts/remote-dev-doctor.sh map timeout to status=1 while preserving exit code 3 as non-fatal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/remote-dev-doctor.sh` around lines 141 - 142, Update status_command
and its Antigravity status probe to execute through run_binary_no_update,
ensuring read_version_with_identity does not invoke the installed agy binary
without the existing timeout bound. In scripts/remote-dev-doctor.sh, map a
timeout result to status=1 while retaining exit code 3 as non-fatal.

Source: Path instructions

Comment thread scripts/runtime-smoke-test.sh Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 713fea5af2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/remote-dev-antigravity.sh Outdated
Comment on lines +46 to +47
if is_testing; then
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the production test-mode gate bypass

In a default Codex or shell container, setting REMOTE_DEV_ANTIGRAVITY_TESTING=1 makes this guard return before role resolution; after supplying the four test path variables—using the bundled inspection JSON and the canonical production paths—remote-dev-install-antigravity --yes can still download and install the agent, and run-antigravity contains the same environment-controlled bypass. Fresh evidence beyond the prior entry-point finding is that the newly added role check is explicitly disabled by a variable any terminal process can set, so the optional role remains usable inside another role's service; keep the test bypass out of the shipped entry points.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

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.

feat: add the optional Antigravity installer, updater and launcher

1 participant