Files
PaperClipAI/doc/adapter-model-audit-2026-11-22.md
DottaandClaude Fable 5.2 78e4f4f130 feat(runner): Antigravity on ACP 1.5.2 with Linux, API-key auth and Gemini 4 Neon (still pending) (#22591)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The native Runner starts each agent harness and owns its lifecycle,
credentials and recovery
> - Google Antigravity is Google's only first-party coding harness, and
it is the harness for Gemini 4 Neon
> - The Runner had an Antigravity integration, but only as a pending
candidate: ACP server 1.4.3, macOS ARM64 only, Google sign-in only,
closed unless an operator opened it for one company and one model
> - Cloud sandboxes run Linux and use API keys, so the candidate could
not run there, and it had one attended test cell
> - This pull request moves the integration to ACP server 1.5.2, makes
it run on Linux and with a Gemini API key, adds the tests the other ACPX
harnesses have, and removes the code paths that would block recovery
after release
> - The benefit is that the release of Antigravity becomes a small
declaration change after the live suites pass. The profile stays
`pending` in this pull request.

## Linked Issues or Issue Description

Refs #98
Refs #6559
Refs #8523
Refs #21121 (a separate legacy-style `agy_local` adapter that uses the
CLI print protocol; this pull request does not replace or include it)

## What Changed

**Runtime**
- Pin Antigravity ACP server 1.5.2 (was 1.4.3). Owned admission patch is
`1.5.2-paperclip.2`.
- Verified patched closures for `darwin-arm64`, `linux-x64` and
`linux-arm64`. `darwin-x64` stays inventory-only.
- The patcher reads Mach-O and ELF builds. It signs macOS output only.
One admission source serves all platforms.
- Platform gates in TypeScript, Rust, the sidecar schema and the server
admit each host that has a verified closure.

**Auth and models**
- Gemini API-key auth reaches an exact-model session receipt. Admission
accepts a model only when the base model and the thinking level both
match the requested ID.
- API-key connections get a model list on local and cloud environments.
The list is generated at build time from the pinned runtime. The server
starts no process to read it.
- Gemini 4 Neon, Carbon, Argon and Hydrogen are selectable. The picker
marks them "needs a paid Gemini API plan" for API-key connections.
- One shared module maps model ID to family and thinking level.
- `google/gemini-4-neon` is added to the OpenCode model list. A new
model audit is in `doc/adapter-model-audit-2026-11-22.md`.

**Lifecycle and failures**
- A provider error no longer completes the turn. The driver classifies
it: overloaded, rate limit, quota, auth rejected, model unavailable.
- Overload retries are bounded (3 attempts, about 14 seconds).
- A refused session reload maps to incompatible saved state, so the
automatic replacement conversation applies.
- Server gates that refused restart recovery, remote targets and shared
state for Antigravity now apply only while the profile is pending.
- A Google sign-in connection with a cloud environment is refused at
save and at Test, with a plain message.
- A released profile rejects candidate grants in TypeScript and in Rust.

**Launch cost and integrity (all native ACPX providers)**
- Each closure is verified one time into a sealed read-only store. Later
launches check file identities and hash the exact executable they start.
- Remote provider-pack verification is recorded per sandbox lease. Later
runs check kernel identity and fall back to the full hash on any
difference.
- Superseded stores are removed in the background after a launch.

**Provider pack and image**
- The provider pack carries Antigravity for `linux-x64` as a candidate
provider. It becomes an ordinary provider from the profile status alone.
- The Daytona image build accepts the candidate. A credential-free smoke
runs in the build.

**Tests and CI**
- New `antigravity-qualification` suite: 24 cells, local and Daytona.
- New model lineup suites: 14 API-key cells and 14 Gemini 4 cells. Each
cell requires the exact model in the Runner receipt.
- Antigravity can run the `chat-features` cases with `--profile
runner-acpx-antigravity`.
- `runner-full-stack-e2e.yml` passes `GEMINI_API_KEY` for the new
profile and derives candidate providers from the selected Daytona cells.

**Docs**
- `doc/plans/2026-11-22-antigravity-qualification.md` is the current
release contract, acceptance ledger and operator recipe.

## Verification

Commands that passed on the final revision:

- `pnpm build`
- Typecheck for all packages, including the runner-e2e test projects
- `pnpm test:e2e:runner:unit`: 11,665 Vitest tests passed, 25 skipped;
386 node tests passed
- `cargo test -p paperclip-runner-core -- --test-threads=4`: 1,199
passed, 2 failed. The 2 failures are Codex transport timing tests that
pass alone and on `master`.
- `cargo fmt --check`, `check:acpx-profiles`, `check:protocol-types`,
`node scripts/check-maps.mjs`
- Native patch tests: 9 of 9 on `darwin-arm64` and 9 of 9 on `linux-x64`
- UI picker tests: 397 of 397

