antigravity 0.2.3: Claude Code's identity line goes as "You're …" (#1151)

Found while checking #1105: agy-cli's cloak.mjs has rewritten Claude Code's
identity line since #1151 (11-15), but the antigravity plugin, which went
back to serving existing users at 0.2.1, didn't. "You are Claude Code,
Anthropic's official CLI for Claude." (Claude Code's CLI, and with ",
running within the Claude Agent SDK" Claude Desktop's Code tab) now goes
as "You're …", as agy-cli sends it. The existing test that pinned
Claude Desktop's line as going through unchanged now expects "You're …",
since that line is turned away too.

Real account, 11-17, through the plugin, sandbox HOME, the owner's
existing sign-in (no credentials entered), 3 runs each on
gemini-3.8-flash and gemini-4-hydrogen-sonar:
- 0.2.2: the CLI line and the SDK line each 429 3/3 on both models.
- 0.2.3: both 200 3/3 on both models.

Run (mote, HOME=$(mktemp -d)) at this tree: bun test packages/antigravity
packages/agy-cli 174 pass, 0 fail; bun scripts/check.mjs ok.
Broken by hand: 0.2.2's index.mjs with the new test: it fails
(shape.test.mjs 31 pass, 1 fail).
This commit is contained in:
yetone
2026-11-17 15:51:39 +08:00
parent 8c3397d3ff
commit 8c7e8f6621
4 changed files with 25 additions and 5 deletions
+3 -1
View File
@@ -114,7 +114,9 @@ The plugin also changes the request itself, as the built-in did:
Codex's prompt for a model it has none for go as "You're …" for "You are
Hermes Agent" / "You are OpenCode" / "You are a coding agent running in
the Codex CLI", and pi's default prompt as "running within pi" for
"running inside pi" (the last four turned away since 11-14). A copy
"running inside pi" (the last four turned away since 11-14). Claude
Code's identity line ("You are Claude Code, Anthropic's official CLI for
Claude") goes as "You're …" too (#1151). A copy
someone broke up with invisible characters is reworded the same way.
DeepSeek Harness's paragraph on `@` paths ("Tokens prefixed with @ are
paths…") goes reworded with the same meaning: word for word, it got most
+9 -1
View File
@@ -948,8 +948,13 @@ function plainSchema(root) {
// gemini-4-hydrogen-sonar on 11-17, the paragraph whole as well; without
// its period, without the comma before "or" or without "implicit" the
// browser sentence went through.
// Since 11-15 Claude Code's identity line, "You are Claude Code,
// Anthropic's official CLI for Claude." (its CLI's, and with ", running
// within the Claude Agent SDK" its SDK's), is turned away too, as agy-cli's
// cloak.mjs has it (#1151; 3 of 3 here on gemini-3.8-flash on 11-17, and
// "You're …" 3 of 3 through).
// Codex's prompt for GPT-6 ("You are Codex, an agent based on GPT-6."),
// Claude Code's, Gemini CLI's, Qwen Code's, Cline's, Kilo's, goose's, Amp's,
// the rest of Claude Code's, Gemini CLI's, Qwen Code's, Cline's, Kilo's, goose's, Amp's,
// Droid's, Kimi CLI's, Aider's and Cursor's went through as written.
const TURNED_AWAY = [
"x-anthropic-billing-header:",
@@ -963,6 +968,7 @@ const TURNED_AWAY = [
"you are a coding agent running in the codex cli",
"a coding assistant running inside pi",
"you are an ai agent powered by deepseek harness",
"you are claude code, anthropic's official cli for claude",
"the browser provides no implicit dom, route, or screenshot context.",
]
@@ -1018,6 +1024,7 @@ const turnsAway = (system) => TURNED_AWAY_RE.some((re) => has(system, re))
// - pi's line goes "running within pi" (5 of 5 on both models).
// - omp's RFC 2119 line goes as "key words", the RFC's own term (10 of 10
// on 11-14, eric_li8983 on X).
// - Claude Code's identity line goes as "You're …" (#1151).
// - DeepSeek Harness's first line goes as "You're …", and its browser
// sentence "gives no implicit DOM, …" for "provides" (3 of 3 each on
// 11-17).
@@ -1034,6 +1041,7 @@ const SAID_AS = {
"you are a coding agent running in the codex cli": youre,
"a coding assistant running inside pi": (line) => line.replace(/inside/i, "within"),
"you are an ai agent powered by deepseek harness": youre,
"you are claude code, anthropic's official cli for claude": youre,
"the browser provides no implicit dom, route, or screenshot context.": (line) => line.replace(/provides/i, "gives"),
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-antigravity-auth",
"version": "0.2.2",
"version": "0.2.3",
"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",
+12 -2
View File
@@ -179,12 +179,13 @@ test("Claude Code's billing line is left out, and the Agent SDK's line is reword
// twice is the same as once, and other text is left alone
expect(cloak(out)).toBe(out)
expect(cloak("be brief")).toBe("be brief")
expect(cloak(DESKTOP)).toBe(DESKTOP)
// Claude Desktop's own line has been turned away since 11-15 (#1151)
expect(cloak(DESKTOP)).toBe(DESKTOP.replace("You are", "You're"))
// the case and white space the agent wrote stay
expect(cloak("built on\nANTHROPIC'S claude agent sdk")).toBe("built on\nthe claude agent sdk by Anthropic")
// as the gateway hands it: each block a part; the billing line's part goes
const r = shape({ systemInstruction: { parts: [{ text: BILLING }, { text: DESKTOP }, { text: SUBAGENT }] }, contents: [] }, "gemini-3-flash", "", "")
expect(r.systemInstruction.parts.map((p) => p.text)).toEqual([DESKTOP, "You are a Claude agent, built on the Claude Agent SDK by Anthropic."])
expect(r.systemInstruction.parts.map((p) => p.text)).toEqual([DESKTOP.replace("You are", "You're"), "You are a Claude agent, built on the Claude Agent SDK by Anthropic."])
// a billing line alone in a string stays one (empty) part
expect(shape({ systemInstruction: BILLING, contents: [] }, "gemini-3-flash", "", "").systemInstruction.parts).toEqual([{ text: "" }])
})
@@ -343,6 +344,15 @@ test("DeepSeek Harness's first line and browser sentence go reworded, the rest a
]) expect(cloak(s)).toBe(s)
})
test("Claude Code's identity line goes as \"You're …\", its CLI's and its SDK's (#1151)", () => {
const { hint } = _internal
expect(cloak("You are Claude Code, Anthropic's official CLI for Claude.\n\nBe brief.")).toBe("You're Claude Code, Anthropic's official CLI for Claude.\n\nBe brief.")
expect(cloak("You are Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.")).toBe("You're Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.")
expect(hint("You are Claude Code, Anthropic's official CLI for Claude.")).toContain("Claude Code")
const s = "You're Claude Code, Anthropic's official CLI for Claude."
expect(cloak(s)).toBe(s)
})
// since 11-14 Codex's GPT-5 line in a user's turn is turned away too (3 of
// 3 on a real account): it goes reworded there, and the model's turns and
// tool results, which went through with it, as written