Skip to content

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

gateway: Antigravity answers Codex's switched threads and Hermes' old persona with no setup

yetone1885c607e276
diff --git a/docs/reference.md b/docs/reference.md
index fe0d0a3f8..8722a6950 100644
--- a/docs/reference.md
+++ b/docs/reference.md
@@ -1107,8 +1107,11 @@ Ready-made middleware, under Plugins › Discover › Gateway middleware
with the same JSON: `param-override` (`param_override`), `model-map`
(`model_mapping`), `system-prompt`, `word-guard` (sensitive words) and
`think-tags` (strip `<think>…</think>`, or `thinking_to_content`), and
-`antigravity-cloak`, which keeps the words Antigravity turns Claude Code's
-system prompt away for out of what it sends Antigravity alone. A
+`antigravity-cloak`, which keeps words Antigravity turns a system prompt
+away for out of what it sends Antigravity alone (magpie itself already
+breaks up the lines it knows of: Codex's, Claude Code's, Hermes' earlier
+persona; `magpie provider set antigravity prompt=as-written` turns that
+off). A
middleware's entry in the community `registry.json` has
`"kind": "middleware"` and no `providers`.
diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.md
index 4b16cb634..1ea702743 100644
--- a/docs/subsystems/gateway-routing.md
+++ b/docs/subsystems/gateway-routing.md
@@ -243,6 +243,7 @@ recorded as a prediction failure (`noPrediction`).
- 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`). 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.
+- Antigravity answers a system instruction holding one of a few lines with a 429 "Resource has been exhausted" whatever quota is left, on every model (`agTurnedAway` in [`codeassist.go`](../../internal/gateway/codeassist.go)): Claude Code's billing line, the Claude Agent SDK's identity line, Codex's identity lines for its GPT-5 models (which a Codex thread begun on a GPT model keeps after a switch), and Hermes Agent's earlier default persona. An Antigravity account's system instruction goes with a zero-width space after each such line's first letter (`antigravityCloak`, in `codeAssistBody`), which Google lets through and the model reads the same; every other provider, Gemini CLI's sign-in on the same envelope included, is sent the prompt as written. `magpie provider set antigravity prompt=as-written` (`Provider.PromptAsWritten`) turns it off. The refusal is still told against the system prompt as the agent wrote it (`antigravityTurnedAway`): a 400 with the hint for that prompt, the account not rested, and a group skipping Antigravity for that prompt for 6 hours after a refusal (`antigravityForeseen`).
- 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/cli/providers_cli.go b/internal/cli/providers_cli.go
index 1f5272a27..dadad973c 100644
--- a/internal/cli/providers_cli.go
+++ b/internal/cli/providers_cli.go
@@ -44,6 +44,9 @@ const providerUsage = `usage:
Copilot), compaction=magpie, the default, has magpie summarise
routing=smart|order|rotate|usage|pace|weight|free|fast spreads requests
over its keys or accounts (fast: the one that answered fastest lately first);
+ prompt=as-written sends Antigravity the system prompt exactly as written;
+ prompt=default, the default, breaks up the lines Google answers with a
+ false 429 (Codex's, Claude Code's, Hermes' old persona) with a zero-width space
additional-tools=on sends a tool Claude Code's tool search loads to its
Responses API where it was loaded (an additional_tools item, which
keeps the cache); additional-tools=default puts it with the other tools
@@ -1094,6 +1097,19 @@ func applyPairs(p *provider.Provider, pairs []string) error {
default:
return fmt.Errorf("codex=as-sent|default, not %q", v)
}
+ case "prompt":
+ // as-written: Antigravity's subscription is sent the system
+ // prompt exactly as the agent wrote it, the lines Google turns
+ // away with a 429 included; default breaks those lines up
+ // with a zero-width space (Provider.PromptAsWritten)
+ switch strings.ToLower(v) {
+ case "as-written", "as-sent", "on", "yes":
+ p.PromptAsWritten = true
+ case "default", "no", "off":
+ p.PromptAsWritten = false
+ default:
+ return fmt.Errorf("prompt=as-written|default, not %q", v)
+ }
case "additional-tools":
// on: a tool an Anthropic client's tool search loads goes to
// the provider's Responses API in an additional_tools item
diff --git a/internal/gateway/antigravity_cloak_test.go b/internal/gateway/antigravity_cloak_test.go
new file mode 100644
index 000000000..48a254682
--- /dev/null
+++ b/internal/gateway/antigravity_cloak_test.go
@@ -0,0 +1,220 @@
+package gateway
+
+import (
+ "encoding/json"
+ "io"
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "testing"
+
+ "github.com/yetone/magpie/internal/provider"
+)
+
+// hermesOldSystem is Hermes Agent's earlier default persona, the SOUL.md it
+// seeded until it replaced it, which a SOUL.md the user edited keeps.
+const hermesOldSystem = "You are Hermes Agent, an intelligent AI assistant created by Nous Research. You are helpful, knowledgeable, and direct. You assist users with a wide range of tasks including answering questions, writing and editing code, analyzing information, creative work, and executing actions via your tools."
+
+// googleTurnsAway is what a real Antigravity account turned away, each tried
+// on one on 10-27: the line as written, in the system instruction, in any
+// case. Broken up by a zero-width space after the first letter, each went
+// through.
+var googleTurnsAway = []string{
+ "x-anthropic-billing-header:",
+ "built on anthropic's 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",
+}
+
+func TestAntigravityCloakBreaksEveryLineItTurnsAway(t *testing.T) {
+ for _, system := range []string{
+ claudeCodeSystem,
+ "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
+ codexGPT5System,
+ "You are Codex, a coding agent based on GPT-5. You and the user share the same workspace.",
+ hermesOldSystem,
+ strings.ToUpper(hermesOldSystem),
+ // twice, and after text whose lower case is longer than it is
+ "İstanbul ✓ " + codexGPT5System + "\n\n" + hermesOldSystem + "\n" + codexGPT5System,
+ } {
+ if !antigravityTurnsAway(system) {
+ t.Fatalf("%q isn't taken for what Antigravity turns away", system)
+ }
+ got := antigravityCloak(system)
+ if antigravityTurnsAway(got) {
+ t.Errorf("a line Antigravity turns away is still whole in %q", got)
+ }
+ if strings.ReplaceAll(got, zeroWidth, "") != system {
+ t.Errorf("more than zero-width spaces changed: %q", got)
+ }
+ if !strings.Contains(got, zeroWidth) {
+ t.Errorf("nothing broken up: %q", got)
+ }
+ // nothing else: each break sits after a line's first letter
+ low := strings.ToLower(strings.ReplaceAll(got, zeroWidth, "|"))
+ for _, line := range googleTurnsAway {
+ if strings.Contains(strings.ToLower(system), line) && !strings.Contains(low, line[:1]+"|"+line[1:]) {
+ t.Errorf("%q isn't broken after its first letter in %q", line, got)
+ }
+ }
+ if antigravityCloak(got) != got {
+ t.Errorf("a prompt broken up once is broken again")
+ }
+ }
+ // what Antigravity answers is sent as written, word for word
+ for _, system := range []string{
+ "",
+ "You are opencode, an interactive CLI tool.",
+ "You are Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.",
+ "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 Hermes Agent, built by Nous Research. Be direct.",
+ "You are Hermes Agent, an intelligent AI assistant created by Nous.",
+ } {
+ if got := antigravityCloak(system); got != system {
+ t.Errorf("%q went as %q", system, got)
+ }
+ }
+}
+
+func TestAntigravityHermesHint(t *testing.T) {
+ if antigravityHint(hermesOldSystem) != antigravityHermesHint {
+ t.Error("Hermes' old persona isn't told its own hint")
+ }
+ if antigravityHint(codexGPT5System) != antigravityCodexHint || antigravityHint(claudeCodeSystem) != antigravityTurnedAwayHint {
+ t.Error("the other prompts lost their hints")
+ }
+}
+
+// fakeGoogle answers as a real Antigravity account did on 10-27: the 429
+// for a system instruction holding one of googleTurnsAway's lines whole,
+// and a reply otherwise. sent is the system instruction it was last sent.
+func fakeGoogle(sent *string) func(w http.ResponseWriter, r *http.Request) {
+ return func(w http.ResponseWriter, r *http.Request) {
+ var env struct {
+ Request struct {
+ SystemInstruction struct {
+ Parts []struct {
+ Text string `json:"text"`
+ } `json:"parts"`
+ } `json:"systemInstruction"`
+ } `json:"request"`
+ }
+ b, _ := io.ReadAll(r.Body)
+ json.Unmarshal(b, &env)
+ *sent = ""
+ for _, p := range env.Request.SystemInstruction.Parts {
+ *sent += p.Text
+ }
+ low := strings.ToLower(*sent)
+ for _, line := range googleTurnsAway {
+ if strings.Contains(low, line) {
+ w.WriteHeader(http.StatusTooManyRequests)
+ io.WriteString(w, turnedAway)
+ return
+ }
+ }
+ w.Header().Set("Content-Type", "text/event-stream")
+ io.WriteString(w, sse(`data: {"response":{"candidates":[{"content":{"role":"model","parts":[{"text":"from google"}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":10,"candidatesTokenCount":3}}}`))
+ }
+}
+
+// hermesTurn is a Hermes Agent turn on Antigravity's model, on the Chat
+// Completions API it reaches magpie by, with system as its system prompt.
+func hermesTurn(s *Server, system string) (int, string) {
+ body := `{"model":"antigravity/gemini-3-flash","stream":false,"messages":[{"role":"system","content":` + quote(system) + `},{"role":"user","content":"hi"}]}`
+ rec := httptest.NewRecorder()
+ r := httptest.NewRequest("POST", "/v1/chat/completions", strings.NewReader(body))
+ r.Header.Set("User-Agent", "hermes-agent/0.12")
+ s.Handler().ServeHTTP(rec, r)
+ return rec.Code, rec.Body.String()
+}
+
+func codexAGPost(s *Server, body string) (int, string) {
+ rec := httptest.NewRecorder()
+ s.Handler().ServeHTTP(rec, httptest.NewRequest("POST", "/v1/responses", strings.NewReader(body)))
+ return rec.Code, rec.Body.String()
+}
+
+// zgoodz on X (10-27): "antigravity在Hermes里一样429", and Jodiezzzzzz's Codex
+// thread begun on a GPT model: both are answered by Antigravity with no setup,
+// as the lines it turns away go broken up. Sent as written, the setting the
+// user can turn on, they are refused as before, told why at a status the
+// agent doesn't retry.
+func TestAntigravityAnswersHermesAndCodexByDefault(t *testing.T) {
+ var sent string
+ s, _ := antigravityGroupFor(t, []string{"[email protected]"}, "gemini-3-flash", fakeGoogle(&sent))
+
+ if code, out := hermesTurn(s, hermesOldSystem); code != 200 || !strings.Contains(out, "from google") {
+ t.Fatalf("Hermes: %d %s", code, out)
+ }
+ if strings.ReplaceAll(sent, zeroWidth, "") != hermesOldSystem || sent == hermesOldSystem {
+ t.Fatalf("Hermes' prompt went as %q", sent)
+ }
+ for _, search := range []bool{false, true} {
+ if code, out := codexAGPost(s, codexAGTurn(true, search)); code != 200 || !strings.Contains(out, "from google") {
+ t.Fatalf("Codex's switched thread (search=%v): %d %s", search, code, out)
+ }
+ if !strings.Contains(sent, "Y"+zeroWidth+"ou are Codex, an agent based on GPT-5") || antigravityTurnsAway(sent) {
+ t.Fatalf("Codex's prompt went as %q", sent)
+ }
+ }
+
+ p, err := provider.Find("antigravity")
+ if err != nil {
+ t.Fatal(err)
+ }
+ p.PromptAsWritten = true
+ if err := provider.Save(*p); err != nil {
+ t.Fatal(err)
+ }
+ if p, _ := provider.Find("antigravity"); !p.PromptAsWritten {
+ t.Fatal("prompt=as-written isn't kept")
+ }
+ code, out := hermesTurn(s, hermesOldSystem)
+ if sent != hermesOldSystem {
+ t.Fatalf("sent as written, Hermes' prompt went as %q", sent)
+ }
+ if code != http.StatusBadRequest || !strings.Contains(out, antigravityHermesHint) {
+ t.Fatalf("Hermes, as written: %d %s", code, out)
+ }
+ code, out = codexAGPost(s, codexAGTurn(true, false))
+ if !strings.Contains(sent, codexGPT5System) {
+ t.Fatalf("sent as written, Codex's prompt went as %q", sent)
+ }
+ if code != http.StatusBadRequest || !strings.Contains(out, antigravityCodexHint) {
+ t.Fatalf("Codex, as written: %d %s", code, out)
+ }
+}
+
+// Only an Antigravity account's system instruction is broken up: Gemini
+// CLI's own sign-in, on the same Code Assist envelope, and every other
+// provider are sent the prompt as the agent wrote it.
+func TestOnlyAntigravityIsSentThePromptBrokenUp(t *testing.T) {
+ r := &Request{System: hermesOldSystem + "\n" + codexGPT5System, Messages: []Message{{Role: "user", Parts: []Part{{Kind: Text, Text: "hi"}}}}}
+ gemini := provider.Provider{ID: "gemini-cli", Account: &provider.Account{Agent: "gemini"}}
+ if b := string(codeAssistBody(gemini, r, "gemini-3-flash", nil)); !strings.Contains(b, "You are Hermes Agent, an intelligent") || strings.Contains(b, `​`) || strings.Contains(b, zeroWidth) {
+ t.Fatalf("Gemini CLI's account was sent %s", b)
+ }
+ ag := provider.Provider{ID: "antigravity", Account: &provider.Account{Agent: "antigravity"}}
+ if b := string(codeAssistBody(ag, r, "gemini-3-flash", nil)); strings.Contains(b, "You are Hermes Agent, an intelligent") {
+ t.Fatalf("Antigravity's account was sent %s", b)
+ }
+ if r.System != hermesOldSystem+"\n"+codexGPT5System {
+ t.Fatalf("the caller's request was changed: %q", r.System)
+ }
+ gem, err := buildGemini(r, "m")
+ if err != nil {
+ t.Fatal(err)
+ }
+ for name, b := range map[string][]byte{
+ "chat": buildChat(r, "m", "", false),
+ "anthropic": buildAnthropic(r, "m"),
+ "responses": buildResponses(r, "m", "", false),
+ "gemini": gem,
+ } {
+ if !strings.Contains(string(b), "You are Hermes Agent, an intelligent") || strings.Contains(string(b), zeroWidth) || strings.Contains(string(b), `\u200b`) {
+ t.Errorf("%s was sent the prompt broken up: %s", name, b)
+ }
+ }
+}
diff --git a/internal/gateway/antigravity_codex_test.go b/internal/gateway/antigravity_codex_test.go
index d3c051af3..4b06d647e 100644
--- a/internal/gateway/antigravity_codex_test.go
+++ b/internal/gateway/antigravity_codex_test.go
@@ -152,4 +152,7 @@ func TestAntigravityCodexHintIsTheRoutingPages(t *testing.T) {
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")
}
+ if !strings.Contains(string(b), quote(antigravityHermesHint)) {
+ t.Fatal("plugins/routing/client.js doesn't know the note the gateway adds to Antigravity's refusal of Hermes' old persona")
+ }
}
diff --git a/internal/gateway/codeassist.go b/internal/gateway/codeassist.go
index ef4318fb8..228c19521 100644
--- a/internal/gateway/codeassist.go
+++ b/internal/gateway/codeassist.go
@@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"regexp"
+ "slices"
"strconv"
"strings"
"time"
@@ -46,47 +47,127 @@ func accountAgent(p provider.Provider) string {
}
// 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). 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.
+// "Resource has been exhausted (e.g. check quota)" whatever the quota left:
+// one that carries a line of agTurnedAway anywhere in the system
+// instruction, in any case, is turned away on every model, while the same
+// words in a message go through (#666). magpie breaks those lines up before
+// they go (antigravityCloak); this still tells the refusal for what it is
+// when the user has the prompt sent as written, or Google turns away one
+// that was broken up, 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") ||
- antigravityTurnsCodexAway(system)
+ low := strings.ToLower(system)
+ for _, line := range agTurnedAway {
+ if strings.Contains(low, line) {
+ return true
+ }
+ }
+ return false
}
-// 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{
+// agTurnedAway are the lines, lower-cased, that Antigravity turns a system
+// instruction away for, each tried on a real account:
+// - Claude Code's billing line and the Claude Agent SDK's identity line
+// (Claude Desktop's chats) (#666);
+// - 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…"). 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). 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;
+// - Hermes Agent's earlier default persona (its SOUL.md until Hermes
+// replaced it: "You are Hermes Agent, an intelligent AI assistant
+// created by Nous Research. …"), which a SOUL.md the user edited keeps
+// (zgoodz on X, 10-27). The line without "Research", "AI" or "Hermes"
+// goes through, and so does today's "You are Hermes Agent, built by
+// Nous Research."
+//
+// Each is broken up before it goes by a zero-width space after its first
+// letter (antigravityCloak), which Google lets through: each line so
+// broken ("Y", U+200B, "ou are Codex, an agent based on GPT-5"; "b",
+// U+200B, "uilt on Anthropic's Claude Agent SDK"; and so on) was answered
+// on a real account where the line as written was turned away. A mention
+// of the Claude Agent SDK elsewhere ("running within the Claude Agent
+// SDK") goes through as written, and is sent so.
+var agTurnedAway = []string{
+ "x-anthropic-billing-header:",
+ "built on anthropic's 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",
}
// 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 strings.Contains(low, "you are codex, an agent based on gpt-5") ||
+ strings.Contains(low, "you are codex, a coding agent based on gpt-5")
+}
+
+// antigravityTurnsHermesAway says whether system carries Hermes Agent's
+// earlier default persona that Antigravity turns away.
+func antigravityTurnsHermesAway(system string) bool {
+ return strings.Contains(strings.ToLower(system), "hermes agent, an intelligent ai assistant created by nous research")
+}
+
+// zeroWidth is what antigravityCloak puts inside a line Antigravity turns
+// away: U+200B, which the model reads past and Google's check doesn't.
+const zeroWidth = "\u200b"
+
+// antigravityCloak is system with each line of agTurnedAway in it broken up
+// by a zero-width space after its first letter, wherever and in whatever
+// case it is, and every other word as the agent wrote it: what an
+// Antigravity account's system instruction is sent as, unless the user has
+// it sent as written (Provider.PromptAsWritten). A line already broken up
+// (the antigravity-cloak plugin's) isn't one any more and is left alone.
+func antigravityCloak(system string) string {
+ if !antigravityTurnsAway(system) {
+ return system
+ }
+ // lower-casing keeps every byte offset here: each line is ASCII, and
+ // a match is found in low at the offset it has in system only while
+ // the two are the same length, which ToLower can change outside ASCII
+ low := strings.ToLower(system)
+ if len(low) != len(system) {
+ low = asciiLower(system)
+ }
+ var at []int
+ for _, line := range agTurnedAway {
+ for i := 0; ; {
+ j := strings.Index(low[i:], line)
+ if j < 0 {
+ break
+ }
+ at = append(at, i+j+1)
+ i += j + len(line)
}
}
- return false
+ slices.Sort(at)
+ at = slices.Compact(at)
+ var b strings.Builder
+ b.Grow(len(system) + len(at)*len(zeroWidth))
+ prev := 0
+ for _, i := range at {
+ b.WriteString(system[prev:i])
+ b.WriteString(zeroWidth)
+ prev = i
+ }
+ b.WriteString(system[prev:])
+ return b.String()
+}
+
+// asciiLower lower-cases only ASCII letters, keeping every byte where it is.
+func asciiLower(s string) string {
+ b := []byte(s)
+ for i, c := range b {
+ if 'A' <= c && c <= 'Z' {
+ b[i] = c + 'a' - 'A'
+ }
+ }
+ return string(b)
}
// antigravityRefuses is what Antigravity says when it turns such a request
@@ -145,12 +226,19 @@ const antigravityTurnedAwayHint = "Antigravity answers this 429 to the system pr
// 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"
+// antigravityHermesHint is the hint for Hermes Agent's earlier default
+// persona (routing/client.js AG_HERMES).
+const antigravityHermesHint = "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"
+
// 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
}
+ if antigravityTurnsHermesAway(system) {
+ return antigravityHermesHint
+ }
return antigravityTurnedAwayHint
}
@@ -194,6 +282,16 @@ func codeAssistID(model, effort, agent string) string {
// asking twice reads the vendor's catalogue twice over for one answer.
func codeAssistBody(p provider.Provider, r *Request, model string, wires map[string]string) []byte {
sent := codeAssistID(model, r.Effort, p.Account.Agent)
+ if p.Account.Agent == "antigravity" && !p.PromptAsWritten {
+ // the lines Google turns away, broken up; the request the
+ // caller holds keeps the system prompt as written, which the
+ // refusal is told against (antigravityTurnedAway)
+ if cloaked := antigravityCloak(r.System); cloaked != r.System {
+ rc := *r
+ rc.System = cloaked
+ r = &rc
+ }
+ }
body := buildCodeAssistSent(r, sent, p.Account.Agent)
if wire := provider.UpstreamNameAsIn(wires, p.ID, model, sent); wire != sent {
body = rewriteModel(body, wire)
diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js
index 7904d0185..daed4393f 100644
--- a/internal/gui/assets/i18n.js
+++ b/internal/gui/assets/i18n.js
@@ -3286,6 +3286,7 @@ const I18N = {
"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 对话切换模型或分叉后仍带着这段提示词,请在这个模型上新开一个对话",
+ "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 对 Hermes Agent 旧版默认人设(SOUL.md)都会回这个 429,与剩余额度无关,所以这不是额度用尽,等待也不会好;Hermes 当前的默认人设可以通过,请把它写进 SOUL.md,或为这些对话换用其他提供商",
"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": "限流",
@@ -7255,6 +7256,7 @@ const I18N = {
"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 對話切換模型或分叉後仍帶著這段提示詞,請在這個模型上新開一個對話",
+ "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 對 Hermes Agent 舊版預設人設(SOUL.md)都會回這個 429,與剩餘額度無關,所以這不是額度用盡,等待也不會好;Hermes 目前的預設人設可以通過,請把它寫進 SOUL.md,或為這些對話改用其他供應商",
"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": "限流",
@@ -11240,6 +11242,7 @@ const I18N = {
"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 のチャットは、モデルを切り替えたりフォークしたりしてもそのプロンプトを持ち続けるので、このモデルで新しいチャットを始めてください",
+ "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 は Hermes Agent の以前のデフォルトのペルソナ(SOUL.md)に対し、残りクォータに関係なくこの 429 を返します。クォータ切れではなく、待っても解決しません。Hermes の現在のデフォルトのペルソナは通るので、それを SOUL.md に書くか、これらのチャットには別のプロバイダーを使ってください",
"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": "レート制限",
@@ -15234,6 +15237,7 @@ const I18N = {
"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",
+ "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 beantwortet die frühere Standard-Persona von Hermes Agent (seine SOUL.md) mit diesem 429, egal wie viel Kontingent übrig ist – das Kontingent ist also nicht aufgebraucht, und Warten hilft nicht; die aktuelle Standard-Persona von Hermes geht durch, also tragen Sie diese in SOUL.md ein, oder nutzen Sie für diese Chats einen anderen Anbieter",
"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 195813858..a456ecac7 100644
--- a/internal/gui/assets/plugins/routing/client.js
+++ b/internal/gui/assets/plugins/routing/client.js
@@ -1161,10 +1161,13 @@ function routingPage(part) {
// 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 the same 429 for Hermes Agent's earlier default persona
+ // (antigravityHermesHint)
+ const AG_HERMES = "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";
// 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, AG_CODEX, WB_RESTRICTED];
+ const HINTS = [WB_REFUSED, BLOCKED, ZCODE_BLOCKED, AG_TURNED_AWAY, AG_CODEX, AG_HERMES, WB_RESTRICTED];
function trySaid(r, i) {
const tr = r.tries[i], w = tried(r, tr), agent = agentName(r.agent);
diff --git a/internal/gui/providers.go b/internal/gui/providers.go
index 0ebc85c60..8915c4cad 100644
--- a/internal/gui/providers.go
+++ b/internal/gui/providers.go
@@ -1562,6 +1562,11 @@ func providerRoutes(mux *http.ServeMux, w Windows) {
if !in.CodexAsSent && old != nil {
in.CodexAsSent = old.CodexAsSent
}
+ // and Antigravity's prompt as written, set with `magpie
+ // provider set antigravity prompt=as-written`
+ if !in.PromptAsWritten && old != nil {
+ in.PromptAsWritten = old.PromptAsWritten
+ }
// and additional_tools taken, set with `magpie provider
// set <id> additional-tools=on` (#2660)
if !in.AdditionalTools && old != nil {
diff --git a/internal/provider/provider.go b/internal/provider/provider.go
index f345dbc20..105264605 100644
--- a/internal/provider/provider.go
+++ b/internal/provider/provider.go
@@ -241,6 +241,17 @@ type Provider struct {
// fitting, which a backend that isn't OpenAI's needs (#350).
CodexAsSent bool `json:"codexAsSent,omitempty"`
+ // PromptAsWritten, on Antigravity's subscription, has the system prompt
+ // go to Google exactly as the agent wrote it. By default the few lines
+ // Google answers with a 429 "Resource has been exhausted" whatever
+ // quota is left (Claude Code's billing line, the Claude Agent SDK's
+ // identity line, Codex's GPT-5 identity lines, Hermes Agent's earlier
+ // default persona) go with a zero-width space inside them, which Google
+ // lets through and the model reads the same (gateway's
+ // antigravityCloak). Set with `magpie provider set antigravity
+ // prompt=as-written`; prompt=default turns it back.
+ PromptAsWritten bool `json:"promptAsWritten,omitempty"`
+
// AdditionalTools says the provider's Responses API takes an
// additional_tools input item, as OpenAI's does: a deferred tool an
// Anthropic client's tool search loaded goes to it in such an item
@@ -720,6 +731,7 @@ func withPicks(a, pk Provider) Provider {
a.SwitchOnly = pk.SwitchOnly
a.Sink, a.NoModels = pk.Sink, pk.NoModels
a.NativeCompaction = pk.NativeCompaction
+ a.PromptAsWritten = pk.PromptAsWritten
a.Proxy, a.AccountProxies, a.AccountModels = pk.Proxy, pk.AccountProxies, pk.AccountModels
a.AccountCaps, a.AccountWindowCaps = pk.AccountCaps, pk.AccountWindowCaps
a.AccountNames = pk.AccountNames
@@ -856,7 +868,7 @@ func Save(p Provider) error {
if p.ID == "kiro" {
key = p.Key
}
- p = Provider{ID: p.ID, Key: key, Models: p.Models, NoModels: p.NoModels, PickedFrom: p.PickedFrom, Delisted: p.Delisted, Unlisted: p.Unlisted, Off: p.Off, Fallback: p.Fallback, Routing: p.Routing, Sink: p.Sink, Affinity: p.Affinity, KeepLogin: p.KeepLogin, KeepLoginAs: p.KeepLoginAs, SwitchOnly: p.SwitchOnly, Contexts: p.Contexts, Family: p.Family, Proxy: p.Proxy, AccountProxies: p.AccountProxies, AccountModels: p.AccountModels, AccountCaps: p.AccountCaps, AccountWindowCaps: p.AccountWindowCaps, AccountNames: p.AccountNames, MaxConcurrency: p.MaxConcurrency, AccountConcurrency: p.AccountConcurrency, QueueLimit: p.QueueLimit, QueueWait: p.QueueWait, MaxRPM: p.MaxRPM, QuotaRest: p.QuotaRest, QuotaResetAt: p.QuotaResetAt, RestCap: p.RestCap, PinUpstream: p.PinUpstream, NativeCompaction: p.NativeCompaction, Hidden: hiddenAccount(p.ID), Quiet: quietAccount(p.ID), Tucked: tuckedAccount(p.ID)}
+ p = Provider{ID: p.ID, Key: key, Models: p.Models, NoModels: p.NoModels, PickedFrom: p.PickedFrom, Delisted: p.Delisted, Unlisted: p.Unlisted, Off: p.Off, Fallback: p.Fallback, Routing: p.Routing, Sink: p.Sink, Affinity: p.Affinity, KeepLogin: p.KeepLogin, KeepLoginAs: p.KeepLoginAs, SwitchOnly: p.SwitchOnly, Contexts: p.Contexts, Family: p.Family, Proxy: p.Proxy, AccountProxies: p.AccountProxies, AccountModels: p.AccountModels, AccountCaps: p.AccountCaps, AccountWindowCaps: p.AccountWindowCaps, AccountNames: p.AccountNames, MaxConcurrency: p.MaxConcurrency, AccountConcurrency: p.AccountConcurrency, QueueLimit: p.QueueLimit, QueueWait: p.QueueWait, MaxRPM: p.MaxRPM, QuotaRest: p.QuotaRest, QuotaResetAt: p.QuotaResetAt, RestCap: p.RestCap, PinUpstream: p.PinUpstream, NativeCompaction: p.NativeCompaction, PromptAsWritten: p.PromptAsWritten, Hidden: hiddenAccount(p.ID), Quiet: quietAccount(p.ID), Tucked: tuckedAccount(p.ID)}
} else {
p.AccountProxies = keyProxies(p) // a provider of keys proxies each key apart
if subscriptionID(p.ID) && !stored(p.ID) {