omp packages

@pots/pi-agy0.1.3

Gemini and the other models of a Google AI subscription in pi and Pots, through Google's unmodified Antigravity CLI (agy acp)

GitHub Actions Published 8 hours ago MIT ~630 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-agy

Run your Pots bots on the Google AI Pro or Ultra plan you already pay for: Gemini 4 Neon, Carbon and Hydrogen, the Orchestrators, and the Claude models Antigravity gives the account. No API key and no separate bill.

pi-agy hands each run to Google's own Antigravity CLI (agy), the way Antigravity's terms allow. It is a pi extension, for Pots and other hosts built on pi (see The pi CLI).

pi-agy is not made or endorsed by Google. Antigravity is Google's product.

Why pi-agy

  • Within Antigravity's terms. It runs Google's agent as you installed it, through agy acp, and never reads Antigravity's sign-in token.
  • Faster. Read a file, run a command, react and reply: the reply comes after 22–24 s, against 57 s with pi-antigravity-acp-provider.
  • Lighter. One agy process serves every conversation of the host, 233–297 MB with a main agent and a child, against about 450 MB per session.
  • What it costs. Google's agent brings its own prompt and checks each tool call, so a run takes a little more time and context than a bare model call. Details below.

Use it in Pots

pots login

Choose "Sign in with a subscription", then "Google AI Pro or Ultra: Gemini and more through Antigravity". It adds pi-agy, installs agy with Google's own install script when it is missing (it asks first), and signs in with Antigravity's own sign-in: a link, then the code the page shows, which also works over SSH. Then restart the gateway (pots service restart) and give a bot one of the account's models:

{ "model": "agy/gemini-4-neon" }

pots login --list shows them all. The bot's thinking level picks the model's level (low, medium, high, xhigh).

You need Node.js 24 or newer and a Google AI Pro or Ultra subscription. A host other than Pots loads pi-agy as the pi extension npm:@pots/pi-agy.

The pi CLI

Today Google's backend refuses requests whose system prompt says that they run inside pi. The pi CLI's default system prompt says so, so with it every request fails with HTTP 429 (RESOURCE_EXHAUSTED), whatever quota the account has left, and pi-agy stops it after about a minute with an error. pi-agy therefore does not work with the pi CLI's default prompt.

How it reaches Gemini, and why this way

Antigravity's terms (changed 2026-12-01) allow running the unmodified Antigravity harness through its supported interfaces: a third-party interface over the Agent Client Protocol (ACP), headless use, MCP servers, hooks and prompt extensions. They forbid using Antigravity's OAuth tokens in other software, using the harness as a raw model proxy for another agent loop, and sharing an account among several people. Breaking them can suspend the account's Antigravity access.

  • Extensions that take Antigravity's sign-in token and call Google's model endpoint directly, or that strip the harness to use it as a raw model, are what the terms forbid.
  • pi-agy hands each run to Google's own agent through agy acp, the CLI as the user installed it, with documented flags only. AGY runs the turn with its own harness: its system prompt and context (about 10,000 tokens of its own with every request, on top of the host's), its own tools for files, commands and web search, and its own safety checks. The host's prompt goes in as an appended system prompt, a supported prompt extension, and the host's other tools reach AGY over MCP. pi-agy never reads Antigravity's sign-in, and it never turns on AI credits.

So the model works in the harness Google built for it, and a run costs a bit more time and context than a bare model call would.

pi-agy and pi-antigravity-acp-provider

Both talk ACP to Google's harness. We measured both on the same Pots bot on Linux, with Gemini 4 Neon at thinking level xhigh, on 2026-12-01 (pi-antigravity-acp-provider 0.1.24):

pi-agy pi-antigravity-acp-provider
Read a file, run a command, react and reply: the reply after 22–24 s 57 s
… the whole run 28–31 s 65 s
The host's tool calls in AGY's own record all completed 27 of 27 cancelled: each tool call ends the AGY turn, and its result comes back as a new prompt
The host's system prompt changes (for example AGENTS.md or memory) same AGY session, nothing lost new AGY session with only the last ~32,000 characters of the conversation
The host rewrites the history (compaction, a new page) new AGY session with the whole history the last ~32,000 characters
Memory one agy process for every conversation of the host: 233–297 MB with a main agent and a child about 450 MB per session
Google's software the agy CLI from Google's install script, the same one you use in a terminal Google's ACP server, downloaded separately (~850 MB unpacked on Linux)

