Original text(via HN AI)
…PI (#1317)
Google lets third-party apps run Gemini on a user's Google AI plan quota
through the Interactions API's per-user quota endpoint
(POST /v1beta/interactions:createPerUserQuota), signed in with the app's
own Google-approved OAuth client. pi (earendil-works/pi#12614) and Hermes
Agent (NousResearch/hermes-agent#159701) already target it. This adds the
same route to the antigravity harness as --google-auth google-ai-plan, so
nanocode is ready once its own client is approved.
- Sign-in (PlanLogin, PlanAuth): Google OAuth for a Desktop app client
with a loopback redirect on http://127.0.0.1:PORT/oauth2callback, PKCE,
an OIDC nonce and a DPoP key (RFC 9449, ES256 over nanocode-tempo's
P-256). The code exchange proof uses the code's hash as jti; refreshes
retry once with Google's DPoP-Nonce and once with its Date for clock
skew; invalid_grant and unauthorized_client ask to sign in again. The
client comes from NANOCODE_GOOGLE_AI_PLAN_CLIENT_ID and
NANOCODE_GOOGLE_AI_PLAN_CLIENT_SECRET and is saved with the sign-in in
~/.nanocode/google-ai-plan.json (PlanStore, the same locked atomic
writer as the Antigravity subscription, now generic over the type).
- Wire: the harness's generateContent body becomes one stateless
Interactions request (store: false): contents become user_input,
thought, model_output, function_call and function_result steps, a
thought signature the harness carried onto the next part goes back on
its thought step, a call with none gets skip_thought_signature_validator,
calls without ids get stable ones paired with their responses, and
Gemini schemas become JSON Schema. The SSE steps come back as the same
Parts, usage and finish reasons the other routes give. googleSearch,
explicit caches, thinkingBudget and unknown fields are refused, not
dropped. A daily-limit 429 fails at once with a plan hint.
- CLI: nanocode login google-ai-plan, /login google-ai-plan (and
/login google plan), --google-auth google-ai-plan, setup google --check
for it, and auto selects a saved plan sign-in before a saved Antigravity
subscription.
Checked with a harness in output/plan-check against a mock Sender: login
(PKCE S256, state, loopback-only redirect, scope and ID token checks,
single use), every DPoP proof verified with graviola's independent P-256
verifier, refresh nonce and clock-skew retries, the request and replayed
steps compared field by field, streamed thoughts, text and call
arguments, usage, a cut stream, a refused googleSearch tool, a daily
limit that is not retried, and a 401 that refreshes and retries.
scripts/check: check, tidy, machines, canaries, memory and sim (63
scenarios, 163 pass jobs x 8 seeds, 460 canaries) green; check-wasm of
the touched crates green once the wasm32 target was installed.
Not yet tried against Google: nanocode has no approved client.