Known failures that also fail on `master`:

- 11 runner package script tests (browser, Pi and package-boundary
checks)
- 6 `runtime-selection` tests that read an untracked local skill file

Live evidence, without a prompt:

- Clean provisioning on `darwin-arm64` and on `linux-x64` in a Daytona
sandbox. The closure digests reproduce. A changed or missing file is
rejected.
- `initialize` reports 1.5.2. An API-key session returns a receipt for
exactly `gemini-3.8-flash-low` and the exact instruction bytes, on both
platforms.
- All 28 model IDs (14 Gemini 3, 14 Gemini 4) return an exact receipt
under an API key.
- A session survives a process kill and resumes in a new process with
exact receipts, on both platforms.
- The server's remote path verifies the provider pack in a Daytona
sandbox.
- Run start to native `initialize`: 3.45 s to 1.46 s on macOS, 3.65 s to
1.74 s on Linux x64, before the per-launch executable hash was restored
(about 60 ms on macOS; not measured on Linux).
- Remote pack verification on a reused sandbox lease: about 4.3 s to
about 0.25 s.

Live evidence, with a prompt, on an already-released harness:

- Pi native, `pi-native.runner-acpx-pi.local.agent-files-fresh-run`, on
`darwin-arm64` at `427e9b088b`: 1 of 1 passed, 14 of 14 checks, both
native runs succeeded (25.5 s and 25.7 s). The process started from the
new launch store with no fallback warning.
- The same cell and `native-pending-controller-restart` failed in the
paid workflow on this branch and on `master` in the same way, before any
native start. The workflow does not install the Pi runtime for local
cells, so the agent setup check fails. That is a workflow gap, not part
of this change.

**Not run.** No Antigravity prompt completed on 1.5.2 on any platform.
The only Gemini key available is on the free tier, and Google returned
503 or 429 for each attempt on two days. These gates are open:

- All 24 `antigravity-qualification` cells
- Both model lineup suites, including inference on Gemini 4 Neon
- The attended Google sign-in journey on 1.5.2
- The chat cases under Antigravity
- Image pull time and startup time on a published image
- A native start on `linux-arm64`
- A live provider-death cell for Kimi, Pi or Copilot on the new launch
store (one ordinary Pi cell passed live; see above)

## Risks

- **The launch store changes how every native ACPX provider starts**
(Kimi, Copilot, Cursor, Pi), not only Antigravity. A review found two
defects in the first version (an executable swap was possible, and Pi
launches broke). Both are fixed with tests. One live Pi cell passed on
this branch on macOS. No live provider-death cell and no Linux cell ran
for those providers.
- The profile digest changes. Saved Antigravity candidate sessions and
existing candidate grants stop working. The new release refuses old
state by name and starts a replacement conversation.
- The Linux provider pack and the Daytona image grow by about 834 MB
(about 274 MB compressed) when Antigravity is included.
- The pack verification record is in server memory. The first run after
a server restart pays the full hash again.
- Antigravity 1.5.2 reads the workspace `GEMINI.md` and `AGENTS.md` as
user rules. This is deliberate and matches Codex. Any other rule file is
refused.
- Orchestrator mode is not available. ACP server 1.5.2 does not expose
it.
- Antigravity stays `pending`. Normal users cannot run it until a later
change removes the pending status.

## Model Used

- Claude Fable 5.2 (`claude-fable-5-2`) planned, briefed and integrated
the work, with tool use.
- Claude Opus 5.5 (`claude-opus-5-5`) subagents wrote the code and ran
the tests, with tool use and code execution.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 08:21:11 -06:00

6.5 KiB

Adapter model audit: November 22, 2026

This audit follows the November 18, 2026 audit. It adds Gemini 4 Neon where its neighbouring Gemini 4 models already appear, records the Google Antigravity model catalog for the pinned ACP server 1.5.2, and maps which Gemini models each Google sign-in route can reach. Catalog entries identify models; accounts, plans and keys determine access. No agent defaults or saved model selections are migrated.

Model changes

Adapter Change
OpenCode Add google/gemini-4-neon to the static fallback, ahead of Carbon, Argon and Hydrogen.
Google Antigravity (Paperclip Runner) API-key connections now get a model list on every environment, generated from the pinned runtime: 14 Gemini 3 models, then the 14 Gemini 4 models marked as needing a paid Gemini API plan. Google sign-in still reads the account's own list on the Paperclip host.
Gemini CLI, Cursor No change. Neither list carries a Gemini 4 model, so Neon is not added on its own. Gemini CLI support for Gemini 4 stays deferred as in the November 18 audit.
Claude Code, Codex, Grok Build, Kimi Code, Pi, Hermes No change.

