antigravity 0.1.1, antigravity-cloak 0.1.3: two zero-width spaces a word, and a 429 says it is a 429 (shzutbi1 on X)

Google turns Claude Code's billing line and "built on Anthropic's Claude
Agent SDK" away again when only the first letter is broken (checked on a
real Antigravity account with Claude Code 2.1.316's prompt); a break after
the first and the second character of each word goes through, 3 of 3.
Both packages break every run of three or more letters or digits that way.
antigravity's error for a turned-away prompt said "400 ... as from an
unapproved channel" about what Antigravity answered as a 429; it now says
"Antigravity answered 429 to this system prompt".

bun test packages/antigravity packages/antigravity-cloak on mote: pass.
cases.json expectations regenerated for the new breaks.
This commit is contained in:
yetone
2026-11-11 03:54:21 +08:00
parent 450279c4e0
commit d5f4214eff
8 changed files with 43 additions and 26 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ Antigravity answers a request whose system prompt reads as Claude Code's or the
- Codex's own prompt for its GPT-5 models, `You are Codex, an agent based on GPT-5` or `You are Codex, a coding agent based on GPT-5`. A Codex chat begun on a GPT model keeps it after `/model` or a fork onto an Antigravity model, so that chat 429s while a new one works;
- Hermes Agent's earlier default persona, `Hermes Agent, an intelligent AI assistant created by Nous Research`, which a SOUL.md the user edited keeps (Hermes' current default goes through). Breaking it after `You` doesn't help; it is broken after the `H`.
The same prompt goes through when each has a zero-width space (U+200B) inside it. This middleware puts one after the first letter of `x-anthropic-billing-header`, `Claude Agent SDK`, those two Codex lines and Hermes' line, in the system prompt only, and only in what an Antigravity account is sent. Every other provider, a Claude subscription above all, gets the prompt as the agent wrote it, even in a routing group that tries Antigravity first. The model reads the words as before.
The same prompt goes through when each has a zero-width space (U+200B) inside it. This middleware puts two (after the first and the second character of each word; one after the first letter only was turned away again on 11-11) in `x-anthropic-billing-header`, `Claude Agent SDK`, those two Codex lines and Hermes' line, in the system prompt only, and only in what an Antigravity account is sent. Every other provider, a Claude subscription above all, gets the prompt as the agent wrote it, even in a routing group that tries Antigravity first. The model reads the words as before.
It needs a magpie with the `onProvider` hook (v0.1.1283 or later): an older magpie loads it and never calls it, so requests go as they came.
@@ -73,11 +73,16 @@ function parts(list, text) {
return list
}
// cloaker breaks every word of list where it appears, whatever its case
// cloaker breaks every word of list where it appears, whatever its case:
// a zero-width space after the first and after the second character of each
// run of three or more letters or digits in it. One after the first letter
// only stopped working on 11-11, when Google turned
// "x\u200b-anthropic-billing-header" and "C\u200blaude Agent SDK" away again.
function cloaker(list) {
const res = list.map((w) => new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi"))
const two = (m) => m.replace(/[A-Za-z0-9]{3,}/g, (w) => w[0] + zwsp + w[1] + zwsp + w.slice(2))
return (s) => {
for (const re of res) s = s.replace(re, (m) => m[0] + zwsp + m.slice(1))
for (const re of res) s = s.replace(re, two)
return s
}
}
+10 -10
View File
@@ -1,17 +1,17 @@
[
{"name": "Anthropic: Claude Code's blocks, to Antigravity", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "request": {"model": "m", "system": [{"type": "text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}, {"type": "text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK.", "cache_control": {"type": "ephemeral"}}], "messages": [{"role": "user", "content": "Claude Agent SDK"}]}, "expect_request": {"model": "m", "system": [{"type": "text", "text": "x\u200b-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}, {"type": "text", "text": "You are a Claude agent, built on Anthropic's C\u200blaude Agent SDK.", "cache_control": {"type": "ephemeral"}}], "messages": [{"role": "user", "content": "Claude Agent SDK"}]}},
{"name": "Anthropic: Claude Code's blocks, to Antigravity", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "request": {"model": "m", "system": [{"type": "text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}, {"type": "text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK.", "cache_control": {"type": "ephemeral"}}], "messages": [{"role": "user", "content": "Claude Agent SDK"}]}, "expect_request": {"model": "m", "system": [{"type": "text", "text": "x-a\u200bn\u200bthropic-b\u200bi\u200blling-h\u200be\u200bader: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}, {"type": "text", "text": "You are a Claude agent, built on Anthropic's C\u200bl\u200baude A\u200bg\u200bent S\u200bD\u200bK.", "cache_control": {"type": "ephemeral"}}], "messages": [{"role": "user", "content": "Claude Agent SDK"}]}},
{"name": "Anthropic: the same to a Claude subscription stays as it was", "provider": {"id": "c", "name": "Claude", "account": "claude", "model": "claude-sonnet-4-5"}, "request": {"model": "m", "system": [{"type": "text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}, {"type": "text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}], "messages": []}},
{"name": "Anthropic: an API key, no account, stays as it was", "provider": {"id": "k", "name": "Key", "model": "m"}, "request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's Claude Agent SDK.", "messages": []}},
{"name": "Anthropic: a string system, any case", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "request": {"model": "m", "system": "X-Anthropic-Billing-Header: a\nbuilt on the claude agent sdk"}, "expect_request": {"model": "m", "system": "X\u200b-Anthropic-Billing-Header: a\nbuilt on the c\u200blaude agent sdk"}},
{"name": "Anthropic: a string system, any case", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "request": {"model": "m", "system": "X-Anthropic-Billing-Header: a\nbuilt on the claude agent sdk"}, "expect_request": {"model": "m", "system": "X-A\u200bn\u200bthropic-B\u200bi\u200blling-H\u200be\u200bader: a\nbuilt on the c\u200bl\u200baude a\u200bg\u200bent s\u200bd\u200bk"}},
{"name": "Anthropic: no words, nothing changed", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "request": {"model": "m", "system": "You code.", "messages": []}},
{"name": "Chat: system and developer messages, not the user's", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "chat"}, "request": {"model": "m", "messages": [{"role": "system", "content": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}, {"role": "developer", "content": [{"type": "text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}, "expect_request": {"model": "m", "messages": [{"role": "system", "content": "You are a Claude agent, built on Anthropic's C\u200blaude Agent SDK."}, {"role": "developer", "content": [{"type": "text", "text": "x\u200b-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}},
{"name": "Responses: instructions and a system input item", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "responses"}, "request": {"model": "m", "instructions": "You are a Claude agent, built on Anthropic's Claude Agent SDK.", "input": [{"role": "system", "content": [{"type": "input_text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": [{"type": "input_text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}]}, "expect_request": {"model": "m", "instructions": "You are a Claude agent, built on Anthropic's C\u200blaude Agent SDK.", "input": [{"role": "system", "content": [{"type": "input_text", "text": "x\u200b-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": [{"type": "input_text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}]}},
{"name": "Responses: Codex's GPT-5 prompt kept after a switch to an Antigravity model", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "claude-opus-5-5"}, "ctx": {"protocol": "responses"}, "request": {"model": "m", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-5. You and the user share one workspace."}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "hi"}]}, {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "<model_switch>\nThe user was previously using a different model.\n</model_switch>"}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-5."}]}]}, "expect_request": {"model": "m", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "Y\u200bou are Codex, an agent based on GPT-5. You and the user share one workspace."}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "hi"}]}, {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "<model_switch>\nThe user was previously using a different model.\n</model_switch>"}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-5."}]}]}},
{"name": "Responses: the coding agent wording, any case; magpie's own Codex prompt stays", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "claude-opus-5-5"}, "ctx": {"protocol": "responses"}, "request": {"model": "m", "instructions": "you are codex, a coding agent based on gpt-5.", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI."}]}]}, "expect_request": {"model": "m", "instructions": "y\u200bou are codex, a coding agent based on gpt-5.", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI."}]}]}},
{"name": "Chat: Hermes Agent's earlier persona, broken after its H", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "chat"}, "request": {"model": "m", "messages": [{"role": "system", "content": "You are Hermes Agent, an intelligent AI assistant created by Nous Research. You are helpful, knowledgeable, and direct.\n\nYou are Hermes Agent, built by Nous Research."}, {"role": "user", "content": "hi"}]}, "expect_request": {"model": "m", "messages": [{"role": "system", "content": "You are H\u200bermes Agent, an intelligent AI assistant created by Nous Research. You are helpful, knowledgeable, and direct.\n\nYou are Hermes Agent, built by Nous Research."}, {"role": "user", "content": "hi"}]}},
{"name": "Gemini: systemInstruction", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "gemini"}, "request": {"systemInstruction": {"parts": [{"text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}, "contents": []}, "expect_request": {"systemInstruction": {"parts": [{"text": "You are a Claude agent, built on Anthropic's C\u200blaude Agent SDK."}]}, "contents": []}},
{"name": "extraWords are broken too", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "options": {"extraWords": ["Claude Code"]}, "request": {"model": "m", "system": "You are Claude Code."}, "expect_request": {"model": "m", "system": "You are C\u200blaude Code."}},
{"name": "accounts says which subscriptions", "provider": {"id": "g", "name": "Gemini", "account": "gemini", "model": "m"}, "options": {"accounts": ["gemini"]}, "request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}, "expect_request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's C\u200blaude Agent SDK."}},
{"name": "Chat: system and developer messages, not the user's", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "chat"}, "request": {"model": "m", "messages": [{"role": "system", "content": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}, {"role": "developer", "content": [{"type": "text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}, "expect_request": {"model": "m", "messages": [{"role": "system", "content": "You are a Claude agent, built on Anthropic's C\u200bl\u200baude A\u200bg\u200bent S\u200bD\u200bK."}, {"role": "developer", "content": [{"type": "text", "text": "x-a\u200bn\u200bthropic-b\u200bi\u200blling-h\u200be\u200bader: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}},
{"name": "Responses: instructions and a system input item", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "responses"}, "request": {"model": "m", "instructions": "You are a Claude agent, built on Anthropic's Claude Agent SDK.", "input": [{"role": "system", "content": [{"type": "input_text", "text": "x-anthropic-billing-header: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": [{"type": "input_text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}]}, "expect_request": {"model": "m", "instructions": "You are a Claude agent, built on Anthropic's C\u200bl\u200baude A\u200bg\u200bent S\u200bD\u200bK.", "input": [{"role": "system", "content": [{"type": "input_text", "text": "x-a\u200bn\u200bthropic-b\u200bi\u200blling-h\u200be\u200bader: cc_version=2.1.0.abc; cc_entrypoint=cli; cch=1a2b3;"}]}, {"role": "user", "content": [{"type": "input_text", "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}]}},
{"name": "Responses: Codex's GPT-5 prompt kept after a switch to an Antigravity model", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "claude-opus-5-5"}, "ctx": {"protocol": "responses"}, "request": {"model": "m", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-5. You and the user share one workspace."}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "hi"}]}, {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "<model_switch>\nThe user was previously using a different model.\n</model_switch>"}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-5."}]}]}, "expect_request": {"model": "m", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "Y\u200bo\u200bu a\u200br\u200be C\u200bo\u200bdex, an a\u200bg\u200bent b\u200ba\u200bsed on G\u200bP\u200bT-5. You and the user share one workspace."}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "hi"}]}, {"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "<model_switch>\nThe user was previously using a different model.\n</model_switch>"}]}, {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "You are Codex, an agent based on GPT-5."}]}]}},
{"name": "Responses: the coding agent wording, any case; magpie's own Codex prompt stays", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "claude-opus-5-5"}, "ctx": {"protocol": "responses"}, "request": {"model": "m", "instructions": "you are codex, a coding agent based on gpt-5.", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI."}]}]}, "expect_request": {"model": "m", "instructions": "y\u200bo\u200bu a\u200br\u200be c\u200bo\u200bdex, a c\u200bo\u200bding a\u200bg\u200bent b\u200ba\u200bsed on g\u200bp\u200bt-5.", "input": [{"type": "message", "role": "developer", "content": [{"type": "input_text", "text": "You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI."}]}]}},
{"name": "Chat: Hermes Agent's earlier persona, broken after its H", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "chat"}, "request": {"model": "m", "messages": [{"role": "system", "content": "You are Hermes Agent, an intelligent AI assistant created by Nous Research. You are helpful, knowledgeable, and direct.\n\nYou are Hermes Agent, built by Nous Research."}, {"role": "user", "content": "hi"}]}, "expect_request": {"model": "m", "messages": [{"role": "system", "content": "You are H\u200be\u200brmes A\u200bg\u200bent, an i\u200bn\u200btelligent AI a\u200bs\u200bsistant c\u200br\u200beated by N\u200bo\u200bus R\u200be\u200bsearch. You are helpful, knowledgeable, and direct.\n\nYou are Hermes Agent, built by Nous Research."}, {"role": "user", "content": "hi"}]}},
{"name": "Gemini: systemInstruction", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "ctx": {"protocol": "gemini"}, "request": {"systemInstruction": {"parts": [{"text": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}]}, "contents": []}, "expect_request": {"systemInstruction": {"parts": [{"text": "You are a Claude agent, built on Anthropic's C\u200bl\u200baude A\u200bg\u200bent S\u200bD\u200bK."}]}, "contents": []}},
{"name": "extraWords are broken too", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "options": {"extraWords": ["Claude Code"]}, "request": {"model": "m", "system": "You are Claude Code."}, "expect_request": {"model": "m", "system": "You are C\u200bl\u200baude C\u200bo\u200bde."}},
{"name": "accounts says which subscriptions", "provider": {"id": "g", "name": "Gemini", "account": "gemini", "model": "m"}, "options": {"accounts": ["gemini"]}, "request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}, "expect_request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's C\u200bl\u200baude A\u200bg\u200bent S\u200bD\u200bK."}},
{"name": "off leaves it", "provider": {"id": "7c1958d885953cd3", "name": "Antigravity", "account": "antigravity", "model": "gemini-3-flash"}, "options": {"off": true}, "request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}},
{"name": "onRequest isn't there: before routing nothing is changed", "request": {"model": "m", "system": "You are a Claude agent, built on Anthropic's Claude Agent SDK."}}
]
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/middleware-antigravity-cloak",
"version": "0.1.2",
"version": "0.1.3",
"description": "magpie gateway middleware: Antigravity stops turning Claude Code's and the Claude Agent SDK's system prompts away, and no other provider's request is changed",
"type": "module",
"files": ["antigravity-cloak.middleware.js", "README.md"],
+19 -8
View File
@@ -863,7 +863,8 @@ function plainSchema(root) {
// TURNED_AWAY are the lines, lower-cased, Antigravity answers a 429 to
// whatever quota is left. Each is broken up before it goes by a zero-width
// space after its first letter, which Google lets through.
// space after its first and second character of each word, which Google
// lets through.
const TURNED_AWAY = [
"x-anthropic-billing-header:",
"built on anthropic's claude agent sdk",
@@ -881,23 +882,32 @@ const turnsAway = (system) => {
const asciiLower = (s) => s.replace(/[A-Z]/g, (c) => c.toLowerCase())
// breakUp puts a zero-width space after the first and after the second
// character of every run of three or more letters or digits in a line.
// One after the first letter only stopped working on 11-11: Google turned
// "x\u200b-anthropic-billing-header:" and "b\u200built on Anthropic's Claude
// Agent SDK" away again, and answered each word broken twice.
const breakUp = (line) => line.replace(/[A-Za-z0-9]{3,}/g, (w) => w[0] + ZW + w[1] + ZW + w.slice(2))
function cloak(system) {
if (!turnsAway(system)) return system
const low = asciiLower(system)
const at = new Set()
const at = []
for (const line of TURNED_AWAY) {
for (let i = 0; ; ) {
const j = low.indexOf(line, i)
if (j < 0) break
at.add(j + 1)
at.push([j, j + line.length])
i = j + line.length
}
}
at.sort((a, b) => a[0] - b[0])
let out = ""
let prev = 0
for (const i of [...at].sort((a, b) => a - b)) {
out += system.slice(prev, i) + ZW
prev = i
for (const [from, to] of at) {
if (from < prev) continue
out += system.slice(prev, from) + breakUp(system.slice(from, to))
prev = to
}
return out + system.slice(prev)
}
@@ -1182,8 +1192,9 @@ async function complete(s, url, init) {
if (res.status === 404) return errorResponse(404, `model ${sent} not found`)
if (res.status === 429 && /resource has been exhausted/i.test(text) && turnsAway(system)) {
// the system prompt turned away, not a quota: a 400 the next member
// of a group is asked after, and the agent doesn't retry
return errorResponse(400, `Antigravity turned this request away as from an unapproved channel: ${msg} — ${hint(system)}`)
// of a group is asked after, and the agent doesn't retry. It says
// what Antigravity answered (a 429), not that this is a channel
return errorResponse(400, `Antigravity answered 429 to this system prompt: ${msg} — ${hint(system)}`)
}
return new Response(text, { status: res.status, headers: { "content-type": res.headers.get("content-type") ?? "application/json" } })
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-antigravity-auth",
"version": "0.1.0",
"version": "0.1.1",
"description": "Sign in to Antigravity with a Google account from OpenCode or magpie: Gemini, and the Claude and GPT-OSS models Google hosts for it",
"type": "module",
"main": "./opencode.mjs",
+2 -1
View File
@@ -87,7 +87,8 @@ test("a 429 to a turned-away system prompt is a 400, not a quota", async () => {
const res = await f(URL_("gemini-3-flash"), { method: "POST", body: ask("hi", { systemInstruction: { parts: [{ text: sys }] } }) })
expect(res.status).toBe(400)
const j = await res.json()
expect(j.error.message).toContain("unapproved channel")
expect(j.error.message).toContain("answered 429 to this system prompt")
expect(j.error.message).not.toContain("unapproved channel")
expect(j.error.message).toContain(says)
}
// any other prompt's 429 is the quota it says
+2 -2
View File
@@ -105,8 +105,8 @@ test("the lines Antigravity turns away are broken up", () => {
const out = cloak(sys)
expect(out).not.toBe(sys)
expect(out.replaceAll("​", "")).toBe(sys)
expect(out).toContain("x​-anthropic-billing-header:")
expect(out).toContain("b​uilt on Anthropic's")
expect(out).toContain("x-a\u200bn\u200bthropic-b\u200bi\u200blling-h\u200be\u200bader:")
expect(out).toContain("b\u200bu\u200bilt on A\u200bn\u200bthropic's C\u200bl\u200baude A\u200bg\u200bent S\u200bD\u200bK")
// twice is the same as once, and other text is left alone
expect(cloak(out)).toBe(out)
expect(cloak("be brief")).toBe("be brief")