Skip to content

feat(installer): install the Antigravity plugin with --harness antigravity - #7715

Open
fancyboi999 wants to merge 6 commits into
volcengine:mainfrom
fancyboi999:feat/install-antigravity
Open

fancyboi999 wants to merge 6 commits into
volcengine:mainfrom
fancyboi999:feat/install-antigravity

Conversation

@fancyboi999

@fancyboi999 fancyboi999 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Stacked on #7710: this branch contains its four commits, and only the last two commits (feat(installer): … and fix(installer): …) are new here. I will rebase it onto main after #7710 merges. gh stack cannot link the two on GitHub because a PR from a fork cannot use another fork branch as its base.

#7710 adds the Antigravity host adapter but leaves installation to manual steps. This PR adds --harness antigravity to install.sh, so the Antigravity desktop app and the agy CLI install like the other config-driven hosts:

curl -fsSL https://openviking.ai/install | bash -s -- --yes --harness antigravity

Antigravity loads plugins from directories, ~/.gemini/config/plugins/<name>/{plugin.json,hooks.json}, and its hooks.json keys each entry by hook name. That shape is different from the { "hooks": { … } } files host-json-config.mjs merges. Antigravity also owns the whole plugin directory, so nothing has to be merged. The installer therefore:

  • assembles the runtime under ~/.openviking/agent-integrations/antigravity, the same way the other hosts do;
  • writes ~/.gemini/config/plugins/openviking-memory as a whole. Each command points at the installed scripts/hook.mjs with the usual OPENVIKING_INTEGRATION_ID env prefix and a # openviking-memory tag;
  • leaves a same-named directory in place, on install and on uninstall, unless its hooks.json passes the existing ownsHook() check. A plugin written by the manual steps from feat(agent-hook-plugin): add Antigravity (app and agy CLI) as a host adapter #7710 passes the check and is replaced.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Part of #7709

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • install.sh:
    • --harness antigravity and an entry in the selection list.
    • Detection: agy on PATH, or ~/.gemini/config, which both the app and agy create. The check does not look in /Applications, because that path is machine-wide and would leak into the TUI tests' temporary homes on a Mac that has the app.
    • install_antigravity, uninstall and validation. Validation checks the files, the rendered command, node --check, and a smoke run with memory disabled.
    • Plan and next-step output.
    • Both shared-runtime cleanup guards now include antigravity, so removing Cursor or a legacy TRAE CLI install does not delete the runtime that Antigravity still runs from.
  • Everything new lives in install.sh, not in memory-plugin-shared/lib/. A change to lib/ counts as a change to every plugin in check-plugin-version-bumps.sh.
  • install-agent-hooks.test.mjs, two new tests:
    • Install over a hand-made copy, check the rendered hooks and run one through sh -c as Antigravity does, check that removing Cursor keeps the shared runtime, and uninstall.
    • A foreign directory of the same name is kept on install and on uninstall.
  • Docs (en/zh) and the README host notes: the installer command and the uninstall command replace the manual steps.
  • Bump agent-hook-plugin from 0.5.32 to 0.5.33, with the host manifests, because its README changed.

Intentionally out of scope:

  • MCP. Antigravity keeps all MCP servers in one shared ~/.gemini/config/mcp_config.json, with its own schema (serverUrl for HTTP servers). Users often have an openviking entry there already, so the docs keep MCP as a manual step.
  • HARNESS_KEYS in config-schema.mjs. Adding the key is only needed for per-harness overrides in ovcli.conf. Through sync.mjs it would also touch the Claude Code and Codex plugins, so it can be a separate change.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

All commands ran on macOS with Node 26.