How it works

  • AGY runs the agent loop. One run of the host is one turn of AGY's agent. When AGY calls one of the host's tools, the call waits; the host's model request ends with that tool call; the host runs the tool; its next request brings the result back to the waiting call, and the same AGY turn goes on. Messages that arrive meanwhile steer the turn.
  • AGY's own tools for files and commands (read_file, write_file, edit_file, run_command, search_web) replace the host's read, write, edit, bash, grep and find. The host's other tools (in Pots: send, react, call, task, screen, codemode) go to AGY over MCP, as mcp_pi_<name>. A host can turn AGY's own tools off for a conversation (native: false, below); its own tools then go over MCP too.
  • One agy acp process serves every conversation of the host process, each in an AGY session of its own. A conversation keeps its session across restarts (session/resume); a conversation that the host rewrites gets a new one with the whole history.
  • pi-agy's hooks (.agents/hooks.json in the folder agy acp runs in, so they apply to its sessions only): AGY's own tools may not read or change the paths the host protects; AGY's subagents, workflows, schedules and swarms are off (setting agyAgents); the host's masking of known secrets applies to the output of AGY's commands and file reads.
  • The host's command environment reaches AGY's commands through BASH_ENV, per session. On Windows, where AGY runs commands in PowerShell, pi-agy's hook puts it at the start of each command, and AGY tells the model that a hook changed the command line.

Tool environment (for hosts)

A host that runs several agents in one process passes toolEnvironment with each request:

{ conversation, cwd, env, mask, protect, native }

conversation keeps forks of one session apart; cwd and env are where and with what the host's own commands run; mask masks known secrets in text; protect lists paths AGY's own tools must not touch; native: false turns AGY's own file and command tools off for the conversation. Without it, AGY works in the host process's folder and environment.

Settings

Optional, in ~/.pi/agent/pi-agy/settings.json (or $PI_AGY_HOME/settings.json): command (the agy command), agyAgents (true: AGY's own subagents, workflows, schedules and swarms may run), nativeTools (the host tools AGY's own replace), protect (more paths to keep AGY's own tools away from).

What to know

  • AI credits stay off. When the subscription's quota runs out, Antigravity can spend paid AI credits if they are on. They are off by default; keep them off (in agy, /config → Use AI Credits). pi-agy does not run while they are on.
  • Quota. /usage in agy (or agy usage) shows what is left of the account's 5-hour and weekly limits.
  • Failed model requests. agy retries a model request that fails, and says so only in its log; each attempt sends the whole request again. pi-agy reads that log (it names it with --log-file: ~/.gemini/antigravity-cli/log/acp-server-<time>-pi-agy-<pid>.log, in agy's own log folder). When Google keeps answering one request with an error for about a minute, pi-agy stops the turn with an error that says so:
    • HTTP 429 (RESOURCE_EXHAUSTED): Google answers it when the quota is used up, and also when its backend refuses a request, as it does for some system prompts. agy retries it for many minutes. The host does not retry this error.
    • HTTP 503 (UNAVAILABLE, "No capacity available for model …"): Google has no capacity for the model now. agy retries a 503 9 times in about 2.5 minutes. The error names Google's answer, and the host's own retry rules decide when to try again. Other server errors (5xx) go the same way.
  • A failed turn. When agy's retries end without an answer, or a turn fails for another reason, agy acp ends the turn as if the model had answered, with the error as its last words (⚠ …). pi-agy gives the host that error as the request's error, not as the model's answer, when agy's log reported the error too (or there is no log); a model's own words of that form stay its answer. A used-up quota is final; anything else the host's retry rules judge.
  • Data. Google receives what the agent sees, under Antigravity's terms. In agy, /config → Enable Telemetry decides whether Google may also use it to improve its products.
  • Speed. AGY adds its own steps, such as a closing summary after the last tool call, and checks each call of a host tool with its own safety monitor (about 1 to 1.5 seconds, more when the call looks risky).
  • Long host tools. AGY gives up on a tool call after 3 minutes. pi-agy tells AGY at 150 seconds that the tool still runs, and the result comes to AGY later as a message.
  • Not the host's tools. AGY's own commands do not run under the host's own command machinery (in Pots, a systemd scope per command), and the host sees them only as records: in its trace and as notes in the answer.

Develop

npm install
npm run check
npm test   # with a scripted stand-in for agy acp, no account needed

Releases: add the version's section to CHANGELOG.md, npm version <x.y.z>, then push the commit and the tag. The tag starts .github/workflows/release.yml, which publishes to npm with trusted publishing.

MIT license.