Google Antigravity model catalog (ACP server 1.5.2)

A model ID is <family>-<level>: the family is the base model and the level is its thinking level. The server's levels are minimal, low, medium, high and extra_high. A Google account's own list spells extra high as xhigh, adds max, and keeps five legacy IDs that do not spell their level (for example gemini-3-flash-agent is Gemini 3.5 Flash at high). One shared module, packages/shared/src/antigravity-models.ts, parses and formats every spelling; each ID formats back to itself.

Family Levels, in the server's order API key Notes
Gemini 3.8 Flash high, medium, low Listed (default gemini-3.8-flash-high)
Gemini 3.7 Flash high, medium, low Listed
Gemini 3.6 Flash high, medium, low Listed
Gemini 3.5 Flash high, medium, low Listed
Gemini 3.1 Pro high, low Listed Sent as gemini-3.1-pro-preview
Gemini 4 Carbon medium, high, low Selectable, needs a paid plan Agent Platform default is gemini-4-carbon-medium
Gemini 4 Neon high, extra_high, medium, low Selectable, needs a paid plan
Gemini 4 Hydrogen high, extra_high, medium, low Selectable, needs a paid plan
Gemini 4 Argon high, medium, low Selectable, needs a paid plan Vertex serves it only at location global

No family offers minimal in 1.5.2. The earlier 25-model API-key lineup (five families times five levels) was wrong; the real list has 14 models.

node packages/paperclip-runner/scripts/generate-antigravity-models.mjs writes packages/shared/src/antigravity-models.generated.ts on darwin-arm64. It starts the pinned, patched runtime with a placeholder API key (the server does not check the key and builds this list locally), opens one session without a prompt, and reads its model list. It also reads the families and levels from the server's own catalog table in the verified vendor archive and stops if the two disagree. The file records the runtime version and the darwin-arm64 vendor archive and closure digests. Its --check mode runs in the runner's TypeScript build and fails when the checked-in runtime declaration changes or the file was edited by hand.

Routes to each model

Route Gemini 3 (Flash, 3.1 Pro) Gemini 4 (Carbon, Neon, Hydrogen, Argon) State
Personal Google sign-in Whatever the account's list offers Whatever the account's list offers Local Paperclip host only. Not exercised with a Gemini 4 account.
Gemini API key Listed by the server Not listed; selected through Paperclip's exact-model admission Local and cloud environments. Gemini 4 needs a key on a paid plan with Gemini 4 quota.
Agent Platform (Vertex) Listed Listed Advertised by the server; Paperclip has no Agent Platform connection.

How a Gemini 4 model runs with an API key: the server marks the Gemini 4 families agent_platform_only, so a session started on its default model refuses a later set_model to Neon. Paperclip does not start that way. Its exact-model admission asks for the requested model when the session is created. The server then keeps the model as a "custom model", sends the base model with the thinking level to the Gemini Developer API, and the owned admission patch checks that both match the requested ID before it acknowledges the session. This needs no change to the admission patch and no AGY_ACP_DEFAULT_MODEL.

Sources and verification

Research date: November 22, 2026.

  • The pinned server's model_selection.py (ACP server 1.5.2, darwin-arm64 archive 123a16d5…4845) defines the families, their levels, agent_platform_only, the account level spellings (xhigh, max) and the legacy IDs.
  • Live, prompt-free check on darwin-arm64: one gemini-api-key session listed exactly the 14 IDs above, with gemini-3.8-flash-high current. The generated file is that list.
  • Live, prompt-free check of admission: for all 28 IDs (14 Gemini 3 and 14 Gemini 4) a session created with Paperclip's admission request returned an admission receipt for the exact ID, and session/set_model to the same ID was accepted. As a control, set_model to gemini-4-neon-high on a default API-key session was refused with "not available for the current authentication method".
  • The Gemini Developer API model list for the test key includes models/gemini-4-neon, gemini-4-carbon, gemini-4-hydrogen and gemini-4-argon, all with thinking. The key is free tier, so no prompt was sent; Neon inference on a paid key is not yet observed.
  • OpenRouter's public model list (/api/v1/models) includes google/gemini-4-neon (and a :batch variant). The models.dev registry that OpenCode reads lists gemini-4-neon under google, google-vertex and openrouter.

Open items

  • Observe one accepted Neon prompt per level with a Gemini API key on a paid plan; until then the Gemini 4 API-key lineup is admitted but not inferred.
  • When Google refuses a model at run time (quota of zero, unknown model, or an auth-method refusal), the run should show the plain-language message from antigravityModelRefusalMessage instead of the provider's text. The runner driver owns that classification.
  • Agent Platform connections and remote Google sign-in remain open decisions in the qualification plan.