antigravity 0.1.4, antigravity-cloak 0.1.4: omp's first line, "RFC 2119 keywords: ...", is broken up, so its prompt is no longer turned away with a 429 (eric_li8983 on X)

eric_li8983's 429 RESOURCE_EXHAUSTED after 0.1.3 was not quota. On the
owner's real Antigravity account (plenty of quota; "hi" with no system
prompt gives 200 on gemini-3.8-flash, claude-sonnet-4-6, gemini-3-flash),
oh-my-pi's real system prompt (captured from omp 's request to a local
server, 10.5KB) got 429 on all three. Bisected by hand: the sentence
"RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."
alone gets 429; its halves, the list without the final period, or "2120"
for "2119" get 200; the prompt without that line gets 200. Broken with a
zero-width space after the first and second character of each word, the
whole prompt gets 200 on the same three models.

The line is added to antigravity's TURNED_AWAY (with its own hint when the
cloak missed a reworded copy) and to antigravity-cloak's words.

Run: bun test packages/antigravity packages/antigravity-cloak on
magpie-desktop (wsl-run, HOME temp): 86 pass. Broken by hand (the TURNED_AWAY
entry removed): the new shape test and the 429 hint test go red, 2 fail.
Real account: omp's full prompt 200 on 3 models after, 429 before.
Not tried: omp's own run through magpie end to end (the user's AGENTS.md
and tools were not in the captured prompt); other omp prompt lines after
the cloak. Real quota 429s and the credits path are unchanged.
This commit is contained in:
yetone
2026-11-11 14:32:50 +08:00
parent 557511d73f
commit 9e07c70627
8 changed files with 24 additions and 5 deletions
@@ -9,6 +9,8 @@
// "You are Codex, a coding agent based on GPT-5" for its GPT-5 models // "You are Codex, a coding agent based on GPT-5" for its GPT-5 models
// "Hermes Agent, an intelligent AI assistant created by Nous Research" // "Hermes Agent, an intelligent AI assistant created by Nous Research"
// Hermes Agent's earlier default persona (its SOUL.md) // Hermes Agent's earlier default persona (its SOUL.md)
// "RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."
// the first line of oh-my-pi (omp)'s system prompt
// //
// (a Codex thread begun on a GPT model keeps its prompt after /model or a // (a Codex thread begun on a GPT model keeps its prompt after /model or a
// fork onto an Antigravity one) // fork onto an Antigravity one)
@@ -26,7 +28,7 @@
// After hexiaolv's magpie-antigravity-cloak (MIT), which does the same to // After hexiaolv's magpie-antigravity-cloak (MIT), which does the same to
// every request whatever provider it goes to. // every request whatever provider it goes to.
export const words = ["x-anthropic-billing-header", "Claude Agent SDK", "You are Codex, an agent based on GPT-5", "You are Codex, a coding agent based on GPT-5", "Hermes Agent, an intelligent AI assistant created by Nous Research"] export const words = ["x-anthropic-billing-header", "Claude Agent SDK", "You are Codex, an agent based on GPT-5", "You are Codex, a coding agent based on GPT-5", "Hermes Agent, an intelligent AI assistant created by Nous Research", "RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."]
const zwsp = "​" const zwsp = "​"
+2 -1
View File
@@ -13,5 +13,6 @@
{"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": "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": "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": "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."}} {"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."}},
{"name":"omp: its RFC 2119 line, to Antigravity","provider":{"id":"7c1958d885953cd3","name":"Antigravity","account":"antigravity","model":"gemini-3-flash"},"request":{"model":"m","system":[{"type":"text","text":"RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. `NEVER` = `MUST NOT`."}],"messages":[{"role":"user","content":"hi"}]},"expect_request":{"model":"m","system":[{"type":"text","text":"R​F​C 2​1​19 k​e​ywords: M​U​ST, R​E​QUIRED, S​H​OULD, R​E​COMMENDED, M​A​Y, O​P​TIONAL. `NEVER` = `MUST NOT`."}],"messages":[{"role":"user","content":"hi"}]}}
] ]
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@magpie-community/middleware-antigravity-cloak", "name": "@magpie-community/middleware-antigravity-cloak",
"version": "0.1.3", "version": "0.1.4",
"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", "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", "type": "module",
"files": ["antigravity-cloak.middleware.js", "README.md"], "files": ["antigravity-cloak.middleware.js", "README.md"],
+1 -1
View File
@@ -82,7 +82,7 @@ requestType: "agent", requestId, request}`):
The plugin also changes the request itself, as the built-in did: The plugin also changes the request itself, as the built-in did:
- **System prompt:** lines Antigravity turns away (Claude Code's billing - **System prompt:** lines Antigravity turns away (Claude Code's billing
header, Codex's and Hermes Agent's own prompts) are broken up with a header, Codex's and Hermes Agent's own prompts, omp's RFC 2119 line) are broken up with a
zero-width space. zero-width space.
- **Tool calls:** - **Tool calls:**
- Tool call ids are reduced to `[A-Za-z0-9_-]`. - Tool call ids are reduced to `[A-Za-z0-9_-]`.
+5
View File
@@ -889,6 +889,7 @@ const TURNED_AWAY = [
"you are codex, an agent based on gpt-5", "you are codex, an agent based on gpt-5",
"you are codex, a coding agent based on gpt-5", "you are codex, a coding agent based on gpt-5",
"hermes agent, an intelligent ai assistant created by nous research", "hermes agent, an intelligent ai assistant created by nous research",
"rfc 2119 keywords: must, required, should, recommended, may, optional.",
] ]
const ZW = "​" const ZW = "​"
@@ -937,8 +938,12 @@ const CODEX_HINT =
const HERMES_HINT = const HERMES_HINT =
"Antigravity answers this 429 to Hermes Agent's earlier default persona (its SOUL.md) whatever quota is left, so it is not a quota and waiting won't help; Hermes' current default persona goes through, so put it in SOUL.md, or use another provider for these chats" "Antigravity answers this 429 to Hermes Agent's earlier default persona (its SOUL.md) whatever quota is left, so it is not a quota and waiting won't help; Hermes' current default persona goes through, so put it in SOUL.md, or use another provider for these chats"
const RFC_HINT =
"Antigravity answers this 429 to the line \"RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL.\" that starts oh-my-pi (omp)'s system prompt, and to any prompt that has it, whatever quota is left, so it is not a quota and waiting won't help; magpie breaks that line up before it goes, so this one came from a copy of it that was worded another way"
function hint(system) { function hint(system) {
const low = system.toLowerCase() const low = system.toLowerCase()
if (low.includes("rfc 2119 keywords: must, required, should, recommended, may, optional.")) return RFC_HINT
if (low.includes("you are codex, an agent based on gpt-5") || low.includes("you are codex, a coding agent based on gpt-5")) return CODEX_HINT if (low.includes("you are codex, an agent based on gpt-5") || low.includes("you are codex, a coding agent based on gpt-5")) return CODEX_HINT
if (low.includes("hermes agent, an intelligent ai assistant created by nous research")) return HERMES_HINT if (low.includes("hermes agent, an intelligent ai assistant created by nous research")) return HERMES_HINT
return HINT return HINT
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@magpie-community/opencode-antigravity-auth", "name": "@magpie-community/opencode-antigravity-auth",
"version": "0.1.3", "version": "0.1.4",
"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", "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", "type": "module",
"main": "./opencode.mjs", "main": "./opencode.mjs",
+1
View File
@@ -83,6 +83,7 @@ test("a 429 to a turned-away system prompt is a 400, not a quota", async () => {
["x-anthropic-billing-header: cc_version=2.1", "Claude Code and the Claude Agent SDK"], ["x-anthropic-billing-header: cc_version=2.1", "Claude Code and the Claude Agent SDK"],
["You are Codex, a coding agent based on GPT-5.", "Codex's own system prompt"], ["You are Codex, a coding agent based on GPT-5.", "Codex's own system prompt"],
["You are Hermes Agent, an intelligent AI assistant created by Nous Research.", "Hermes Agent's earlier default persona"], ["You are Hermes Agent, an intelligent AI assistant created by Nous Research.", "Hermes Agent's earlier default persona"],
["RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL.\n\n§ Role", "oh-my-pi (omp)'s system prompt"],
]) { ]) {
const res = await f(URL_("gemini-3-flash"), { method: "POST", body: ask("hi", { systemInstruction: { parts: [{ text: sys }] } }) }) const res = await f(URL_("gemini-3-flash"), { method: "POST", body: ask("hi", { systemInstruction: { parts: [{ text: sys }] } }) })
expect(res.status).toBe(400) expect(res.status).toBe(400)
+10
View File
@@ -100,6 +100,16 @@ test("a tool's images follow every response, for Claude", () => {
expect(shape(g, "gemini-3-flash", "", "").contents[2].parts.length).toBe(5) expect(shape(g, "gemini-3-flash", "", "").contents[2].parts.length).toBe(5)
}) })
test("omp's RFC 2119 line is broken up, as the real account turned it away", () => {
const line = "RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."
const sys = line + " `NEVER` = `MUST NOT`; `AVOID` = `SHOULD NOT`.\n\n§ Role"
const out = cloak(sys)
expect(out).not.toBe(sys)
expect(out.replaceAll("\u200b", "")).toBe(sys)
expect(out).toContain("R\u200bF\u200bC 2\u200b1\u200b19 k\u200be\u200bywords: M\u200bU\u200bST,")
expect(cloak("RFC 2119 keywords: MUST")).toBe("RFC 2119 keywords: MUST")
})
test("the lines Antigravity turns away are broken up", () => { test("the lines Antigravity turns away are broken up", () => {
const sys = "x-anthropic-billing-header: cc_version=2\nYou are Claude Code, built on Anthropic's Claude Agent SDK.\nhi" const sys = "x-anthropic-billing-header: cc_version=2\nYou are Claude Code, built on Anthropic's Claude Agent SDK.\nhi"
const out = cloak(sys) const out = cloak(sys)