diff --git a/packages/antigravity/README.md b/packages/antigravity/README.md index 772edf4..5cfb80c 100644 --- a/packages/antigravity/README.md +++ b/packages/antigravity/README.md @@ -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 diff --git a/packages/antigravity/index.mjs b/packages/antigravity/index.mjs index f4c7e24..ddb1ef5 100644 --- a/packages/antigravity/index.mjs +++ b/packages/antigravity/index.mjs @@ -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"), } diff --git a/packages/antigravity/package.json b/packages/antigravity/package.json index 9e16d77..8858232 100644 --- a/packages/antigravity/package.json +++ b/packages/antigravity/package.json @@ -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", diff --git a/packages/antigravity/shape.test.mjs b/packages/antigravity/shape.test.mjs index 22c61fa..5e3e97a 100644 --- a/packages/antigravity/shape.test.mjs +++ b/packages/antigravity/shape.test.mjs @@ -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