Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

gateway: Antigravity's 429 to Codex's GPT-5 prompt says why and rests nothing, on the web-search path too (Jodiezzzzzz on X)

yetoneb5d17b26e0b3
diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.md
index 19918a9f7..d0dc68011 100644
--- a/docs/subsystems/gateway-routing.md
+++ b/docs/subsystems/gateway-routing.md
@@ -241,7 +241,7 @@ recorded as a prediction failure (`noPrediction`).
- A request to an Anthropic endpoint with `temperature`, `top_p` or `top_k` reaches a model that refuses them without them (`samplingAsTaken`, beside `thinkingOffAsTaken` in `forwardOnce`): Opus 4.7, 4.8, 5 and 5.5, Fable 5, Mythos 5, Sonnet 5 and 5.5, and Haiku 5.5, whose 400 is "`temperature` is deprecated for this model" (Claude Code's auto mode classifier and magpie's own classifiers ask at temperature 0). Older Claudes, Haiku 4.5 among them, other vendors' models and later lines go as they came (#1454). A Claude by a name these rules can't read, answering that a sampling parameter is deprecated (`samplingDeprecated`), is asked again without them, once — a Chat or Responses client's request translated to Messages (`forwardTranslated`) as much as a relayed one.
- Claude Code's auto mode asks the API to review each action ([`automode.go`](../../internal/gateway/automode.go), Anthropic's [auto-mode-classifier-billing](https://code.claude.com/docs/en/auto-mode-classifier-billing)): the `dangerous-tool-use-…` beta, a `safeguards` field, and `safeguard_results` in the reply (a stream's in its `message_delta`). Only Anthropic runs that classifier, so they reach only a route it answers on (`AutoModeReviewed`): the Claude subscription (the bridge hands them to Claude Code's own binary), a Claude model under any vendor's spelling on a provider with a key (Anthropic's API, a relay, Bedrock, Vertex), and anything on `api.anthropic.com`. Another subscription's or a plugin's Claude model (Copilot, Kiro, Cursor…) is that vendor's service and isn't reviewed by its name: Copilot turns `safeguards` away (#1756), the others translate the request, so neither the beta nor `safeguards` is sent there (`TestAutoModeReviewedRoutes`, `TestAutoModeReviewLeftOffOtherSubscriptions`). There the beta, `safeguards` and the results pass as sent, a whole reply's results moved into a stream's `message_delta` (`anthropicWholeEvents`), tool-use ids unchanged. To any other model they are taken off (`serverReview`; a translation never carries them), and magpie never answers a result on Anthropic's behalf. Claude Code then classifies locally and names the gateway in a notice; the wiring turns the review off in its settings while no model it can reach through magpie is reviewed (`claudeReviewEnv`, [agent wiring](agent-wiring.md)), which is the page's remedy for a gateway that can't run the checks (1EFLOPS on X: Codex's model behind magpie). Reviewed there means `AutoModeReviewable`: a reviewed model on a route that reaches the Messages API, since a Claude model asked on a relay's Chat or Responses URL is translated and never carries the review (nexnull on Discord, `TestAutoModeReviewableAsksOnMessages`).
- Locally, Claude Code's classifier is a request of its own on the session's model: no tools, a system prompt asking for `<block>yes</block>` or `<block>no</block>`, the transcript in `<transcript>`, a small `max_tokens`, and no stream; Claude Code 2.1.310 waits 60 seconds an attempt for it. To a model that isn't Claude it goes with `classifierRoom` (2048) added to a limit below it and asked to reason least (`fitAutoModeClassifier`): none, or the lowest of the model's known levels. A model whose levels magpie doesn't know (a relay's own name, gpt6.1-sol) is asked for none too, as magpie's own ask (`Request.OwnEffort`): left to the vendor, a reasoning model reasoned at its default past the 60 seconds and every classifier request ended 499 (CyberCaius on Discord). Its 400 to that effort (`ownEffortRefused`) is asked again at low when it named the level, and without the effort when it named the field ("Unrecognized request argument supplied: reasoning_effort"), remembered in `unfit` until magpie restarts (`TestAutoModeClassifierReasonsLeastOnAnUnknownModel`, `TestAutoModeClassifierEffortRefusedGoesWithout`).
-- Claude Code's billing line (`x-anthropic-billing-header: cc_version=…; cc_entrypoint=…; cch=…;`, its own first system block, `cch` changing every turn) goes on only to a Claude model asked on Anthropic's Messages API (`keepsBillingLine` in [`billing_line.go`](../../internal/gateway/billing_line.go): Anthropic's, a relay's, Bedrock's), as Claude Code sent it. Anywhere else it is left out, the rest of the system as sent (`withoutBillingLine`): a vendor's model relayed on Messages (`passthrough`), every translation to Chat, Responses or Gemini (`forwardTranslated`, Claude models too). Kept, a vendor read it as the prompt's first words and its prefix cache missed from byte 0 every turn (#1600, justrun1983: 4% read from DeepSeek's cache behind Command Code's plan). The Claude subscription's run sends its own (`withoutBillingHeader`), another magpie decides for the provider it picks, and Code Assist (Antigravity, Gemini CLI) is sent it as before, which `antigravityTurnsAway` reads (#666). Once Antigravity has turned such a request away, for `agForeseeing` (6 hours) after, a candidate loop with someone left after an Antigravity account skips it for a request that carries the line, without asking it (`antigravityForeseen`, #2156: each Claude Desktop turn waited about a second on the same refusal before the next member). The skip goes in `Fallback` with the hint, nothing rests, and the agent is told the refusal if nobody after it answers but with a quota. The last one left is still asked, and an old refusal foresees nothing, so a block Google lifts is noticed (`TestAntigravityTurnedAwayIsForeseen`).
+- Claude Code's billing line (`x-anthropic-billing-header: cc_version=…; cc_entrypoint=…; cch=…;`, its own first system block, `cch` changing every turn) goes on only to a Claude model asked on Anthropic's Messages API (`keepsBillingLine` in [`billing_line.go`](../../internal/gateway/billing_line.go): Anthropic's, a relay's, Bedrock's), as Claude Code sent it. Anywhere else it is left out, the rest of the system as sent (`withoutBillingLine`): a vendor's model relayed on Messages (`passthrough`), every translation to Chat, Responses or Gemini (`forwardTranslated`, Claude models too). Kept, a vendor read it as the prompt's first words and its prefix cache missed from byte 0 every turn (#1600, justrun1983: 4% read from DeepSeek's cache behind Command Code's plan). The Claude subscription's run sends its own (`withoutBillingHeader`), another magpie decides for the provider it picks, and Code Assist (Antigravity, Gemini CLI) is sent it as before, which `antigravityTurnsAway` reads (#666). Once Antigravity has turned such a request away, for `agForeseeing` (6 hours) after, a candidate loop with someone left after an Antigravity account skips it for a request that carries the line, without asking it (`antigravityForeseen`, #2156: each Claude Desktop turn waited about a second on the same refusal before the next member). The skip goes in `Fallback` with the hint, nothing rests, and the agent is told the refusal if nobody after it answers but with a quota. The last one left is still asked, and an old refusal foresees nothing, so a block Google lifts is noticed (`TestAntigravityTurnedAwayIsForeseen`). Codex's own identity line for its GPT-5 models ("You are Codex, an agent based on GPT-5", "…a coding agent based on GPT-5", any case) is turned away the same way (`antigravityTurnsCodexAway`): Codex sends its model's prompt as the thread's first developer message, which goes in as the system instruction, and a thread begun on a GPT model keeps it after `/model`, `resume -m` or a fork as an agent's thread, so such a thread on an Antigravity model 429'd until Codex's retry limit while dsh on the same account answered (Jodiezzzzzz on X, 10-27). It gets its own hint (`antigravityCodexHint`: start a new chat on the model, which is sent magpie's own Codex prompt "You are Codex, based on GPT-5.", which Antigravity answers), chosen by `antigravityHint`. Codex sends its `web_search` tool every turn, so an Antigravity model's Codex turn goes through magpie's own search (`searchReply`); its rounds are wrapped in `antigravityRound`, which tells the 429 (or the reply's error event) the same way and marks the attempt, where before the search path returned the bare 429 that Codex retried to its limit.
- Claude Code's advisor (`/advisor`, `--advisor`) is Anthropic's server tool `advisor_20260301`, its `model` named as Claude Code names its own: on magpie, by magpie's id (the tier an alias like `opus` is on), which no vendor knows, so the request was turned away whole (JackChou on Discord). Relayed on Messages (`passthrough`), the advisor's model goes as the upstream's own name for it when it is the same provider's Claude model, or a Claude id naming no provider (`advisorTools` in [`advisor.go`](../../internal/gateway/advisor.go)); one it can't run there (another provider's, a group, not Claude's) is left out, as is every advisor when the request's own model isn't a Claude model (a vendor's Messages API knows no such tool), and the turn is answered without one. A translation drops it with every other server tool. Claude Code (2.1.300) also puts the advisor in the conversation: a `{role: "system"}` message whose text ends in its instructions ("# Advisor Tool … call advisor BEFORE substantive work") and a `tool_addition` naming it. Where the advisor is left out, that `tool_addition` goes too (and a message it leaves empty), and the instructions become Claude Code's own "The advisor tool is no longer available; disregard the earlier advisor instructions." (`withoutAdvisor` on Messages, `advisorGoneIn` in `parseAnthropic` for a translation): left there, the model called `advisor()` as one of the agent's tools and Claude Code answered "No such tool available: advisor" (JackChou on Discord). The Claude subscription's run declares only magpie's tools, so it never has one. `TestAdvisorModelAsTheUpstreamNamesIt`, `TestAdvisorLeftOutOnTranslation`.
- Kiro is told where to cache the prompt (plugins#110: a Kiro subscription read 0 from its cache). Its API takes Bedrock's `cachePoint: {"type":"default"}` on a `userInputMessage`, an `assistantResponseMessage` or as a tool entry. The built-in (`buildKiro` in [`kiro.go`](../../internal/gateway/kiro.go)) marks the first message when there is a system prompt, which it folds into that message, and the current message, as `buildAnthropic` marks Anthropic's. A moved Kiro's plugin (opencode-kiro-auth 0.1.10, the mover's `min`) turns each `cache_control` in the Anthropic body it is handed into one, at most 4, the last kept.
- A model that refuses a conversation ending with the assistant's message (`refusesPrefill`: OpenCode Go's Claude models over Messages, "This model does not support assistant message prefill"; Volcengine's Agent Plan, "…for a model that does not support prefill"; Gemini's, "Requests ending with a model turn are not supported") is marked for that provider, model and API (`prefillRefused`, #1447); the provider's other models keep their prefill ([`prefill.go`](../../internal/gateway/prefill.go)). A Chat or Responses client's conversation ending with the assistant's message, which those APIs read as a turn already said (`Request.LastIsTurn`), is asked again with a user turn after it (`continueText`), translated (`forwardTranslated`) or relayed (`passthrough`, `userLastBody`), and so from then on. An Anthropic client's prefill is its own ask and gets the refusal as sent. magpie's own continuation of a cut reply (`continuation.go`) isn't asked of that model again; the try the model refused ends the reply with what cut it, not with the refusal. A request magpie builds in Gemini's own shape (`buildCodeAssistSent`: Vertex AI, Gemini CLI's and Antigravity's Code Assist, Factory) never ends with the model's turn, which all of them turn away: a user turn goes after it, `continueText`, or `compactLastText` when an agent is compacting with its ask in the system prompt (`modelLastAsk`), as one goes before a history that opens with the model's. Nor does it send a user turn that mixes a tool's `functionResponse` with text, which Vertex AI answers with the same "ending with a model turn" (#1533: Codex's compaction prompt after a tool's output): what the user said goes in a user turn of its own after the tools' responses (`hasResponse`), except for a Claude model on Antigravity, whose tool_result turn holds both.
diff --git a/internal/gateway/antigravity_codex_test.go b/internal/gateway/antigravity_codex_test.go
new file mode 100644
index 000000000..d3c051af3
--- /dev/null
+++ b/internal/gateway/antigravity_codex_test.go
@@ -0,0 +1,155 @@
+package gateway
+
+import (
+ "fmt"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+)
+
+// codexGPT5System is the start of Codex's own prompt for gpt-5.6-sol, as
+// Codex 0.162.1 sends it: the first developer message of the thread.
+const codexGPT5System = "You are Codex, an agent based on GPT-5. You and the user share one workspace, and your job is to collaborate with them until their goal is genuinely handled."
+
+// Antigravity answers Codex's GPT-5 identity line in the system instruction
+// with the same 429 it gives Claude Code's prompt, in any case; the lines
+// it answers were each tried on a real Antigravity account (10-27).
+func TestAntigravityTurnsAwayCodexsGPT5Prompt(t *testing.T) {
+ for _, system := range []string{
+ codexGPT5System,
+ "You are Codex, a coding agent based on GPT-5. You and the user share the same workspace.",
+ "you are codex, an agent based on gpt-5.",
+ "Some instructions first.\n" + codexGPT5System,
+ } {
+ if !antigravityTurnsAway(system) {
+ t.Errorf("%q isn't taken for what Antigravity turns away", system)
+ }
+ if antigravityHint(system) != antigravityCodexHint {
+ t.Errorf("%q isn't told Codex's hint", system)
+ }
+ }
+ // what it answers: magpie's own Codex prompt for other models, GPT-6's,
+ // the line reworded, and the identity alone
+ for _, system := range []string{
+ "You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.",
+ "You are Codex, an agent based on GPT-6.",
+ "You are Codex, an AI agent based on GPT-5.",
+ "You are Codex, an agent built on GPT-5.",
+ "You are Codex, a coding agent.",
+ } {
+ if antigravityTurnsAway(system) {
+ t.Errorf("%q is taken for what Antigravity turns away; it answers it", system)
+ }
+ }
+ if antigravityHint(claudeCodeSystem) != antigravityTurnedAwayHint {
+ t.Error("Claude Code's prompt isn't told its own hint")
+ }
+}
+
+// codexAGTurn is a Codex turn on Antigravity's model itself, on the Responses
+// API, with Codex's GPT-5 prompt as its first developer message. switched
+// is a thread begun on a GPT model and moved to this one (/model, resume
+// -m, a fork as an agent's thread): it keeps that prompt first and says
+// the switch in a later developer message, after a reply. search is
+// Codex's web_search tool, which it sends every turn and an Antigravity
+// model is given magpie's search for.
+func codexAGTurn(switched, search bool) string {
+ input := `{"type":"message","role":"developer","content":[{"type":"input_text","text":` + quote(codexGPT5System) + `}]},` +
+ `{"type":"message","role":"user","content":[{"type":"input_text","text":"hi"}]}`
+ if switched {
+ input += `,{"type":"message","role":"assistant","content":[{"type":"output_text","text":"hello"}]},` +
+ `{"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":"go on"}]}`
+ }
+ tools := ""
+ if search {
+ tools = `,"tools":[{"type":"function","name":"exec_command","parameters":{"type":"object","properties":{}}},{"type":"web_search"}]`
+ }
+ return `{"model":"antigravity/gemini-3-flash","stream":true,"input":[` + input + `]` + tools + `}`
+}
+
+// Jodiezzzzzz on X (10-27): every Codex call to antigravity/claude-opus-5-5
+// ended in "exceeded retry limit, last status: 429 Too Many Requests", the
+// account's only one, while dsh was served on the same account and model.
+// The thread carried Codex's GPT-5 prompt, which Antigravity turns away:
+// Codex is told why at a status it doesn't retry, Antigravity is asked
+// once, and the account doesn't rest.
+func TestAntigravityTurnsCodexsGPT5ThreadAwayOnce(t *testing.T) {
+ for _, c := range []struct{ switched, search bool }{{false, false}, {true, false}, {false, true}, {true, true}} {
+ switched, search := c.switched, c.search
+ t.Run(fmt.Sprintf("switched=%v,search=%v", switched, search), func(t *testing.T) {
+ asked := 0
+ var system string
+ // a model magpie's search can be served by, as a Google
+ // sign-in's own Gemini searches for it
+ s, askedUsage := antigravityGroupFor(t, []string{"[email protected]"}, "gemini-3-flash", func(w http.ResponseWriter, r *http.Request) {
+ asked++
+ b, _ := io.ReadAll(r.Body)
+ system = string(b)
+ w.WriteHeader(http.StatusTooManyRequests)
+ io.WriteString(w, turnedAway)
+ })
+ rec := httptest.NewRecorder()
+ s.Handler().ServeHTTP(rec, httptest.NewRequest("POST", "/v1/responses", strings.NewReader(codexAGTurn(switched, search))))
+ code, out := rec.Code, rec.Body.String()
+ if !strings.Contains(system, "systemInstruction") || !strings.Contains(system, "an agent based on GPT-5") || search != strings.Contains(system, `"web_search"`) {
+ t.Fatalf("the prompt didn't go as the system instruction, so this isn't the case: %s", system)
+ }
+ if code != http.StatusBadRequest {
+ t.Fatalf("Codex got %d, which it retries: %s", code, out)
+ }
+ if !strings.Contains(out, "Resource has been exhausted") || !strings.Contains(out, antigravityCodexHint) {
+ t.Fatalf("Codex isn't told Antigravity's words and why: %s", out)
+ }
+ if asked != 1 {
+ t.Fatalf("Antigravity was asked %d times", asked)
+ }
+ r := lastRoute(s)
+ if len(r.Tries) != 1 || r.Tries[0].Fail != failPrompt || r.Tries[0].Rest != nil {
+ t.Fatalf("the try: %+v", r.Tries)
+ }
+ if *askedUsage != 0 {
+ t.Fatalf("the account's usage was asked again %d times", *askedUsage)
+ }
+ if _, ok := restOf("antigravity@[email protected]"); ok {
+ t.Fatalf("the account rests for a prompt it turned away: %v", rests())
+ }
+ })
+ }
+}
+
+// In a group, the next Codex turn carrying that prompt skips Antigravity
+// as Claude Code's does, and the skip says Codex's hint.
+func TestAntigravityForeseesCodexsGPT5Prompt(t *testing.T) {
+ asked := 0
+ s, _ := antigravityTurnedAwayGroup(t, []string{"[email protected]"}, func(w http.ResponseWriter, r *http.Request) {
+ asked++
+ w.WriteHeader(http.StatusTooManyRequests)
+ io.WriteString(w, turnedAway)
+ })
+ for range 2 {
+ if code, out := turnOn(t, s, claudeTurn(codexGPT5System)); code != 200 || !strings.Contains(out, "from the other") {
+ t.Fatalf("the turn: %d %s", code, out)
+ }
+ }
+ if asked != 1 {
+ t.Fatalf("Antigravity was asked %d times", asked)
+ }
+ if c := s.Recent()[0]; !strings.Contains(c.Fallback, antigravityCodexHint) {
+ t.Fatalf("the skip doesn't say why: %q", c.Fallback)
+ }
+}
+
+func TestAntigravityCodexHintIsTheRoutingPages(t *testing.T) {
+ b, err := os.ReadFile(filepath.Join("..", "gui", "assets", "plugins", "routing", "client.js"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !strings.Contains(string(b), quote(antigravityCodexHint)) {
+ t.Fatal("plugins/routing/client.js doesn't know the note the gateway adds to Antigravity's refusal of Codex's prompt")
+ }
+}
diff --git a/internal/gateway/codeassist.go b/internal/gateway/codeassist.go
index 711b507f6..ef4318fb8 100644
--- a/internal/gateway/codeassist.go
+++ b/internal/gateway/codeassist.go
@@ -2,6 +2,7 @@ package gateway
import (
"cmp"
+ "context"
"encoding/json"
"fmt"
"net/http"
@@ -49,11 +50,43 @@ func accountAgent(p provider.Provider) string {
// 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.
+// in a message go through (#666). Codex's own identity line for its GPT-5
+// models is turned away the same way (antigravityTurnsCodexAway). 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")
+ strings.Contains(system, "built on Anthropic's Claude Agent SDK") ||
+ antigravityTurnsCodexAway(system)
+}
+
+// codexTurnedAway are the identity lines of Codex's own prompts for its
+// GPT-5 models (gpt-5.6-sol's "You are Codex, an agent based on GPT-5. You
+// and the user share one workspace…"), lower-cased: Antigravity turns them
+// away in the system instruction, in any case, on every model, with the
+// same 429. Codex sends its model's prompt as the conversation's first
+// developer message, and a thread begun on a GPT model keeps it when it is
+// switched to another (/model, resume -m) or forked as an agent's thread,
+// so such a thread on an Antigravity model never got an answer (Jodiezzzzzz
+// on X, 10-27: "exceeded retry limit, last status: 429" from Codex while
+// dsh was served on the same account and model). magpie's own Codex prompt
+// for other models ("You are Codex, based on GPT-5."), "an AI agent based on
+// GPT-5" and GPT-6's prompt go through, tried on a real account.
+var codexTurnedAway = []string{
+ "you are codex, an agent based on gpt-5",
+ "you are codex, a coding agent based on gpt-5",
+}
+
+// antigravityTurnsCodexAway says whether system carries Codex's GPT-5
+// identity line that Antigravity turns away.
+func antigravityTurnsCodexAway(system string) bool {
+ low := strings.ToLower(system)
+ for _, line := range codexTurnedAway {
+ if strings.Contains(low, line) {
+ return true
+ }
+ }
+ return false
}
// antigravityRefuses is what Antigravity says when it turns such a request
@@ -85,16 +118,21 @@ const agForeseeing = 6 * time.Hour
// Antigravity has refused it within agForeseeing. It holds for exactly the
// requests antigravityTurnedAway would tell as the refusal, and it changes
// nothing about the account.
-func (s *Server) antigravityForeseen(p provider.Provider, from provider.Protocol, body []byte) bool {
+// What it gives is the hint for that system prompt, or "" when p would be
+// asked.
+func (s *Server) antigravityForeseen(p provider.Provider, from provider.Protocol, body []byte) string {
if accountAgent(p) != "antigravity" {
- return false
+ return ""
}
at := s.agTurnedAway.Load()
if at == 0 || time.Since(time.Unix(0, at)) > agForeseeing {
- return false
+ return ""
}
req, err := parse(from, body)
- return err == nil && antigravityTurnsAway(req.System)
+ if err != nil || !antigravityTurnsAway(req.System) {
+ return ""
+ }
+ return antigravityHint(req.System)
}
// antigravityTurnedAwayHint is what magpie adds to Antigravity's words, after
@@ -102,6 +140,20 @@ func (s *Server) antigravityForeseen(p provider.Provider, from provider.Protocol
// its own language (routing/client.js AG_TURNED_AWAY).
const antigravityTurnedAwayHint = "Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group"
+// antigravityCodexHint is the hint for Codex's GPT-5 system prompt
+// (routing/client.js AG_CODEX): the thread keeps the prompt it began with,
+// and a new one on the Antigravity model is sent magpie's own.
+const antigravityCodexHint = "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model"
+
+// antigravityHint is the hint for what Antigravity turned away with system
+// as its system instruction.
+func antigravityHint(system string) string {
+ if antigravityTurnsCodexAway(system) {
+ return antigravityCodexHint
+ }
+ return antigravityTurnedAwayHint
+}
+
// turnedAwayStatus is what the agent is told when nobody is left to answer
// what Antigravity turned away: a request it shouldn't send again as it is.
// Antigravity's own 429 had the Anthropic and OpenAI SDKs — Claude Desktop,
@@ -1228,3 +1280,42 @@ func hasResponse(parts []map[string]any) bool {
}
return false
}
+
+// antigravityRound is ask, a round of magpie's own search for p, told as
+// the refusal it is when Antigravity turns the system prompt away: its 429
+// or the reply's own error event gets the hint, and the attempt is marked
+// so the account doesn't rest. Codex asks every turn with its web_search
+// tool, which an Antigravity model is given magpie's search for, so its
+// turns went this way and came back as the plain 429 that Codex retried to
+// its limit (Jodiezzzzzz on X, 10-27).
+func antigravityRound(w http.ResponseWriter, p provider.Provider, ask round) round {
+ if accountAgent(p) != "antigravity" {
+ return ask
+ }
+ return func(ctx context.Context, req *Request) (<-chan Event, int, string) {
+ in, status, msg := ask(ctx, req)
+ if in == nil {
+ if status == http.StatusTooManyRequests && antigravityTurnedAway(p, req.System, msg) {
+ markAntigravityTurnsAway(w, req.System)
+ msg += " — " + antigravityHint(req.System)
+ }
+ return in, status, msg
+ }
+ out := make(chan Event, cap(in))
+ go func() {
+ defer close(out)
+ for ev := range in {
+ if ev.Kind == KError && markAntigravityRefused(w, p, req.System, ev.Text) {
+ ev.Text += " — " + antigravityHint(req.System)
+ }
+ select {
+ case out <- ev:
+ case <-ctx.Done():
+ // in's own reader stops sending once ctx is done
+ return
+ }
+ }
+ }()
+ return out, status, msg
+ }
+}
diff --git a/internal/gateway/continuation.go b/internal/gateway/continuation.go
index 571f6fcd8..19dcf8075 100644
--- a/internal/gateway/continuation.go
+++ b/internal/gateway/continuation.go
@@ -501,11 +501,11 @@ func (s *Server) streamTranslated(w http.ResponseWriter, r *http.Request, p prov
}
turnedAway := res.StatusCode == http.StatusTooManyRequests && antigravityTurnedAway(p, request.System, string(b))
if turnedAway {
- failed += " — " + antigravityTurnedAwayHint
+ failed += " — " + antigravityHint(request.System)
}
if !cont.resume {
if turnedAway {
- markAntigravityTurnsAway(w)
+ markAntigravityTurnsAway(w, request.System)
}
if p.Preset == "openrouter" && openRouterSharedPool(b) {
markOpenRouterSharedPool(w)
@@ -658,8 +658,8 @@ func (s *Server) streamTranslated(w http.ResponseWriter, r *http.Request, p prov
}
if failed != "" && markAntigravityRefused(w, p, request.System, failed) {
// the same refusal as the 429's, said inside the reply
- if !strings.HasSuffix(failed, antigravityTurnedAwayHint) {
- failed += " — " + antigravityTurnedAwayHint
+ if hint := antigravityHint(request.System); !strings.HasSuffix(failed, hint) {
+ failed += " — " + hint
}
u.ErrType = turnedAwayErrType
}
diff --git a/internal/gateway/fallback.go b/internal/gateway/fallback.go
index e7acc505b..0a60f1345 100644
--- a/internal/gateway/fallback.go
+++ b/internal/gateway/fallback.go
@@ -1654,6 +1654,8 @@ type holdWriter struct {
// answers with a 429 whatever quota it has left — Claude Code's, its
// Agent SDK's — so the account isn't at fault and doesn't rest (#666)
turnedAway bool
+ // turnedAwayHint says why, for that system prompt (antigravityHint)
+ turnedAwayHint string
// refused: the vendor's safety filter ended the reply before any of it
// was said — Anthropic's stop_reason "refusal", OpenAI's content_filter
diff --git a/internal/gateway/gateway.go b/internal/gateway/gateway.go
index e66e1a621..d05131a11 100644
--- a/internal/gateway/gateway.go
+++ b/internal/gateway/gateway.go
@@ -2597,16 +2597,16 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request, from provider.Pro
}
// a middleware's onProvider changes what this provider is sent
attemptBody = triedOn(r.Context(), c.p, c.model, attemptBody)
- if !last && s.antigravityForeseen(c.p, from, attemptBody) {
+ if hint := s.antigravityForeseen(c.p, from, attemptBody); !last && hint != "" {
// Antigravity would only turn it away, as it did lately, and
// someone after it may answer: it isn't asked, and nothing is
// held against the account (#2156). If nobody after it answers
// but with a quota, the agent is told this, as it would be had
// Antigravity been asked
if other == nil {
- other = &Try{Status: turnedAwayStatus, Error: c.p.Name + ": " + antigravityTurnedAwayHint}
+ other = &Try{Status: turnedAwayStatus, Error: c.p.Name + ": " + hint}
}
- skipped = append(skipped, c.label()+": "+antigravityTurnedAwayHint)
+ skipped = append(skipped, c.label()+": "+hint)
continue
}
// a group tells agents the longest reply a member of it gives
@@ -2922,8 +2922,8 @@ func (s *Server) serve(w http.ResponseWriter, r *http.Request, from provider.Pro
if hw.turnedAway {
s.agTurnedAway.Store(time.Now().UnixNano())
}
- if hw.turnedAway && !strings.HasSuffix(call.Error, antigravityTurnedAwayHint) {
- call.Error += " — " + antigravityTurnedAwayHint
+ if hw.turnedAway && !strings.HasSuffix(call.Error, hw.turnedAwayHint) {
+ call.Error += " — " + hw.turnedAwayHint
}
if hw.refused {
// the vendor's safety filter, with nothing said (#248)
@@ -4006,11 +4006,12 @@ func markOpenRouterSharedPool(w http.ResponseWriter) {
}
// markAntigravityTurnsAway keeps in the held attempt that the account was
-// asked with the system prompt Antigravity turns away, so a failure on it
-// isn't held against the account.
-func markAntigravityTurnsAway(w http.ResponseWriter) {
+// asked with system, the system prompt Antigravity turns away, so a failure
+// on it isn't held against the account, and the hint that says why.
+func markAntigravityTurnsAway(w http.ResponseWriter, system string) {
if h, ok := w.(*holdWriter); ok {
h.turnedAway = true
+ h.turnedAwayHint = antigravityHint(system)
}
}
@@ -4026,7 +4027,7 @@ func markAntigravityRefused(w http.ResponseWriter, p provider.Provider, system,
if said == "" || !antigravityTurnedAway(p, system, said) {
return false
}
- markAntigravityTurnsAway(w)
+ markAntigravityTurnsAway(w, system)
return true
}
@@ -6160,7 +6161,7 @@ func (s *Server) translate(w http.ResponseWriter, r *http.Request, p provider.Pr
}
}
if !searching(r.Context()) && canSearchFor(p) && !searchesFor(p, to, model, request) {
- ask := s.askTranslated(p, to, model, r.Header, w.Header())
+ ask := antigravityRound(w, p, s.askTranslated(p, to, model, r.Header, w.Header()))
if zen != nil {
ask = zenRound(zen.z, ask)
}
@@ -6188,8 +6189,8 @@ func (s *Server) translate(w http.ResponseWriter, r *http.Request, p provider.Pr
}
turnedAway := res.StatusCode == http.StatusTooManyRequests && antigravityTurnedAway(p, request.System, string(b))
if turnedAway {
- msg += " — " + antigravityTurnedAwayHint
- markAntigravityTurnsAway(w)
+ msg += " — " + antigravityHint(request.System)
+ markAntigravityTurnsAway(w, request.System)
}
if p.Preset == "openrouter" && openRouterSharedPool(b) {
markOpenRouterSharedPool(w)
@@ -6251,7 +6252,7 @@ func (s *Server) translate(w http.ResponseWriter, r *http.Request, p provider.Pr
if col.err != "" && (!saidAnything(col.res.Parts) || col.errSaid != nil) {
said := col.err
if markAntigravityRefused(w, p, request.System, said) {
- said += " — " + antigravityTurnedAwayHint
+ said += " — " + antigravityHint(request.System)
u.ErrType = turnedAwayErrType
}
if code := gjson.GetBytes(col.errSaid, "error.code").String(); code != "" {
diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js
index b1b2248b2..93bd0d939 100644
--- a/internal/gui/assets/i18n.js
+++ b/internal/gui/assets/i18n.js
@@ -3271,6 +3271,7 @@ const I18N = {
"rerouted": "改道",
"WorkBuddy refuses chats from Codex and Claude Code (their system prompt); use it from Hermes, OpenCode or Pi, or add another provider to this group": "WorkBuddy 会因系统提示词拒绝 Codex 和 Claude Code 的对话;请在 Hermes、OpenCode 或 Pi 中使用,或在此分组中再加一个供应商",
"Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group": "Antigravity 对 Claude Code 和 Claude Agent SDK(Claude Desktop 的对话)的系统提示词都会回这个 429,与剩余额度无关,所以这不是额度用尽,等待也不会好;请用其他供应商处理这些对话,或在路由分组中把另一个供应商排在 Antigravity 之后",
+ "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model": "Antigravity 对 Codex 给 GPT-5 模型的系统提示词都会回这个 429,与剩余额度无关,所以这不是额度用尽,等待也不会好;在 GPT 模型上开始的 Codex 对话切换模型或分叉后仍带着这段提示词,请在这个模型上新开一个对话",
"the provider's network firewall blocked requests from this IP; wait a while, or switch to another network or proxy": "供应商的网络防火墙拦截了此 IP 的请求;请稍后再试,或更换网络或代理",
"ZCode's risk control blocked this account for unusual activity (code 3012); it rests, and the group's other providers are used. If the ZCode app fails on this account too, only ZCode support can lift the block": "ZCode 风控因异常行为封禁了这个账号(代码 3012);它会暂停使用,改用此分组中的其他供应商。如果用这个账号在 ZCode 官方 App 里也失败,只有 ZCode 客服能解除",
"rate limited": "限流",
@@ -7225,6 +7226,7 @@ const I18N = {
"rerouted": "改道",
"WorkBuddy refuses chats from Codex and Claude Code (their system prompt); use it from Hermes, OpenCode or Pi, or add another provider to this group": "WorkBuddy 會因系統提示詞拒絕 Codex 和 Claude Code 的對話;請在 Hermes、OpenCode 或 Pi 中使用,或在此分組中再加一個供應商",
"Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group": "Antigravity 對 Claude Code 和 Claude Agent SDK(Claude Desktop 的對話)的系統提示詞都會回這個 429,與剩餘額度無關,所以這不是額度用盡,等待也不會好;請用其他供應商處理這些對話,或在路由分組中把另一個供應商排在 Antigravity 之後",
+ "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model": "Antigravity 對 Codex 給 GPT-5 模型的系統提示詞都會回這個 429,與剩餘額度無關,所以這不是額度用盡,等待也不會好;在 GPT 模型上開始的 Codex 對話切換模型或分叉後仍帶著這段提示詞,請在這個模型上新開一個對話",
"the provider's network firewall blocked requests from this IP; wait a while, or switch to another network or proxy": "供應商的網路防火牆攔截了此 IP 的請求;請稍後再試,或更換網路或代理",
"ZCode's risk control blocked this account for unusual activity (code 3012); it rests, and the group's other providers are used. If the ZCode app fails on this account too, only ZCode support can lift the block": "ZCode 風控因異常行為封鎖了這個帳號(代碼 3012);它會暫停使用,改用此分組中的其他供應商。如果用這個帳號在 ZCode 官方 App 裡也失敗,只有 ZCode 客服能解除",
"rate limited": "限流",
@@ -11195,6 +11197,7 @@ const I18N = {
"rerouted": "再ルーティング",
"WorkBuddy refuses chats from Codex and Claude Code (their system prompt); use it from Hermes, OpenCode or Pi, or add another provider to this group": "WorkBuddy は Codex と Claude Code からのチャットを(そのシステムプロンプトが原因で)拒否します。Hermes、OpenCode、Pi から使うか、このグループに別のプロバイダを追加してください",
"Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group": "Antigravity は Claude Code と Claude Agent SDK(Claude Desktop のチャット)のシステムプロンプトに対し、残りクォータに関係なくこの 429 を返します。クォータ切れではなく、待っても解決しません。これらのチャットには別のプロバイダを使うか、ルーティンググループで Antigravity の後に別のプロバイダを置いてください",
+ "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model": "Antigravity は Codex の GPT-5 モデル向けシステムプロンプトに対し、残りクォータに関係なくこの 429 を返します。クォータ切れではなく、待っても解決しません。GPT モデルで始めた Codex のチャットは、モデルを切り替えたりフォークしたりしてもそのプロンプトを持ち続けるので、このモデルで新しいチャットを始めてください",
"the provider's network firewall blocked requests from this IP; wait a while, or switch to another network or proxy": "プロバイダのネットワークファイアウォールがこの IP からのリクエストをブロックしました。しばらく待つか、別のネットワークやプロキシに切り替えてください",
"ZCode's risk control blocked this account for unusual activity (code 3012); it rests, and the group's other providers are used. If the ZCode app fails on this account too, only ZCode support can lift the block": "ZCode のリスク管理が不審なアクティビティを理由にこのアカウントをブロックしました(コード 3012)。このアカウントは休止し、グループの他のプロバイダが使われます。ZCode アプリでもこのアカウントが失敗する場合、解除できるのは ZCode サポートだけです",
"rate limited": "レート制限",
@@ -15174,6 +15177,7 @@ const I18N = {
"rerouted": "umgeleitet",
"WorkBuddy refuses chats from Codex and Claude Code (their system prompt); use it from Hermes, OpenCode or Pi, or add another provider to this group": "WorkBuddy lehnt Chats von Codex und Claude Code ab (wegen ihres System-Prompts); nutzen Sie es aus Hermes, OpenCode oder Pi oder fügen Sie dieser Gruppe einen weiteren Anbieter hinzu",
"Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group": "Antigravity beantwortet den System-Prompt von Claude Code und dem Claude Agent SDK (Chats in Claude Desktop) mit diesem 429, egal wie viel Kontingent übrig ist – das Kontingent ist also nicht aufgebraucht, und Warten hilft nicht; nutzen Sie für diese Chats einen anderen Anbieter oder setzen Sie in einer Routing-Gruppe einen hinter Antigravity",
+ "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model": "Antigravity beantwortet den eigenen System-Prompt von Codex für GPT-5-Modelle mit diesem 429, egal wie viel Kontingent übrig ist – das Kontingent ist also nicht aufgebraucht, und Warten hilft nicht; ein Codex-Chat, der auf einem GPT-Modell begonnen wurde, behält diesen Prompt nach einem Modellwechsel oder Fork, also beginnen Sie einen neuen Chat mit diesem Modell",
"the provider's network firewall blocked requests from this IP; wait a while, or switch to another network or proxy": "die Netzwerk-Firewall des Anbieters hat Anfragen von dieser IP blockiert; warten Sie eine Weile oder wechseln Sie Netzwerk oder Proxy",
"ZCode's risk control blocked this account for unusual activity (code 3012); it rests, and the group's other providers are used. If the ZCode app fails on this account too, only ZCode support can lift the block": "Die Risikokontrolle von ZCode hat dieses Konto wegen ungewöhnlicher Aktivität gesperrt (Code 3012); es pausiert, und die anderen Anbieter der Gruppe werden genutzt. Scheitert das Konto auch in der ZCode-App, kann nur der ZCode-Support die Sperre aufheben",
"rate limited": "Rate-Limit",
diff --git a/internal/gui/assets/plugins/routing/client.js b/internal/gui/assets/plugins/routing/client.js
index f560c8086..d2267128e 100644
--- a/internal/gui/assets/plugins/routing/client.js
+++ b/internal/gui/assets/plugins/routing/client.js
@@ -1141,10 +1141,13 @@ function routingPage(part) {
// what it adds to Antigravity's 429 for Claude Code's and the Agent SDK's
// system prompt (antigravityTurnedAwayHint, #666, #1425)
const AG_TURNED_AWAY = "Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group";
+ // what it adds to the same 429 for Codex's own GPT-5 system prompt, which
+ // a thread begun on a GPT model keeps after a switch (antigravityCodexHint)
+ const AG_CODEX = "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model";
// what it adds to WorkBuddy's 403 11140 for an account it restricted
// (provider.WBRestrictedHint, #1849)
const WB_RESTRICTED = "WorkBuddy restricted this account for unusual activity; it stays out until WorkBuddy lifts that, which an appeal (Submit feedback in WorkBuddy) asks for";
- const HINTS = [WB_REFUSED, BLOCKED, ZCODE_BLOCKED, AG_TURNED_AWAY, WB_RESTRICTED];
+ const HINTS = [WB_REFUSED, BLOCKED, ZCODE_BLOCKED, AG_TURNED_AWAY, AG_CODEX, WB_RESTRICTED];
function trySaid(r, i) {
const tr = r.tries[i], w = tried(r, tr), agent = agentName(r.agent);
diff --git a/internal/gui/tests/routing-ag-turned-away.test.cjs b/internal/gui/tests/routing-ag-turned-away.test.cjs
index f721f0302..e6c5ee86c 100644
--- a/internal/gui/tests/routing-ag-turned-away.test.cjs
+++ b/internal/gui/tests/routing-ag-turned-away.test.cjs
@@ -6,7 +6,9 @@
// one. It is told as the agent's prompt turned away, in the request's row,
// its story and the account's tally, with the 400 the agent got; the
// vendor's words are said apart from magpie's note, which is in the page's
-// language.
+// language. Codex's own GPT-5 prompt, which a thread begun on a GPT model
+// keeps after a switch to Antigravity's (Jodiezzzzzz on X, 10-27), is told
+// the same way with its own note.
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const path = require("node:path");
@@ -18,19 +20,22 @@ const now = new Date();
const day = [now.getFullYear(), now.getMonth() + 1, now.getDate()].map((n) => String(n).padStart(2, "0")).join("-");
const at = (i) => new Date(now.getTime() - (i + 1) * 60e3).toISOString();
const hint = "Antigravity answers this 429 to the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) whatever quota is left, so it is not a quota and waiting won't help; use another provider for these chats, or put one after Antigravity in a routing group";
+const codexHint = "Antigravity answers this 429 to Codex's own system prompt for GPT-5 models whatever quota is left, so it is not a quota and waiting won't help; a Codex chat begun on a GPT model keeps that prompt after a model switch or a fork, so start a new chat on this model";
const vendor = "Antigravity: Resource has been exhausted (e.g. check quota).";
const key = { id: "antigravity@[email protected]", provider: "antigravity", name: "Antigravity", kind: "account", who: "[email protected]", model: "gemini-3.8-flash" };
// as the gateway now traces it: the try Antigravity's 429, told as the
// agent's prompt turned away, not resting; the request the 400 the agent got
-const error = vendor + " — " + hint;
-const routes = [0, 1].map((i) => ({
- id: 100 - i, seq: 100 - i, time: at(i), agent: "claude-desktop", model: "antigravity/gemini-3.8-flash", provider: "antigravity",
- order: [key], tries: [{ id: key.id, model: key.model, start: at(i), done: true, status: 429, ms: 400, error, fail: "prompt", effort: "high" }],
- done: true, status: 400, ms: 400, error, effort: "high",
-}));
+const routesOf = (agent, note) => {
+ const error = vendor + " — " + note;
+ return [0, 1].map((i) => ({
+ id: 100 - i, seq: 100 - i, time: at(i), agent, model: "antigravity/gemini-3.8-flash", provider: "antigravity",
+ order: [key], tries: [{ id: key.id, model: key.model, start: at(i), done: true, status: 429, ms: 400, error, fail: "prompt", effort: "high" }],
+ done: true, status: 400, ms: 400, error, effort: "high",
+ }));
+};
-function serve(lang) {
- const state = { agents: [{ id: "claude-desktop", name: "Claude Desktop", path: "/test/config.json", fields: [] }], profiles: [], settings: { lang, theme: "light" } };
+function serve(lang, routes) {
+ const state = { agents: [{ id: "claude-desktop", name: "Claude Desktop", path: "/test/config.json", fields: [] }, { id: "codex", name: "Codex", path: "/test/config.toml", fields: [] }], profiles: [], settings: { lang, theme: "light" } };
return async (route) => {
const url = new URL(route.request().url());
const json = (data) => route.fulfill({ json: data });
@@ -56,34 +61,35 @@ function serve(lang) {
}
const want = {
- en: { said: "It said: " + vendor, hint, fail: "agent's prompt turned away", quota: "quota used up" },
- zh: { said: "原话:" + vendor, hint: "Antigravity 对 Claude Code 和 Claude Agent SDK(Claude Desktop 的对话)的系统提示词都会回这个 429,与剩余额度无关,所以这不是额度用尽,等待也不会好;请用其他供应商处理这些对话,或在路由分组中把另一个供应商排在 Antigravity 之后", fail: "Agent 的提示词被拒", quota: "额度用尽" },
- "zh-TW": { said: "原話:" + vendor, hint: "Antigravity 對 Claude Code 和 Claude Agent SDK(Claude Desktop 的對話)的系統提示詞都會回這個 429,與剩餘額度無關,所以這不是額度用盡,等待也不會好;請用其他供應商處理這些對話,或在路由分組中把另一個供應商排在 Antigravity 之後", fail: "Agent 的提示詞被拒", quota: "額度用盡" },
- ja: { said: "メッセージ:" + vendor, hint: "Antigravity は Claude Code と Claude Agent SDK(Claude Desktop のチャット)のシステムプロンプトに対し、残りクォータに関係なくこの 429 を返します。クォータ切れではなく、待っても解決しません。これらのチャットには別のプロバイダを使うか、ルーティンググループで Antigravity の後に別のプロバイダを置いてください", fail: "エージェントのプロンプトを拒否", quota: "クォータ切れ" },
- de: { said: "Meldung: " + vendor, hint: "Antigravity beantwortet den System-Prompt von Claude Code und dem Claude Agent SDK (Chats in Claude Desktop) mit diesem 429, egal wie viel Kontingent übrig ist – das Kontingent ist also nicht aufgebraucht, und Warten hilft nicht; nutzen Sie für diese Chats einen anderen Anbieter oder setzen Sie in einer Routing-Gruppe einen hinter Antigravity", fail: "Prompt des Agenten abgelehnt", quota: "Kontingent aufgebraucht" },
+ en: { said: "It said: " + vendor, hint, codex: codexHint, fail: "agent's prompt turned away", quota: "quota used up" },
+ zh: { said: "原话:" + vendor, hint: "Antigravity 对 Claude Code 和 Claude Agent SDK(Claude Desktop 的对话)的系统提示词都会回这个 429,与剩余额度无关,所以这不是额度用尽,等待也不会好;请用其他供应商处理这些对话,或在路由分组中把另一个供应商排在 Antigravity 之后", codex: "Antigravity 对 Codex 给 GPT-5 模型的系统提示词都会回这个 429,与剩余额度无关,所以这不是额度用尽,等待也不会好;在 GPT 模型上开始的 Codex 对话切换模型或分叉后仍带着这段提示词,请在这个模型上新开一个对话", fail: "Agent 的提示词被拒", quota: "额度用尽" },
+ "zh-TW": { said: "原話:" + vendor, hint: "Antigravity 對 Claude Code 和 Claude Agent SDK(Claude Desktop 的對話)的系統提示詞都會回這個 429,與剩餘額度無關,所以這不是額度用盡,等待也不會好;請用其他供應商處理這些對話,或在路由分組中把另一個供應商排在 Antigravity 之後", codex: "Antigravity 對 Codex 給 GPT-5 模型的系統提示詞都會回這個 429,與剩餘額度無關,所以這不是額度用盡,等待也不會好;在 GPT 模型上開始的 Codex 對話切換模型或分叉後仍帶著這段提示詞,請在這個模型上新開一個對話", fail: "Agent 的提示詞被拒", quota: "額度用盡" },
+ ja: { said: "メッセージ:" + vendor, hint: "Antigravity は Claude Code と Claude Agent SDK(Claude Desktop のチャット)のシステムプロンプトに対し、残りクォータに関係なくこの 429 を返します。クォータ切れではなく、待っても解決しません。これらのチャットには別のプロバイダを使うか、ルーティンググループで Antigravity の後に別のプロバイダを置いてください", codex: "Antigravity は Codex の GPT-5 モデル向けシステムプロンプトに対し、残りクォータに関係なくこの 429 を返します。クォータ切れではなく、待っても解決しません。GPT モデルで始めた Codex のチャットは、モデルを切り替えたりフォークしたりしてもそのプロンプトを持ち続けるので、このモデルで新しいチャットを始めてください", fail: "エージェントのプロンプトを拒否", quota: "クォータ切れ" },
+ de: { said: "Meldung: " + vendor, hint: "Antigravity beantwortet den System-Prompt von Claude Code und dem Claude Agent SDK (Chats in Claude Desktop) mit diesem 429, egal wie viel Kontingent übrig ist – das Kontingent ist also nicht aufgebraucht, und Warten hilft nicht; nutzen Sie für diese Chats einen anderen Anbieter oder setzen Sie in einer Routing-Gruppe einen hinter Antigravity", codex: "Antigravity beantwortet den eigenen System-Prompt von Codex für GPT-5-Modelle mit diesem 429, egal wie viel Kontingent übrig ist – das Kontingent ist also nicht aufgebraucht, und Warten hilft nicht; ein Codex-Chat, der auf einem GPT-Modell begonnen wurde, behält diesen Prompt nach einem Modellwechsel oder Fork, also beginnen Sie einen neuen Chat mit diesem Modell", fail: "Prompt des Agenten abgelehnt", quota: "Kontingent aufgebraucht" },
};
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
- for (const lang of Object.keys(want)) {
- test(`${engine} ${lang}: Antigravity turning Claude Desktop's prompt away isn't a quota`, async (t) => {
+ for (const lang of Object.keys(want)) for (const [agent, note] of [["claude-desktop", "hint"], ["codex", "codex"]]) {
+ test(`${engine} ${lang}: Antigravity turning ${agent}'s prompt away isn't a quota`, async (t) => {
+ const routes = routesOf(agent, note === "codex" ? codexHint : hint);
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
const context = await browser.newContext({ viewport: { width: 1100, height: 760 }, reducedMotion: "reduce" });
const page = await context.newPage();
page.setDefaultTimeout(5000);
const errors = [];
page.on("pageerror", (e) => errors.push(e.message));
- await page.route("**/*", serve(lang));
+ await page.route("**/*", serve(lang, routes));
t.after(async () => {
if (process.env.ARTIFACT_DIR) {
await fs.mkdir(process.env.ARTIFACT_DIR, { recursive: true });
- await page.screenshot({ path: path.join(process.env.ARTIFACT_DIR, `${engine}-${lang}-ag-turned-away.png`), fullPage: true });
+ await page.screenshot({ path: path.join(process.env.ARTIFACT_DIR, `${engine}-${lang}-${agent}-ag-turned-away.png`), fullPage: true });
}
await browser.close();
});
await page.goto("http://magpie.test/?view=routing");
await page.locator(".rt-days .rt-day").nth(1).click();
await page.locator(".rt-req").nth(routes.length - 1).waitFor();
- const w = want[lang];
+ const w = { ...want[lang], hint: want[lang][note] };
// the request's row: the 400 the agent got, the prompt turned away
const row = page.locator(".rt-req").nth(0);