Check Result
node --test on examples/*/tests, memory-plugin-shared/*.test.mjs and lib/install/*.test.mjs 1230 tests: 1211 pass, 11 fail, 8 skipped. The 11 failures are the same set with and without this commit. 10 are in pi-coding-agent-extension (its dependencies are not installed in this checkout). 1 is the pre-existing install-tui "listed again just before the onboarding link" failure noted in #7710.
install-tui.test.mjs 33 pass and the same 1 pre-existing failure. An earlier draft that also detected /Applications/Antigravity.app failed 5 detection tests on this Mac, which led to the detection rule above.
Mutation check Removing the ownership check, or the antigravity shared-runtime guard, makes one of the new tests fail.
check-plugin-version-bumps.sh against origin/main and against the #7710 branch pass (0.5.31 → 0.5.33 and 0.5.32 → 0.5.33)
sync.mjs, then git status no generated changes
bash -n install.sh, check-docs-consistency.mjs pass

Real host check. I installed with install.sh --source dev --harness antigravity into the real home. OPENVIKING_CLI_CONFIG_FILE pointed at a temporary file, so the existing ovcli.conf stayed unchanged. Then a new agy 1.5.9 print-mode session answered from recalled memory without calling tools. Antigravity ran the env-prefixed commands through its shell. The hook state recorded lastStep, and the server session ag-<id> reports commit_count: 1, against OpenViking server 0.5.0.

The Antigravity desktop app was then checked with the same installer-written plugin. A new app conversation showed the "Hook Json SessionStart" and "Hook Json PreInvocation" steps. Its hook state recorded the recall and lastStep, and the server session ag-<id> reports commit_count: 1.

Not covered: Linux and Windows.

…adapter

Antigravity runs PreInvocation before every model call, so recall runs
only on a turn's first call (invocationNum 0), deduplicated per turn.
Context returns as an injectSteps system message. Stop carries no text:
capture reads the finished steps of transcriptPath after the last
captured step, in a detached worker, and commits. Sessions are ag-.

Refs volcengine#7709
…input

Assistant replies that quote the host's request envelope were reduced to
the quoted text, or dropped when the quote was an empty template, and the
capture cursor had already moved past them. Unwrap only a USER_INPUT
record whose content opens with the envelope; assistant text and the
recall prompt only lose injected openviking-context blocks.
@r266-tech

Copy link
Copy Markdown
Contributor

I found a validation false negative on 2eca8f8bc4c4e8740d25956ffc0f7aaf0905e478 when HOME or the supported OPENVIKING_HOME override contains an apostrophe.

Using the real install.sh --source dev --harness antigravity --yes with isolated temporary homes:

Path Installer exit Installed SessionStart command via sh -c, memory disabled
Plain path 0 0
Path containing spaces 0 0
HOME ending in Agent's Space 1: plugin installation is incomplete 0
OPENVIKING_HOME ending in O'Reilly runtime 1: plugin installation is incomplete 0

The renderer correctly quotes the path for the shell, but validate_install() checks grep -qF "$ag_root/scripts/hook.mjs" "$ag_hooks". A literal apostrophe in the filesystem path is represented as '"'"' in the command, so the raw path is no longer a contiguous substring. The files and usable hook command have already been installed when validation reports failure.

Could validation use the rendered representation or the actual command/runtime contract rather than searching for the raw path? An apostrophe-path control alongside the new install test would protect this boundary.

The existing install-agent-hooks.test.mjs suite passes (17/17). AI-only validation on macOS arm64/Node 26.13.1, local dev source and loopback configuration; no Antigravity/agy, real server, release archive or Windows run.

@fancyboi999

Copy link
Copy Markdown
Contributor Author

Thanks, confirmed and fixed in e9189fe.

validate_install() no longer searches for the raw path. It reads the rendered SessionStart command from hooks.json and runs it through sh -c with OPENVIKING_MEMORY_ENABLED=0, which is how Antigravity runs it. That replaces the direct node hook.mjs smoke run, so the check now covers the quoting too.

Verification:

Case Before After
New test: HOME ending in Agent's Space (install, SessionStart and Stop via sh -c, uninstall) fails: plugin installation is incomplete passes
Real install.sh --source dev --harness antigravity --yes with OPENVIKING_HOME ending in O'Reilly runtime exit 1 exit 0
install-agent-hooks.test.mjs 17/17 18/18

Ran on macOS arm64, local dev source, loopback URL. No real Antigravity/agy session or Windows run for this change.

@r266-tech

Copy link
Copy Markdown
Contributor

Confirmed on e9189fe559eef1691e880980d13175bd8adb4785: the validation false negative from my earlier comment is fixed.

node --test examples/memory-plugin-shared/install-agent-hooks.test.mjs passes 18/18. I also reran the real dev-source installer in four isolated cases: a plain path, spaces, HOME ending in Agent's Space, and OPENVIKING_HOME ending in O'Reilly runtime. All four install with exit 0; both rendered SessionStart and Stop commands execute successfully through sh -c with memory disabled; uninstall exits 0 and removes the managed plugin/runtime.

AI-only verification on macOS arm64 / Node 26.13.1, temporary homes and loopback configuration. No real Antigravity/agy session, server, release archive, Linux or Windows run. Thanks for adding the regression coverage.

… wakeups

When a background task, subagent reply, timer, or Stop continuation wakes an Antigravity turn, PreInvocation runs again with invocationNum 0, a higher initialNumSteps, and lastUserInput still holding the earlier prompt. Keying prompt_id by initialNumSteps bypassed promptEventId deduplication and re-injected the cached recallBlock into the trajectory on every wakeup.

Resolve the active user turn from transcriptPath instead: skip recall when a MODEL step has already run since the latest USER_EXPLICIT USER_INPUT step, and key prompt_id by that user step (step_index + 1) so each user turn injects once while still recalling on genuine repeated prompts.
@fancyboi999
fancyboi999 force-pushed the feat/install-antigravity branch from e9189fe to d3b1307 Compare November 16, 2026 04:50
…l steps

Backgrounded run_command steps (MODEL/GENERIC with status RUNNING) and failed or invalid tool steps (ERROR, INVALID) stay non-DONE permanently in Antigravity transcripts. Breaking on every non-DONE step froze lastStep before all subsequent turns in that conversation.

Advance lastStep past non-captured step types regardless of status. On captured turn records (USER_EXPLICIT USER_INPUT and PLANNER_RESPONSE), hold the cursor only while the step is in progress (PENDING, QUEUED, WAITING, RUNNING, GENERATING), and skip terminal non-DONE records (CANCELED, ERROR, INVALID, ...) without blocking later turns.
…avity

Antigravity (the desktop app and agy) loads plugins from directories under
~/.gemini/config/plugins, each a plugin.json and a hooks.json keyed by hook
name. The installer now assembles the runtime under
~/.openviking/agent-integrations/antigravity and writes the plugin
directory whole, with commands rendered to the installed runtime and the
integration env prefix. A directory of that name the installer did not
write is left in place, on install and on uninstall.

Antigravity is detected by agy on PATH or its configuration directory,
offered in the selection list, validated with a smoke run, and kept in the
shared-runtime cleanup guards so removing another host does not remove the
runtime it uses. MCP stays manual: Antigravity keeps it in a shared
mcp_config.json with its own schema.
… command

The renderer shell-quotes the runtime path, so a path with an apostrophe
appears in hooks.json as '"'"' rather than verbatim, and the grep for the
raw path reported a complete install as incomplete. Validation now reads the
SessionStart command from hooks.json and runs it through sh with memory
disabled, the way Antigravity runs it. A test installs under a home path
containing an apostrophe.
@fancyboi999
fancyboi999 force-pushed the feat/install-antigravity branch from d3b1307 to 42038c7 Compare November 16, 2026 05:04

This branch has not been deployed

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants