antigravity: its 429 to Claude Code's system prompt says it isn't a quota (#666: Claude Desktop 调用 antigravity 恒定报 429) — Antigravity answers "Resource has been exhausted (e.g. check quota)" to any request whose systemInstruction holds Claude Code's billing line (x-anthropic-billing-header: …) or the Agent SDK's identity line (You are a Claude agent, built on Anthropic's Claude Agent SDK.), on every model (gemini-3.8/3.7 flash, 3.5 flash lite, 2.5 flash, claude-sonnet-4-6, gpt-oss), whatever the quota left, while the same words in a message go through. Claude Desktop's chats run the Agent SDK and carry both, so they always failed, while its title requests (no system prompt) and Codex on the same account answered. Not the session id (magpie already sends request.sessionId as -<uint63>), thinking signatures (never sent back) or the User-Agent. magpie doesn't hide the lines from Google; the gateway now adds to such a 429 that it is no quota and that Antigravity turns away Claude Code's and the Agent SDK's system prompt, so no one chases a quota. Reproduced on the owner's real Antigravity account with Claude Code 2.1.288 through a sandbox gateway (11/11 429; system field removed 200; either line alone 429). TestAntigravityTurnsAwayClaudeCodesSystemPrompt. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package gateway
|
||||
|
||||
import "testing"
|
||||
|
||||
// Antigravity answers a 429 "Resource has been exhausted (e.g. check
|
||||
// quota)" to Claude Code's and the Agent SDK's system prompt whatever the
|
||||
// quota left (#666: Claude Desktop's chats always 429, its titles and
|
||||
// Codex on the same account fine); magpie says so rather than leave a user
|
||||
// chasing a quota. Both lines are as Claude Code 2.1.288 sends them.
|
||||
func TestAntigravityTurnsAwayClaudeCodesSystemPrompt(t *testing.T) {
|
||||
for _, system := range []string{
|
||||
"x-anthropic-billing-header: cc_version=2.1.288.e3f; cc_entrypoint=sdk-cli;\nYou are Claude Code, Anthropic's official CLI for Claude.",
|
||||
"You are a Claude agent, built on Anthropic's Claude Agent SDK.\n\nYou are an interactive agent …",
|
||||
"Some instructions first.\nYou are a Claude agent, built on Anthropic's Claude Agent SDK.",
|
||||
} {
|
||||
if !antigravityTurnsAway(system) {
|
||||
t.Errorf("%q isn't taken for what Antigravity turns away", system)
|
||||
}
|
||||
}
|
||||
// what it lets through: other agents', Claude Code's own name alone,
|
||||
// and no system prompt at all (Claude Desktop's title requests)
|
||||
for _, system := range []string{
|
||||
"",
|
||||
"You are a helpful assistant.",
|
||||
"You are Claude Code, Anthropic's official CLI for Claude.",
|
||||
"You are Codex, based on GPT-5.",
|
||||
} {
|
||||
if antigravityTurnsAway(system) {
|
||||
t.Errorf("%q is taken for what Antigravity turns away; it answers it", system)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,20 @@ func accountAgent(p provider.Provider) string {
|
||||
return p.Account.Agent
|
||||
}
|
||||
|
||||
// antigravityTurnsAway: a system prompt Antigravity answers with a 429
|
||||
// "Resource has been exhausted (e.g. check quota)" whatever the quota left,
|
||||
// the one Claude Code and its Agent SDK (Claude Desktop's chats) send: its
|
||||
// billing line or the SDK's identity line anywhere in the system
|
||||
// instruction turns the request away, on every model, while the same words
|
||||
// in a message go through (#666). magpie doesn't hide them from Google; it
|
||||
// says why, so no one chases a quota that isn't spent.
|
||||
func antigravityTurnsAway(system string) bool {
|
||||
return strings.Contains(system, "x-anthropic-billing-header:") ||
|
||||
strings.Contains(system, "built on Anthropic's Claude Agent SDK")
|
||||
}
|
||||
|
||||
const antigravityTurnedAwayHint = "not a quota: Antigravity turns away Claude Code's and the Claude Agent SDK's system prompt (Claude Code, Claude Desktop's chats) with this 429; use another provider for them"
|
||||
|
||||
// codeAssistID is the id a request on the account's app goes out under: on
|
||||
// Antigravity the variant the effort picks for a model that is a family of
|
||||
// levels, and elsewhere the model magpie knows. It is keyed by the account
|
||||
|
||||
@@ -2865,6 +2865,9 @@ func (s *Server) translate(w http.ResponseWriter, r *http.Request, p provider.Pr
|
||||
if res.StatusCode >= 400 {
|
||||
b, _ := io.ReadAll(io.LimitReader(res.Body, 1<<20))
|
||||
msg := p.Explain(p.Name+": "+provider.APIError(b, res.Status), res.StatusCode, b)
|
||||
if res.StatusCode == http.StatusTooManyRequests && accountAgent(p) == "antigravity" && antigravityTurnsAway(request.System) {
|
||||
msg += " — " + antigravityTurnedAwayHint
|
||||
}
|
||||
if p.Preset == "openrouter" && openRouterSharedPool(b) {
|
||||
markOpenRouterSharedPool(w)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user