Each of the dozen decodes, topMember reads and validity checks a request
body goes through summed all its bytes with maphash to find what
validMemo knew of it: about 5% of the gateway's CPU on long Codex
requests (#4371). A body being served (holdBody) is not written while
held, so longBody and jsonValid now know it by its address and length,
check and split it once, and keep that in heldBodies.long until it is
released, as factsOf keeps its facts. Any other long body is summed as
before.
Run on mote at this tree:
- gofmt, go vet (darwin, GOOS=windows, GOOS=linux): ok
- TestHeldBodyIsNotSummed, TestHeldBodyNotJSON, TestDecodeJSON*,
TestRequestBodyRawValuesShareIt, TestTopMember*, TestWithoutTopMember*:
ok 3 of 3 alone, ok under -race
- go test -timeout 45m ./internal/gateway: ok (609s)
- Broken by hand: held lookup skipped -> "a held 84077-byte body was
summed 18 times"; release left the finds kept -> "a released body's
finds were kept".
- BenchmarkHeldBodyDecodes (1.8MB Responses body held, 12 decodes plus 12
topMember reads an op): 3.31ms/op before, 7.9us/op after, allocations
the same (24/op).
Real use: sandbox HOME copied from the owner's, real DeepSeek account,
deepseek-flash, four turns of a 115-123KB history through
/v1/chat/completions with masking on: every reply HTTP 200 (three "ok",
one empty at finish_reason length, the model's reasoning using
max_tokens, as on the old binary).
Not run: the full ./... suite; a real Codex account; Windows and Linux
runs of the tests.
Picked onto 9162277b9 (3 commits, none in internal/gateway/fastjson.go); not run again there.
dzxx0496 on Discord: with free accounts one after another, the first used
up, requests went to the second; when the first renewed they went back to
it ("如果第一个恢复了,它又优先用第一个了"). No routing did what they asked:
In order and Smart both put the first back first.
A new routing, Until used up (drain, 用完再换): requests stay on one seat
until its quota is used up, then go on to the next in the list and stay
there. A seat counts as used up when its known allowance is at 100% or
it was refused for quota or credit (failQuota / failCredit, routes.Drained
called where the rest is recorded, so a failover inside one request moves
the pool too). A rate limit or other failure only passes it over while
it rests, as In order does. Each pool (a provider, a group/<id>) keeps its
own place; routes.Forget clears it.
Offered wherever a routing is picked: the provider editor, a group's row
menu and editor (app menu, no native select), the TUI, `magpie group set
<id> routing=drain` and a provider's routing=drain. Nothing defaults to
it, so no saved setting changes. SpentShareOf is 100 for it, as for In
order. Words in en, zh, zh-TW, ja and de (i18n.js and the routing
plugin's own), docs/subsystems and the site's start page (en, zh, ja).
Tests:
- internal/routes/drain_test.go: stays on the next when the first renews,
through a rate limit, all used up, a seat gone, per pool, Forget,
Drained after a renewal.
- internal/gateway/drain_test.go: a real request path with a fake upstream;
k1 refused for quota, k2 takes over, k1 renews: drain stays on k2,
In order goes back to k1. Red without the Drained hook (request 3 went
to k1). A rate limit comes back to k1; drain is saved on a provider and
a group.
- routing-drain.test.cjs: the Routing page's why and mode line in 5
languages, 1100px and 420px, Chromium and WebKit; red on the old assets
(20 of 20).
- routing-group-strategy, routing-save, builtins: the menu has 11 routings.
Run on mote (macOS) at origin/main 699ddf152 with this commit and its
two neighbours (nb5p chip, dzxx0496 renewal, dzxx0496 Until used up).
Pushed on b2145eac1, whose five commits since change app.css and app.js
only for a key row's chips; at the pushed tree gofmt, the gui, routes
and gateway vets (Linux nogui, Windows), TestCoreScriptBudget (core
1,532,891), the Drain Go tests and 11 GUI files (gateway-model-chip-
height, routing-drain, routing-renews-stay, routing-behind-why,
routing-group-strategy, routing-save, builtins, i18n-keys, gui-de,
gui-zh-tw, key-row-chips-fit) were run again: 190 of 190 ok.
- gofmt -l clean; GOOS=linux go vet -tags nogui ./..., GOOS=windows go
vet ./... and go vet ok.
- go test internal/routes, internal/gateway, internal/provider,
internal/cli, internal/tui, plugins/rotation: ok; internal/gui's
TestCoreScriptBudget ok (core 1,532,816 of 1,533,105).
- GUI: routing-*, builtins, gateway-model*, model-chip*, i18n-keys,
gui-* and codex-credits-last in both engines: 2211 tests, 68 red,
none new: model-chip-steady 20 (#4388), gui-ja's {agent} string
(#4580), and 11 routing-* files under load (#4585, #3789, #3799).
The same 11 files run alone at cdfdb62c6 were 32 of 116 red, and 26
with the stack, the same tests but rule-remove, whose red languages
vary run to run (9 cases, then 5). model-chip-steady was 20 of 20 red
at cdfdb62c6 alone.
Earlier, at f811bf291 with the stack: go test -timeout 45m ./... had 82
packages ok, internal/gui red only on
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners/macOS_26_SDK (#3949). The whole GUI suite had 301
of 16930 red in 52 files. Those 52 files rerun had 272 red with the
stack and 276 at f811bf291 alone, the same tests.
dzxx0496 on Discord asked for the reset time to stay on ("额度恢复时间能不能
常驻"). On the Routing page's stage a known allowance's row said when it
renews only while idle; answering, answered, kept for last or passed
over, the row's status took its place and the time was gone. It now
follows every such status ("· renews in 5 h 5 min"), once. A resting
row still says when it is back instead, a free model has nothing to
renew, and a status that already says it is not told twice.
routing-renews-stay.test.cjs: a request in flight over three known
accounts, one answering, two passed over; each row says its own renewal
once, in en, zh, zh-TW, ja and de, at 1100px and 420px, in Chromium and
WebKit, with no overflow. routing-behind-why.test.cjs's expectations
now carry the renewal on its answered and kept rows.
routing-renews-stay.test.cjs is 2 of 2 red on the old assets. Its
first row and routing-behind-why's answered row renew in 12 h 5 min:
under 10 h the time shows minutes, and a slow run turned 9 h into
8 h 59 min. With the fixtures' clock held back 2 minutes the old
values were 40 of 64 red, these 64 of 64 green.
Run on mote (macOS) at origin/main 699ddf152 with this commit and its
two neighbours (nb5p chip, dzxx0496 renewal, dzxx0496 Until used up).
Pushed on b2145eac1, whose five commits since change app.css and app.js
only for a key row's chips; at the pushed tree gofmt, the gui, routes
and gateway vets (Linux nogui, Windows), TestCoreScriptBudget (core
1,532,891), the Drain Go tests and 11 GUI files (gateway-model-chip-
height, routing-drain, routing-renews-stay, routing-behind-why,
routing-group-strategy, routing-save, builtins, i18n-keys, gui-de,
gui-zh-tw, key-row-chips-fit) were run again: 190 of 190 ok.
- gofmt -l clean; GOOS=linux go vet -tags nogui ./..., GOOS=windows go
vet ./... and go vet ok.
- go test internal/routes, internal/gateway, internal/provider,
internal/cli, internal/tui, plugins/rotation: ok; internal/gui's
TestCoreScriptBudget ok (core 1,532,816 of 1,533,105).
- GUI: routing-*, builtins, gateway-model*, model-chip*, i18n-keys,
gui-* and codex-credits-last in both engines: 2211 tests, 68 red,
none new: model-chip-steady 20 (#4388), gui-ja's {agent} string
(#4580), and 11 routing-* files under load (#4585, #3789, #3799).
The same 11 files run alone at cdfdb62c6 were 32 of 116 red, and 26
with the stack, the same tests but rule-remove, whose red languages
vary run to run (9 cases, then 5). model-chip-steady was 20 of 20 red
at cdfdb62c6 alone.
Earlier, at f811bf291 with the stack: go test -timeout 45m ./... had 82
packages ok, internal/gui red only on
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners/macOS_26_SDK (#3949). The whole GUI suite had 301
of 16930 red in 52 files. Those 52 files rerun had 272 red with the
stack and 276 at f811bf291 alone, the same tests.
nb5p on Discord: on the Gateway page's model list the image chip at a
row's end stood shorter than the reasoning chip ("低–ultra") and the
context chip ("272K"). The text chips are inline-flex with a 16px line;
the image chip holds only the 11px glyph (display:block), so it was 11px
tall. It now takes the text chips' 16px as its height.
modelInfo() is the one renderer of these chips. Its two callers, the
Gateway's model list and the routing group editor's member rows, share
the selector the fix is on. The provider editor shows images as a
checkbox and the Agents page and pickers show no such chip.
gateway-model-chip-height.test.cjs measures every chip of every row in
en and zh, light and dark, at 900px and 420px, in Chromium and WebKit:
same height, same centre line.
gateway-model-chip-height.test.cjs is red on the old CSS (the image
chip 11px against 16px) and green with it.
Run on mote (macOS) at origin/main 699ddf152 with this commit and its
two neighbours (nb5p chip, dzxx0496 renewal, dzxx0496 Until used up).
Pushed on b2145eac1, whose five commits since change app.css and app.js
only for a key row's chips; at the pushed tree gofmt, the gui, routes
and gateway vets (Linux nogui, Windows), TestCoreScriptBudget (core
1,532,891), the Drain Go tests and 11 GUI files (gateway-model-chip-
height, routing-drain, routing-renews-stay, routing-behind-why,
routing-group-strategy, routing-save, builtins, i18n-keys, gui-de,
gui-zh-tw, key-row-chips-fit) were run again: 190 of 190 ok.
- gofmt -l clean; GOOS=linux go vet -tags nogui ./..., GOOS=windows go
vet ./... and go vet ok.
- go test internal/routes, internal/gateway, internal/provider,
internal/cli, internal/tui, plugins/rotation: ok; internal/gui's
TestCoreScriptBudget ok (core 1,532,816 of 1,533,105).
- GUI: routing-*, builtins, gateway-model*, model-chip*, i18n-keys,
gui-* and codex-credits-last in both engines: 2211 tests, 68 red,
none new: model-chip-steady 20 (#4388), gui-ja's {agent} string
(#4580), and 11 routing-* files under load (#4585, #3789, #3799).
The same 11 files run alone at cdfdb62c6 were 32 of 116 red, and 26
with the stack, the same tests but rule-remove, whose red languages
vary run to run (9 cases, then 5). model-chip-steady was 20 of 20 red
at cdfdb62c6 alone.
Earlier, at f811bf291 with the stack: go test -timeout 45m ./... had 82
packages ok, internal/gui red only on
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners/macOS_26_SDK (#3949). The whole GUI suite had 301
of 16930 red in 52 files. Those 52 files rerun had 272 red with the
stack and 276 at f811bf291 alone, the same tests.
An agent sends its whole history on every turn, so with masking on every
turn ran each rule's regexp over every message before it again; on a long
session most of magpie's CPU went there (#4353). ruleSpans now keeps what
the rules found in a text of 256 bytes or more, keyed by a SHA-256 of the
text, the day (a date over a year old can be a birthday), Secrets,
Personal, the kinds turned on and off and the user's own rules. Only the
hash and the places found are kept, no value. Two generations of 65,536
entries, as sentMemo keeps.
Run on mote at this tree:
- gofmt, go vet (darwin, GOOS=windows, GOOS=linux): ok
- TestRulesRunOnceAText and TestRuleMemoKeysWhatTheRulesRead: ok 3 of 3
alone; -race with TestMask*: ok
- go test ./internal/redact: ok; go test -timeout 45m ./internal/gateway:
ok (662s; run before the counter moved into ruleSpans' find, which no
gateway code reads)
- Broken by hand: memo bypassed -> "the rules ran over 41 texts for one
new turn"; day left out of the key -> line 74 red; kinds left out ->
line 69 red.
- BenchmarkMaskNextTurn (Codex history of 80 turns, then 81):
99.6ms/op before, 6.6ms/op after.
Real use: sandbox HOME copied from the owner's, masking on, real DeepSeek
account, deepseek-flash, four turns of a 115-123KB history with mails and
phone numbers. Masking took 22-24ms a turn before; after, 24ms for the
first turn and 1.7-2.1ms for each next one. Every reply HTTP 200 "ok"
(one empty reply at finish_reason length on each binary, the model's
reasoning using max_tokens).
Not run: the full ./... suite; Windows and Linux runs of the tests.
Picked onto 54087aa43 (3 files changed, 199 insertions(+), 34 deletions(-), none in internal/redact); not run again there.
young02036 (Discord #feedback, zh, Windows) had a Remote magpie key row whose
models chip「全部模型」was squeezed to「全」. The row also showed the protocol
pick and the actions (停用 移除 设为首选). Now only the name and the masked key
shrink. Every chip and button keeps its whole text. Switch off/on, Remove and
First/Make first are held together in one .key-acts group at the row's right.
When they don't fit, the group goes onto its own line, still at the right.
A press there now keeps its row open (`held`) through the redraw the press
brings, until the pointer moves off the row. Without that, a wrapped row
drawn again after a click goes back to one line, slips out from under the
pointer, and hides the button that was pressed. key-switch.test caught this
at en/ja/de 900px. WebKit gets plain `:hover`/`.held` selectors, not
`:is()`/`:not()` lists.
Trade-off: in a narrow card, a hovered key row grows by one line.
Not changed: account rows, which use the .acc-line/⋯ layout, and the
gateway's caller-key rows, which ellipsize on purpose.
New test: tests/key-row-chips-fit.test.cjs, 60 cases (2 engines x zh, en,
ja, de, zh-TW x 6 widths down to 390px). It checks that no chip or button
of a key row is cut, and that the actions stay on one line at the right.
Run:
- key-row-chips-fit + key-switch, Chromium and WebKit on Linux (WSL
magpie-desktop): 40/40 each. key-row-chips-fit on mote: 60/60; on
Windows (xiaomi-gpu): 30/30.
- Whole GUI suite, WebKit, on mote at this commit (another session's suite
ran there too, load 55 to 160): 8663 tests, 8489 pass, 174 fail, in 50
files. Each red file was then run alone at origin/main 20482d71f and at
this commit, back to back, one at a time: base 570/419 pass/151 fail,
head 570/414/156. 41 files are red on both sides, and 2 more
(menu-input-scroll, routing-upstream) only at head. The 4 files whose
tests differed (context-map, menu-input-scroll, routing-rule-remove,
routing-upstream) were run twice more on each side: base 15/15 fail,
head 13/15 fail. None of the reds is in a key row.
- Whole GUI suite, Chromium, on mote at this commit: 5092 top-level
results before mote went down mid-run (load ~200, "Connection to mote
closed by remote host"; from sessions-convert on, every test read
"browser has been closed"). After mote came back, the 30 files red
before the drop, plus every file from sessions-* on (273 files), were
run again: 2320 tests, 2194 pass, 126 fail, in 30 files. Those 30 were
run alone at 20482d71f and at this commit: base 251/123/128, head
251/126/125, the same files with the same counts, give or take one
flake. The one red only at head, searcher-pick, went red 2 of 3 times
alone at base and 0 of 3 at head (#4274).
- Rebased on origin/main fa4704f06 (126 commits later). At this commit:
TestCoreScriptBudget ok, under 1,539,856 (two comments in
renderKeyAccounts trimmed, no budget raised). key-row-chips-fit,
key-switch, key-weight-fit and i18n-keys: 52/52 in Chromium and 52/52
in WebKit.
Reds at both base and head (WebKit, Chromium), with their issues:
model-chip-steady #4388,
agent-panel-name-width #4203, usage-agents-hide #3414, segs-press-redraw
#4566, provider-fetch-again #3292, routing-rule-remove/rules-line/
story-shrinks/steps-cap/steady/row-swap/order-unknown/upstream #4585#3954#4628#3412#3799#4627, page-width-steady #4541, rest-try-now #4127,
recovered-file #4320, mobile-web #3952, key-replace #4126, models-works-only
#4391, warm-now #4322, usage-ledger #1948, remote-magpie #4398, omarchy
#4624, tencent-cloud #1579, s3-sync #3413, provider-typed #4461,
provider-picks-stay #4397, provider-models-rest #4396, plugin-move-unserved
#4392, plugin-card-update #3079, phone-connect-menu #3524, models-fold #4071,
model-copy-id #4621, context-map #3488, provider-levels-scroll #4395,
nav-timeout #4622, header-centre #3479, gui-ja #4580, gateway-key-models
#4616, gateway-caller-keys #3797, i18n-keys #4524 (green at fa4704f06),
menu-input-scroll #3402, models-select-all-api #4389, routing-rule-drag
#3789, routing-many-keys #4082, searcher-pick #4274, account-weight #4644
(filed with this change). The whole-suite umbrellas are #4471 (WSL)
and #4431 (WebKit on Windows).
Broken by hand:
- With the old app.css/app.js, key-row-chips-fit is 50/60 red: "amodels
「全部模型」is cut (14 of 58px)". The 10 passes are the 420px phone
tab cases, where the old row already wrapped.
- With `if (keyHeld === k.id) row.classList.add("held"), ` replaced by
`if (0) `, key-switch en/ja/de 900px go red ("Switch off" hidden).
Not tried: the real Windows app with a real Remote magpie, Linux WebKitGTK
in the real app, and the account and gateway-key sibling rows, which are
not changed.
Under -race sync.Pool lets a quarter of what is put in it go, so json's
encoders and regexp's matchers are made again: four gui tests bounding
what a path allocates went red under -race at fd70def82, and at the
base before it. TestProviderInfoReadsTheListOnce measured a row at 88
MB against 13 MB without -race, all in catalog.FamilyOf's regexps.
raceOn (as internal/gateway has it) now skips the bound in
TestStateWriteGrowsNoBufferItsSize, TestProvidersWriteGrowsNoBufferItsSize,
TestJSONRowsNotHeldWhole and TestProviderInfoReadsTheListOnce (after its
row checks). Without -race they run as before.
Run on mote at this tree:
- gofmt, go vet ./internal/gui, GOOS=windows and GOOS=linux go vet
-tags nogui: ok.
- The four tests without -race: PASS.
- go test -race ./internal/gui: only TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949) red, which are red without
-race too.
Picked onto 7da5b34aa (sessions, gateway); not run again there.
TestUpdateInATerminalRestartsTheAppWithoutCuttingIt set `child` in the
startBeside fake, which the restart runs on a goroutine of its own
(restartBeside), while the test read it in eventually2 and its cleanup.
Under -race it reported a DATA RACE on every run. The child is now an
atomic.Pointer stored after Start, so a reader never sees it half set.
TestRestartHandsTheGatewayOver's fake runs on the test's goroutine and
has no race.
Run on mote at this tree:
- gofmt, go vet ./internal/gui, GOOS=linux go vet -tags nogui: ok.
- -race -run the test, 3 times: ok, no race. At the base (fd70def82)
the same run reports 3 DATA RACEs each time, 3 of 3.
- The test and TestRestartHandsTheGatewayOver without -race: ok.
- go test -race ./internal/gui with the next commit: only
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners (#3949) red.
Picked onto 7da5b34aa (sessions, gateway); not run again there.
Cindy starts Pi with --session-dir <userData>/pi-agent-home/sessions
(resolvePiAgentHome in Cindy's app.asar), so its Pi sessions never
reached ~/.pi/agent and magpie showed none of them. They are read now from
the Cindy and CindyGlobal builds' folders and listed as Cindy's: list,
transcript, calls on Usage, Dirs, delete, and the gateway's own record of
a Cindy session merged with the file's.
Run (mote): go test ./internal/sessions ./internal/agent ./internal/usage
ok. go test ./internal/gui: two reds, both the same on origin/main
699ddf152: TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners (#3949). Linux (wsl-run): go test -run
'Cindy|Raft|TestPi' ./internal/sessions ok. gofmt clean.
Broken by hand: without cindyFiles() in the sessions list both Cindy tests
fail (0 Cindy sessions, want 4).
Not tried: a real Pi session run in Cindy (none on this Mac; the fixtures
are Pi 1.1.0's own files put where Cindy's Pi writes them), Windows, the
full suite. Cindy's Codex in <userData>/codex-home is not read yet: #4651.
gokoshiki wants a Codex subscription first, then an OpenAI API key, then
the subscription's credits. Until now an account at 100% that holds
credits either kept its place and spent them there (on) or was held
(off). This adds a third way per account, "last":
- settings: CodexCreditsLast []string, empty by default, so a setting
saved before it keeps its order. provider.CodexCreditsLast,
CodexCreditsMode and SetCodexCreditsMode(user, on|last|off);
SetCodexCredits(on) still means "in its place" and clears last.
- gateway: candidate.creditsLast is true for such an account once a
window for the model is used up and it is going on its credits (a
call ChatGPT counts in no window stays in its place). restLast orders
ready, then resting, then those, and marks Weighed.CreditsLast.
restLast runs over the asides too, so such an account goes behind a
provider's reserves (Accounts at once, 2c6b7c063) as well.
lastBehind keeps In turn's next turn (after), a new conversation's
spread (leastHeld) and a subagent's lead (readyForNew) from bringing
it forward, and a kept conversation moves off it to one not on its
credits (Affinity.Why "credits").
- CLI: magpie quota credits <account> [on|last|off]; alone it lists
accounts set off and last.
- API: POST /api/settings/codex-credits takes {user, on, last?}.
- GUI: under a Codex account's Use credits, while on, a second switch
"Only after every other account, key and fallback", in the Usage
page's card and the tray panel's (both wrap it to its own line at 360
to 900px), and the panel's folded brief says "On, after everything
else". The Routing page's trace says why such an account is behind
(aside, the kept conversation's why, the row tag). zh, zh-TW, ja, de.
creditsButton and the new switch share creditsSwitch, and the Codex
options' comments in app.js were cut, so the core budget holds with
no raise (1,532,664 of 1,533,105).
- docs: reference.md (quota credits) and gateway-routing.md.
Tests:
- gateway: TestCodexCreditsLastAfterTheOthers (two accounts, In order:
the one at 100% on its credits goes behind, the trace says so, and
back in place when turned on), TestCodexCreditsLastAfterTheFallback
(both accounts at 100% and set last: the API key the provider falls
back to answers before either one's credits; with the credits in
their place an account answers on them, as before),
TestCodexCreditsLastNotKept (a kept conversation moves off it).
All three red with creditsLast and lastBehind forced false.
- provider: TestCodexCreditsLastMode.
- gui: settings_keep_test carries CodexCreditsLast;
tests/codex-credits-last.test.cjs (Chromium and WebKit, en zh zh-TW
ja de; Usage at 900 and 440, the panel at 440 and 360, the folded
brief, the Routing page's aside and why, every key in I18N). Red on
the old assets (no .ar-credits-last).
Run at this change on origin/main c76bcaea7, on mote (pushed on fd70def82, whose
one commit since, fd70def82, changes only the Providers poll's Go
files in internal/gui):
gofmt clean; go vet of gateway, provider, gui, cli and settings ok;
their tests ok but internal/gui's #4514 and #3949, both on main. The
8 commits between d6aa9cdf6 and c76bcaea7 touch none of this
change's files.
Run at this change on origin/main d6aa9cdf6, Go 1.26.8:
- mote: gofmt -l clean; go vet ./..., and GOOS=linux and GOOS=windows
go vet -tags nogui ./...: ok. go test -count=1 -timeout 45m ./...:
85 packages ok; internal/gui red only on TestSettingsSaveKeepsWhatIt
DoesNotSend's SearchAll (#4514), TestMainWindowCorners (#3949) and
TestColdTurnsTaken (#4510), all three on main. TestCoreScriptBudget
passes.
- WSL magpie-desktop, Playwright 1.62.0, both engines: codex-credits*,
i18n-keys, gui-ja, gui-zh-tw, panel-options-fold, provider-at-once and
every routing-* file: 2127 tests, 2064 pass. Every codex-credits and
codex-credits-last test passed (26). The red files (gui-ja, 19 routing
files) run again at this tree and at d6aa9cdf6, alike: 200 tests, 61
and 57 red. gui-ja is #4580; the routing reds are timeouts and
waits, on both. The one file red at this tree only,
routing-request-model (WebKit 420px "the model is cut"), is 5 of 5
green alone at both, and with six copies at once red at both (29 and
27 of 30 here, 28 and 27 of 30 at d6aa9cdf6): a fixed 150ms wait
after a resize, filed as #4650. Nothing this change adds to Routing
draws unless an account is set last (fixtures don't).
- Earlier, at 3564eb04b (this change on 7428f3229), WSL: the whole GUI
suite beside two other sessions' suites, 16944 tests, 16496 pass;
its 102 red files again at that head and at 7428f3229, 444 and 425
red. The files red at the head only, run alone: view-open-wheel,
usage-accounts, add-button, usage-ledger-open-settled 0 red;
view-wheel-after-click, view-wheel-unheard and context-map (#3488)
red alone at 7428f3229 too. mote, the credits and i18n files: 172 of
174, the two #4580 and a click timeout in quota-curve at load 148
(alone 30 of 30).
Not tried: a real ChatGPT account at 100% with credits beside a real
OpenAI key; the order is shown with the gateway's fake Codex backend.
Each poll of /api/providers encoded the answer for the page and then
encoded the kept last-known list again only to sum it (keepProviders,
encodedSum): 32-34 MB of what forty polls allocated with real accounts.
writeProvidersJSON now returns the encodedSum of keptProviders(s), taken
from the same encoding, as writeStateJSON does for /api/state. A row
kept as it is (no headers, proxy, extra body or account proxies) is
encoded once into the answer and the sum; only a row with those is
encoded again without them. The head and tail of the kept file come
from marshaling it with no rows. A nil row list, or a head that doesn't
match, falls back to the old writeJSON and encodedSum. The other
keepProviders callers (after a save) are unchanged.
Run on mote at this tree:
- gofmt, go vet ./internal/gui, GOOS=windows go vet -tags nogui: ok.
- go test -run 'Providers|Kept' ./internal/gui 3 times alone: ok.
- New TestProvidersWriteSumsWhatIsKept: the sum equals
encodedSum(keptProviders(s)) for bigProviders, rows with each secret
field, gateway calls, moved models, and empty and nil lists. Broken
by hand twice: keepsAllOf always true (secrets summed) and the kept
tail left out of the sum. Red both times.
- go test ./internal/gui: only the known reds,
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners (#3949).
- -race -run 'Providers|Kept': TestProvidersWriteGrowsNoBufferItsSize
red, and red the same way at the base (c76bcaea7, twice): an
allocation count under -race, where sync.Pool drops items. Fixed in
its own commit next.
Real accounts, sandbox HOME, 40 polls of state, providers and drift,
v0.1.2509 (msteady) vs this (mpsum), two rounds each:
- alloc_space shown: 365.6/364.3 MB -> 341.5/329.8 MB; keepProviders
32.9/32.1 MB -> gone; writeProvidersJSON 15.3/13.6 -> 9.9/14.9 MB.
- poll CPU 4.21/4.27 s -> 4.18/4.10 s; footprint peak 111/116 ->
112/108 MB.
- /api/state and drift answers byte-identical; /api/providers differs
only in the providers' "fetched" time.
Not run: the Linux and Windows apps; a save's keepProviders path is
unchanged and was not exercised.
The window and the app's page, resting on ~60 MB live, poll /api/state,
/api/drift and /api/providers and throw ~10 MB away a round. At Go's
default GOGC of 100 the heap grew to twice what it kept before each
collection, so the footprint stood at 121-135 MB and peaked at 136-138
MB for a ~60 MB heap.
steadyGCStart, run once with the warm-up, sets GOGC to half, or to what
lets the heap grow by 32 MB when that is more (never above 100), and
sets it again for the live heap after each collection, through the
retightenGC hook the tight reads already use. The usage and sessions
reads under a tight GC still set their tenth while they run, and the
steady value comes back after them. A GOGC the user set in the
environment is kept, and nothing is retuned. No memory limit (#2278).
Run (mote, at this tree):
- go test -count=1 ./internal/gui: ok except TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949), the known reds.
- -run 'GC|Steady|Tight' 3 times and once under -race: ok.
- Broken by hand: ignoring GOGC in the environment, TestSteadyGCKeepsTheUsersGOGC
is red ("GOGC=200 set by the user, magpie runs under 50"); with no
retune after a collection, TestSteadyGCRetunesAfterACollection is red
("GOGC after collections = 50, want 100").
- gofmt -l, go vet, GOOS=windows go vet -tags nogui ./internal/gui: clean.
- Real accounts, magpie web in a sandbox HOME, 40 rounds of the three
polls, twice each, alternating, v0.1.2507 against this change:
phys_footprint_peak 136 / 137 MB -> 115 / 116 MB
phys_footprint end 135 / 121 MB -> 96 / 94 MB
CPU of the polls 3.84 / 3.98s -> 4.05 / 4.24s
/api/state and /api/drift byte-identical.
GOGC=50 in the environment gave 107-108 MB at +9% CPU; the 32 MB room
keeps a small heap from collecting that often.
Not run: the desktop window (Wails) and Windows/Linux machines; the
tray app takes the same Handler path. A large usage history between
reads (~280 MB live) now grows by ~140 MB, not ~280, before a
collection; not measured here.
Picked onto 4179cf2d8 (pii: pf-serve-base for CPUs without AVX2; no file in common); not run again there.
echo_yip on X: Settings → Privacy's model never started, "pf-serve
(Metal): signal: illegal instruction" and the same on the CPU. x86's
pf-serve needs AVX2, FMA, F16C and BMI2, which a Celeron, a Pentium or
a Mac before Haswell lacks, and so does Rosetta before macOS 15, where
the Intel DMG on Apple silicon ran the Intel pf-serve.
- arch.go: target() is darwin-arm64 for magpie's Intel build under
Rosetta (sysctl.proc_translated, rosetta_darwin.go), so Apple
silicon's pf-serve, with Metal, is fetched and run. The Intel one
already on disk is kept until the arm64 one is (tagDirs; start
fetches it first, for at most 5 minutes, and falls back), then
removed with the old tags.
- fullX86 asks golang.org/x/sys/cpu for AVX, AVX2, FMA and BMI2. Where
one is missing, candidates() runs only pf-serve-base, the SSE4.2
build the previous commit adds, when it is on disk.
- pf-v3 (privacy-filter run 41256502056 at 697335d8e) is pinned;
pf-v2 and pf-v1 are old tags, so pf-v2 runs until pf-v3 is
downloaded. On a CPU without AVX2 that first start still fails, and
the retry after the download runs pf-serve-base.
Run at this commit: go test ./internal/pii/... on mote, ok; go build
./... ok; go vet ./internal/pii/... for linux, windows and darwin/amd64
ok; gofmt -l clean. Broken by hand: with candidates()'s fullX86 branch
and start()'s fetch turned off, TestBaseWhereTheCPULacksAVX2 ("starts =
[start pf-serve-vulkan MTL0]") and TestRosettaRunsAppleSiliconsServe
("started from [path pf-v9-darwin-amd64]") go red.
pf-v3's five zips, downloaded from the release and hashed here, match
its SHA256SUMS and the pins. A throwaway probe (not committed) set a
temp dir as pii's folder with the pinned model, fetched pf-v3 through
ensureServe from GitHub and masked an English and a Chinese text:
Linux (magpie-desktop), x86 with AVX2: pf-v3-linux-amd64, Vulkan
first, name/email/phone found
mote, Apple M5 Pro: pf-v3-darwin-arm64, Metal, the same spans
this Mac under Rosetta (arch -x86_64, the darwin/amd64 test binary,
sysctl.proc_translated 1): target darwin-arm64, fetched
pf-v3-darwin-arm64 and masked with Metal, the same scores as mote
Windows (xiaomi-gpu): pf-v3-windows-amd64, Vulkan, name/email/phone
found
The previous commit's qemu -cpu Nehalem run is where pf-serve-base
starts and pf-serve dies with SIGILL.
Not tried: the full go test ./... (only internal/pii changed); a real
CPU without AVX2; a Mac before macOS 15, where Rosetta has no AVX;
the GUI's Settings → Privacy page on a pf-v2 to pf-v3 upgrade.
Claude Code's model field appended its own models to the list it keeps
of magpie's (claudeViaShared), a copy of the whole catalog on every
call, as withVia did for the other agents until cdfdb62c6. With real
accounts, 40 window polls spent 9 MB flat in that append.
withVia's cache is now joinedVia, keyed by the caller, and the field
reads through it, here and in a distro asleep (wsl.go). withVia still
gives the shared list itself when there are no own models; joinedVia
always gives a list apart from via, so a write to the model field's
options never reaches the list kept (TestClaudeViaMagpieKept).
Run on mote (macOS), at this tree:
- gofmt clean; go vet ./internal/agent for darwin, windows and linux.
- TestClaudeModelFieldKeepsTheJoinedList, TestWithVia*, TestClaudeVia*
and TestSameOption* alone 3/3 ok.
- Broken by hand: the plain append back -> "Claude Code's own models
joined its list from magpie again"; joinedVia handing out via with no
own models -> TestClaudeViaMagpieKept "a write to the model field's
options reached the options kept (folded true)".
- go test ./internal/agent ./internal/tui ./internal/cli: ok.
- go test ./internal/gui: red only on #4514 and #3949, as before.
- Real-account sandbox, 40 window polls against the GroupFinder tree:
Agent.Picks 56.4 -> 42.6 MB, gui.state 138.0 -> 130.0 MB; /api/state
and drift output byte-identical; phys_footprint_peak 139 MB.
Not run: the whole ./... suite; a real WSL distro.
GroupFinder reads every provider's models once for many lookups, but
each lookup's membersIn built entriesBy, a map over the whole list,
again. The Providers page looks up every group of every agent on each
poll: with real accounts, 40 polls spent 23.2 MB in GroupFinder, 13.6
MB of it in that index.
The finder makes the index with the list, and membersFound takes it;
membersOff, for one lookup, still makes its own. Members are unchanged.
Run on mote (macOS), at this tree:
- gofmt clean; go vet ./internal/provider for darwin, windows and linux.
- TestGroupFinderIndexesTheListOnce alone 3/3 ok (1744 bytes a lookup,
2000 models).
- Broken by hand (index made per lookup again): "a group looked up
again cost 198576 bytes: the list of 2000 models was indexed again".
- go test ./internal/provider ./internal/agent ./internal/gateway: ok.
- go test ./internal/gui: red only on TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949), as before.
- Real-account sandbox, 40 window polls against v0.1.2505's tree:
GroupFinder 23.2 -> 12.6 MB; /api/state and drift output
byte-identical; phys_footprint_peak 135 MB.
Not run: the whole ./... suite.
Picked onto 697335d8e (native: pf-serve-base for x86); not run again there.
providerInfoWith built p.ID+"/"+m.ID three times per model (same-as,
desktop and price lookups) and again for every agent with a hidden
list, per model. Now named makes it once and keeps it beside
out.Models for the agents' loop. What the row says is unchanged.
Run on mote (macOS), at this tree (with the previous commit):
- gofmt clean; go vet ./internal/gui for darwin and windows ok. Linux
vet of internal/gui needs cgo for Wails and wasn't run.
- go test ./internal/gui: red only on #4514 and #3949, as before.
- Real-account sandbox, 40 window polls: providerInfoWith 112.0 ->
104.1 MB; /api/state and drift output byte-identical.
Not run: the whole ./... suite.
The Agents page asks every desktop app whether it is installed, and its
version, on each poll. Each ask listed /Applications and ~/Applications
whole (os.ReadDir, for the one-level-down folders of #2325) and read
every candidate bundle's Info.plist. With real accounts, 40 window polls
spent 38.6 MB of allocations in Agent.Detected, 14.5 MB of it ReadDir.
folderSubs keeps a folder's non-bundle subfolders while its
modification time stays (adding, removing or renaming an entry changes
it), and bundleInfo keeps what an Info.plist said while its size and
modification time stay. A time under 2s old is never trusted, as git
treats a racily clean index. macBundle and desktopApp.version read
through bundleInfo; what each reports is unchanged.
Run on mote (macOS), at this tree:
- gofmt clean; go vet ./internal/agent for darwin, windows and linux ok.
- TestAppFoldersReadAgainOnlyWhenChanged alone 3/3 ok.
- Broken by hand: never trusting the kept list and plist -> "an
unchanged app folder and Info.plist cost 1268 allocations a look";
trusting them whatever changed -> "Moved.app in a folder added since
isn't found" and "Kept.app's Info.plist says another id now".
- go test ./internal/agent ./internal/tui ./internal/cli: ok.
- go test ./internal/gui (with the next commit's providers.go too): red
only on TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners (#3949), as before.
- Real-account sandbox, 40 window polls against v0.1.2504's tree:
total allocations 509.9 -> 427.6 MB, Agent.Detected 38.6 -> 21.5 MB,
os.ReadDir 14.5 -> 4.0 MB; /api/state and drift output byte-identical.
phys_footprint_peak 139 MB (136 before; within run noise).
Not run: the whole ./... suite; the Linux and Windows app paths (they
don't reach these readers).
Each agent's model field returned append(its own models,
viaMagpieShared(...)...), a copy of the whole catalog's options for
each field of each agent on every poll: Picks was 94.7 MB of 496 MB
over forty polls of the Agents page with real accounts. withVia keeps
the joined list per agent and prefix while the own models read the same
(sameOption, field by field) and the catalog's list is the very one
kept (same array), and joins it again when either changed. The list is
read only and clipped, as viaMagpieShared's is; every caller of a
field's Options reads it, Picks clones it before it drops anything.
The 52 `return append(own, viaMagpieShared(...)...)` sites call it.
omp's and Reasonix's planner edit the joined list after the append, and
Grok's writes Same into its copy, so they keep their own copies.
TestWithViaKeepsTheJoinedList: the same own models give the same array,
own models changed in a value or only an icon are joined anew, a
provider saved since is listed, and nothing joined is the catalog's own
list. TestSameOptionReadsEveryField sets each field of Option alone and
fails when sameOption doesn't see it. Broken by hand: never answering
from the kept list ("the same own models joined the catalog again"),
and FastFor left out of sameOption ("sameOption doesn't read
Option.FastFor").
Run on mote: both tests alone 3 of 3; internal/agent, internal/tui and
internal/cli ok; internal/gui red only on TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949); gofmt, vet and GOOS=windows
and linux vet clean. Real accounts in a sandbox HOME, forty polls:
Picks 94.7 MB -> 51.2 MB, state 190.8 MB -> 154.0 MB, state and drift
replies byte for byte the same as before. Footprint peak 136 MB.
PeakOf built a slice of the provider's URLs (and their hosts) for every
bill and every model, before asking whether the bill named the model.
The Providers poll asks it for each model of each provider, 8 MB of
540 MB over forty polls with real accounts. The model is checked first
now, the URLs are listed once, when a bill needs them, into an array on
the stack.
TestPeakOfPlainModelsAllocateNothing: PeakOf of a model on an OpenCode
Go provider allocates nothing, glm-5.1 there has no peak,
deepseek-v4-pro there has one and so does DeepSeek's own provider.
Broken by hand (the URL list made on the heap again) it goes red,
"allocated 1 times".
Run on mote: the test alone 3 of 3, internal/provider ok,
internal/catalog ok, gofmt, vet and GOOS=windows vet clean. Real
accounts in a sandbox HOME, forty Providers polls: PeakOf gone from the
profile, providerInfoWith 137.7 MB -> 108.4 MB with the SameModel
change before it, state and drift replies byte for byte the same.
Footprint peak 138 MB. Not run: the GUI suite (no GUI file changed).
Picked onto 27a0cbd17 (origin/main moved, nothing in internal/catalog or peak.go); not run again there.
SameModel ran modelGaps' ReplaceAllString and built a byte copy for every
id it was asked about, even one with nothing to change. The Providers
poll asks it for each provider's models, 21.5 MB of 540 MB over forty
polls with real accounts. An id with no underscore, whitespace or double
dash now skips the regexp, and one with no version dot to rewrite is
not copied.
TestSameModelPlainIDsAllocateNothing compares SameModel with the old
code over about 30 ids (underscores, tabs, no-break spaces, "--",
dotted versions, leading and trailing dashes) and checks a plain id
allocates nothing. Broken by hand both ways it goes red: allocations
back (4 to 5), and wrong answers with the plain-id check inverted.
Run on mote: the test alone 3 of 3, internal/catalog ok,
internal/provider ok, gofmt and vet clean. Real accounts in a sandbox
HOME, forty Providers polls: SameModel 21.5 MB -> 2.5 MB, state and
drift replies byte for byte the same as before. Not run: the GUI suite
(no GUI file changed).
Picked onto 27a0cbd17 (origin/main moved, nothing in internal/catalog or peak.go); not run again there.
01huadalang on Discord (#feedback): three ZCode accounts used at once
from one address had the address refused with a 405. zcode 0.1.40
(magpie-community/plugins 26864ec) declares maxAccounts 2, which the
previous commit's Accounts at once reads; keepMovedCurrent now updates
every moved user's plugin to it.
npm view @magpie-community/opencode-zcode-auth --prefer-online: version
0.1.40, magpie { maxAccounts: 2, maxConcurrency: 3 }, checked when this
landed. Run: internal/provider at this head with the commit before
(see its body). Not tried: a real ZCode account's move (none used, per
the task).
Red in a whole GUI suite run on Linux and alone on mote, about 1 run in
8 at the accounts-at-once head (4 of 33), 0 of 31 at main 41b5c0f19:
"ja 1000: Advanced starts at 292, its fields at 364", "zh web 390:
Advanced starts at 106, its fields at 20". Each miss is the 86px
fallback of --ed-at: the editor was drawn again between two frames,
and the test measured the new details before edAlign's ResizeObserver
had run for it. The user never sees that state, since the observer runs
before the frame is painted. The test now waits until the current
details has --ed-at, then two frames, then measures.
Run on mote: head with this change, 20 runs alone, 0 red. Broken by
hand (--ed-at 30px too far): red in both engines at en 1000.
Not tried: why the accounts-at-once change makes the redraw land
between frames more often; the extra field is inside the folded
Advanced.
01huadalang on Discord (#feedback 1566170404542742740): three ZCode
accounts used at once from one address got the address refused with a
405; two were served. They asked for one account to be used until it
runs out, then the next. Even under "In order", ZCode's maxConcurrency 3
spilled a full lane onto the next account (laneMate) and rests spread
the load, so every account was in use at once.
A provider's MaxAccounts (the editor's Advanced → "Accounts at once",
beside Concurrency; `magpie provider at-once <id> [n|off|default]`) is
how many of its accounts or keys take requests at the same time.
provider.AtOnce() is the user's own value, else what its plugin
declares (maxAccounts on the auth hook or package.json magpie, read by
host.js atOnceOf), else no limit; the user's 0 is no limit over the
plugin's. perKeyBarred keeps the first N in the user's own order
(rank), preferring ones not resting, and keepAtOnce puts the rest after
everything as asides with candidate.reserve (Weighed.Reserve). So in any
routing mode a reserve is asked only once the kept ones failed or rest,
and a kept one that rests gives its seat to the first reserve next time.
Guards: laneMate never spills onto a reserve; a full queue (laneErr)
drops the provider's reserves (dropReserves) and turns the request away
with the 429; session affinity moves a conversation off a reserve once
the kept ones can take it (affine "reserve"; Strict still holds).
Routing says "in reserve · {n} at once" on the row and why in the
request's story. zcode 0.1.40 (plugins 26864ec, on npm) declares 2, and
its mover min is raised to 0.1.40 two commits on.
Known leak, in docs/subsystems/gateway-routing.md: a failure that rests
nobody (a 5xx on one try) still passes that one request to the reserve,
as it does to any next candidate.
Tests: TestAtOnceKeepsFirstInUserOrder (every routing mode, a dragged
order, a resting key handing over its seat), TestAtOnceFullLaneWaitsForTheKept,
TestAtOnceReserveTakesOverAndGivesBack, provider TestAtOnce, plugin
host maxAccounts (hook and package.json), gui TestAtOnceSave, cli
TestAtOnceCmd, provider-at-once.test.cjs (both engines, five languages,
900 and 360px).
Broken by hand, each red then restored: laneMate's reserve guard
removed (FullLane times out); affine's reserve case removed
(ReserveTakesOver answers on k3); keepAtOnce disabled (all three red);
dropReserves disabled (FullLane gets no reply); the Routing row's
reserve branch removed (provider-at-once's Routing test red in all 10
engine/language runs).
Core budget: the field adds ~530 bytes to app.js; the neighbouring
editor comments are cut to fit, so TestCoreScriptBudget passes with no
raise.
Run on mote, Go 1.26.8:
- full suite, -timeout 45m, at a7d4c662d (on origin/main e4384fc3c):
gofmt and vet clean; every package ok but internal/gui, whose reds are
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510), each red on that main too, and
TestCoreScriptBudget, fixed by the comment cut above.
- at this tree on bbdd9eb55 (the pushed head less 51f2f22ce and
73b957069, gateway and provider): gofmt, go vet (darwin, and
linux and windows with -tags nogui), and internal/gateway, provider,
gui, cli, plugin and settings: all ok but internal/gui's
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestMainWindowCorners
(#3949), both red on main; TestCoreScriptBudget passes
- at the pushed head (on 51f2f22ce): go vet of gateway and provider,
and -run AtOnce|Nameless|ModelAPI|Reserve|FullLane over gateway,
provider, gui and cli: ok
GUI, Playwright 1.62.0, both engines:
- the whole suite on Linux (WSL) at an earlier head; every red file run
again at head and at main on mote, the same reds on both (filed:
#4641 is new, the rest open already, e.g. #4600, #4461, #4082, #4210).
- at a7d4c662d on WSL: every editor-*, provider-* file, i18n-keys,
gui-ja and seven routing files, 1185 pass, 34 red; all but four red
on main e4384fc3c too (#4580, #3292, #4394 to #4397, #4600). The four:
routing-many-keys (#4082) is red on main in two of three reruns as
well; provider-gemini webkit ja's thumb (#4210) was red in 2 of 3 runs at head beside
other files (318px off), 0 of 3 at main; alone, 4 of 4 green at both.
The test reads the thumb 350ms after a click, a fixed wait (#4210,
numbers added there).
- provider-at-once.test.cjs: green in both engines, five languages, at
900 and 360px; editor-advanced-align 20 of 20 alone with the next
commit.
Not tried: real ZCode accounts (none used, per the task) and a real 405,
so whether two at once always stays under ZCode's limit is the
reporter's finding; the user can set 1.
Qoder plugin 0.2.51 answers 502 "the model's native tool call has no
name; it is not sent on as a tool" when qfmodel twice began a native
tool call without a name before anything of the reply was sent. That is
the model's glitch, not the account's, but failure() read it as
failOther and restAfterMarked rested the account for fallbackCooldown
(a minute), so the user's next turn skipped it.
cutWords now also matches that sentence, so the 502 takes the failCut
lane the plugins' cut-short error already has (#2873): asked again once
where it stood (cutReasks), then the next account or group member, with
no rest and no failure counted. The match is the plugin's whole clause,
not "has no name", so other bodies keep their lanes.
Siblings: failCut is decided in failure() alone, and read by
restAfterMarked (no rest) and the serve loop's retry (gateway.go); both
take the new words through it. No other plugin in magpie-community/
plugins says these words (grep of packages/*.mjs at 5403c21).
Run (on mote, at bbdd9eb55 + this change; rebased onto 2640ac0f0,
which touches internal/provider/migrate_qoder.go only):
- go test -count=1 -timeout 45m ./internal/gateway: ok (764s)
- gofmt -l internal/gateway: clean
- go vet ./internal/gateway for darwin, GOOS=linux, GOOS=windows: ok
Broken by hand: with routing.go from origin/main,
TestPluginNamelessCallFailsOverNotRested fails (try 0 Fail "other" with
a Rest set) and TestPluginNamelessWords fails for the 502 body and the
stream error event; TestPluginOrdinary502StillRests passes on both.
Not tried: a real qoder-cn account that hits the glitch; the tests use a
scripted upstream with the plugin's errorResponse bytes, not the plugin
host.
The Providers page asks ModelAPI of each model of every provider's list,
and it listed the protocols the provider speaks (Speaks, a new slice)
each time, though it needs only whether there are two, and most models
have no API set at all. With real accounts that was 12 MB of what forty
polls allocated. ModelAPI now looks up the API set for the model first
(apiSet) and, only with one set, counts the protocols up to two;
apisAmong passes the count of the list it already has. The answer is
the same.
Run on mote at this tree (on 7087d92a0, the previous commit before it
was picked): gofmt, go vet (darwin, windows, linux) of internal/provider
and gui ok; TestModelAPIListsNoProtocols, TestNoAPIFindsTheProvidersAPIsOnce
and TestClaudeSignedOutKeepsWhatItParsed alone 3/3 ok; broken by hand
(Speaks listed again in ModelAPI) it fails "ModelAPI allocated 112
bytes, listing the protocols 112"; go test ./internal/provider ok
(130.3s); go test ./internal/gui fails only TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949), as on the run before this
change.
Real accounts, sandbox HOME, 40 polls (abr.sh), against the v0.1.2496
build: Provider.ModelAPI and Speaks gone from the profile (12 MB
before); /api/state and the drift reply byte-identical. Footprint peak
136 MB (was 134-141).
claudeSignedOut and claudeLoginVersion run for every saved Claude account
on each Providers poll (Logins, claudeStandIn), and each parsed the
sign-in whole through parseClaudeCredentials: a map[string]any, then a
Marshal and Unmarshal of claudeAiOauth. With real accounts that was
15.5 MB of what forty polls allocated. What they read of it, whether it
parses as a sign-in and its version, is now kept by the sign-in's bytes
(claudeAuthOf), at most 64; the bytes change only when the account is
signed in or refreshed, and a changed sign-in is read anew.
Run on mote at this tree: gofmt, go vet (darwin, windows, linux) of
internal/provider ok; TestClaudeSignedOutKeepsWhatItParsed alone 3/3 ok;
broken by hand (the kept read skipped) it fails "claudeSignedOut
allocated 8023 bytes, parsing the sign-in 7127"; go test ./internal/provider
ok (117.4s).
Real accounts, sandbox HOME, 40 Providers/Agents polls (abr.sh), against
the v0.1.2496 build: parseClaudeCredentials and claudeSignedOut gone from
the profile (15.5 MB before), provider.Logins 22.0 MB -> 11.0 MB, total
517 MB -> 504 MB; /api/state and the drift reply byte-identical.
Footprint peak 139 MB (was 134-141): this change doesn't move the peak.
Not run: the gui suite (no gui file changed).
Picked onto 2640ac0f0 (internal/provider changed there in allowance_renewed, key_allowance, plugins and routing, none of the files changed here); not run again there.
qoder-cn/qfmodel now and then begins a native tool call and never names
it. Up to 0.2.50 the plugin ended the stream with "the model's native
tool call has no name", an error frame ZCode doesn't retry, and the whole
turn died with what had already streamed. 0.2.51 asks once more when
nothing was said before it (then a 502 before any byte, which the gateway
retries or fails over), and otherwise drops the call and ends tool_calls
or stop. keepMovedCurrent brings every moved user up to it.
npm: `npm view @magpie-community/opencode-qoder-auth version
--prefer-online` = 0.2.51 at this commit.
Run at this tree (be689b883 + this change), on mote:
`go test -count=1 -timeout 45m ./internal/provider`: ok (117s).
`gofmt -l internal/provider`: nothing.
magpie's gateway is unchanged: chatTidy already drops a call whose first
fragment has no name and ends stop (#1475).
magpieMadeReasoning joined an item's summaries and its reasoning_text
into the made summary. #2855's later rollout (lyufeng000, 10-31) has
DeepSeek items whose content repeats their summary, so the made item
would carry the words twice, and DeepSeek be handed them back twice
(withReasoningText reads the summary). It now takes the text, else the
summaries. It also ranged over item["summary"].([]any), a single-value
assertion that panics on an item with no summary key; both reads now
use the checked form. TestMadeReasoningSaysItsTextOnce.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
reasoningTidy sat between crArgs and ints in the stream loop only. The
held bytes drained at the end skipped it: sign (tidy, whole, search,
spaces) went crArgs then ints, and crArgs's own drain went to ints. A
glm-5.3-flash replica's whole reply, which crArgs holds to its end
(#4256), reached the client with the foreign reasoning item as it came,
and the tidy's own drain went back through crArgs after crArgs was
drained. Now sign and crArgs's drain go through the tidy, and the
tidy's drain goes on through ints and sigs only.
TestForeignSealedReasoningWholeReplyCarriesNoContent (deepseek-flash
and glm-5.3-flash, stream false).
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
ggbdpq's change keeps the later of two rests. That also kept a quota
rest magpie only guessed (a refusal naming no time: quotaRest's 15
minutes, asked again a minute on, askAt set) when the same refusal
came back naming its time, 2 minutes say: the account sat out the
guess. A guessed rest now gives way to the same kind's vendor-named
time ("resets" or "retry-after"); another kind's shorter rest (#3289's
429 minute beside a 402) still doesn't shorten it.
TestNamedQuotaTimeReplacesAGuess.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
TestReadingKeepsARefusalsRest and TestAutoVisionKeepsOffARefusedAccount
slept 100ms "for the renewal to land" after the 80% reading, then
watched the rest for 2s. They now arm a hook (provider.OnRenewed) that
signals when the reading's renewal for codex's me@example.com is told,
wait for that, and check once: the gateway's own hook is registered
first (init) and hooks are told in turn, so by then the gateway's
lifting has run, on a loaded machine too.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
readKeyAllowance sets e.at to now before it calls keep, and keep took
e.at as the time the old allowance was read. So on the key path every
"started again" check compared against now, and a reset that passed
between two readings was never told: the rest a vendor timed stayed
until it ran out, which is the half of #2718 the account path already
fixed. keep now measures from aAt, the time the kept allowance was
read, which only a successful reading moves; a failed read in between
leaves it alone. noteKeyAllowance (the card's reading) sets e.at after
keep for the same reason.
Edward4226's fix (codex/issue-2718-elapsed-reset, d132dacb4 with
f302d9312's deterministic test), which ggbdpq's comment on #2718
asked to carry with the rest-paths change. Their EVIDENCE.md is left
out.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
What changed
A Responses reasoning item that carries the model's reasoning as content
parts (reasoning_text) — another vendor's shape; OpenAI's own items carry
summaries — no longer reaches a client of magpie's as the upstream wrote
it. It is made over into the item magpie makes of any other upstream's
reasoning: its text (and its summaries) as one summary, an rs_ id, no
content and no seal — in a reply translated for the client
(magpieMadeReasoningRaw at the encoder's sealed item and the whole reply's
renderer) and in one relayed as it came (reasoningTidy, a passthrough
filter on Responses streams and whole replies, the item in
output_item.added/done and in response.completed's output). The
subsystems doc's rule is amended to say so.
Why
A Codex conversation that used OpenAI, went through magpie to DeepSeek,
then had magpie disconnected again, was stuck: every later turn, the
remote compact too, answered 400 "Invalid 'input[43].content': array too
long. Expected an array with maximum length 0, but got an array with
length 1 instead." The reporter's rollout forensics narrow it: the
DeepSeek phase had left 25 reasoning items, each with its text in content
parts and a 38-character encrypted_content of the vendor's own (not the
gAAAA the thread's own GPT-phase items carry, which have no content),
which Codex stores and replays to OpenAI. OpenAI takes a reasoning item
sent back only with its content empty (#1411) and cannot open another
vendor's seal, so such an item poisons the thread for OpenAI wherever it
was planted — and once Codex holds it, no retry of magpie's can strip it:
client keeps, and #2855 came with magpie out of the path entirely. A
Chat-API upstream's turn has always translated to an item of magpie's own
(an rs_ id and a summary, TestTranslatedChatReasoningCarriesNoContent
pins it); the items the reporter held are a Responses wire's own, which
both the translated and the relayed reply handed over as they came. What
magpie hands a client must be re-sendable to a strict Responses upstream:
the text is kept in the summary, so an upstream that wants its reasoning
back still gets it (withReasoningText), and magpie's own OpenAI
destinations keep the item out as they did (#1008, #1044, #1411).
Run
- TestForeignSealedReasoningGivenCodexCarriesNoContent (translated) and
TestForeignSealedReasoningRelayedCarriesNoContent (relayed) fail on
upstream/main with the issue's item handed over whole — content, empty
summary and the vendor's seal in both output_item.done and
response.completed — and pass with the change;
TestTranslatedChatReasoningCarriesNoContent (a Chat upstream's
reasoning, translated) is green without and with the change.
- Restoring the three product files alone to upstream/main (tests kept)
fails the two again; restoring them back passes.
- Attaching content to the made item fails both again ("carries its
text"), and dropping the made summary fails both ("carries no
summary").
- go test -tags nogui -count=1 ./internal/gateway: ok 312.4s;
-run 'TestTranslated|TestReasoning|TestSealed': ok 7.9s;
go test -race -tags nogui -count=1 -run 'TestTranslated|TestReasoning':
ok 9.4s. gofmt -l internal/gateway empty. go vet -tags nogui and
go build -tags nogui -o /dev/null . on darwin, GOOS=linux and
GOOS=windows: pass (a pre-existing cgo -Wenum-conversion warning in
internal/gui/trayimage_darwin.go on darwin, untouched).
Not tried against real OpenAI or DeepSeek accounts; the reporter's
rollout reading is taken from the issue, not re-derived from a live
thread.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Generated-by: GLM-5.3-Flash (ZCode)
What changed:
A refusal that says when its quota comes back (ChatGPT's resets_at, or
a Retry-After: restAfterMarked keeps it by "resets" or "retry-after")
rested the account till then, but the rest did not keep. Every failure
asks the usage read again (staleAllowance), and when the reading came
back finding the window less than full — which the vendor's own usage
endpoint can say while its refusal stands — renewedFrom read it as full
till sooner, and renewed lifted the rest. The account went first in its
group and was refused again, every few minutes, all saying the same
reset: parkavenue9639 counted 11 such tries in 92 minutes, and 21 more
from magpie's own image descriptions, without one gaining anything.
What a reading may lift is now told from what only a window truly
starting again may. Allowances still tells renewed by renewedFrom, and
renewed lifts by it what no vendor gave the time of (by "quota",
"window"): unchanged. A new startedAgain says whether a window full at
the last reading — a pool of some models as much as the whole account's
— has its reset gone by, or stands a new, later cycle: the two ways a
window really restarted. Allowances tells that to a second hook
(OnStarted), which alone lifts what the vendor itself timed ("resets",
"retry-after"). A reset spent tells both hooks (renewedNow), and lifts
at once, as before. A Claude account whose /usage finds its five hours
started again before Claude Code's word said is told by the new read's
reset standing a new cycle, and its rest is lifted as it was. A key's
own readings tell the two the same way (keyAllowance's keep returns
both).
AutoVision needed nothing of its own: it has kept off a resting
describer since #1801 (spentModel counts a quota rest as spent, and
autoSpent asks none "until one is back"). Its 21 refusals in the report
were this lifting: the rest gone, the pick went back to the refused
account, and the next image asked it again. The test drives both: with
the rest standing, a reading that finds the window at 80% with the same
reset lifts nothing, and AutoVision keeps the other describer.
Run: TestReadingKeepsARefusalsRest,
TestAutoVisionKeepsOffARefusedAccount red on f5b01574 (a reading that
found the window less than full lifted the refusal's rest; AutoVision =
"codex/gpt-6.1-sol", back on the refused account), green with the
change, red again with the lift gated off. TestStartedAgain added by
TestRenewedFrom's table. TestClaudeAccountBackOnceItsWindowRenews now
reads the restart as a new cycle, as a fresh /usage says it;
TestQuotaRestsUntilItsReset and TestFactoryStandardOutLeavesCore tell
the reset-spent and pool-renewed word through both hooks, as
renewedNow does. go test ./internal/gateway/ ./internal/provider/
-p 1 -timeout 30m ok (gateway 328s, provider 74s); go test -race of
the Renewed, Rest, AutoVision, SpentModel, Allowance, QuotaRests,
FactoryStandard, ClaudeAccountBack families ok; go vet of both
packages clean; gofmt clean; go build ./... ok.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Co-authored-by: parkavenue9639 <92194680+parkavenue9639@users.noreply.github.com>
Generated-by: GLM-5.3-Flash (ZCode)
Concurrent requests on one provider can fail differently: a 402 out of
credit rests the account for half an hour, and a 429 answering at the
same moment — the first request still holding the vendor's only slot —
rests it for the minute a rate limit starts at. Whichever was written
last won, so the 429's minute replaced the 402's half-hour, and the
account was asked again as soon as it ended, refused, and rested again,
round after round: sub2tok's account answered some 3,400 refusals in six
hours, in bursts of two or three requests every few seconds.
restAfterMarked now writes its rest only when nothing is resting there
yet, or when the rest it took ends later than the one in place — the
rule a rest narrowed to a model already keeps (narrowWhenRead), and the
one a slow start's rest keeps since 398803e3. A longer rest still
replaces a shorter one, and a failure whose rest would end later is
written as before.
Tests: TestShorterRestDoesNotReplaceLongerOne (a 402's credit rest
stands when a 429 answering a moment later rests for its minute; an 8-day
quota refusal after it still takes). Broken by hand: the guard dropped,
the test red at "the rate rest replaced the credit rest"; restored, green.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Generated-by: GLM-5.3-Flash (ZCode)
A routing group's first member answering ModelScope's 400 "Model id :
deepseek-ai/DeepSeek-V4.1-Flash , has no provider supported" ended the
group request: the words matched none of the refusal classes that make
a 400 retryable, so the client got the 400 and its own retries landed
on the same dead seat — the reporter watched 28 in a row, the later
members never asked.
What changed: unservedWords takes the vendor wordings that say the
model is served nowhere on this member — ModelScope's "has no provider
supported" (the report's usage.jsonl), and Azure OpenAI's for a
deployment its resource has none of, code DeploymentNotFound ("The API
deployment for this resource does not exist"; Microsoft Q&A, Stack
Overflow — its 404 fails over by status already, the wording covers the
400s a relay passes on). An unserved refusal keeps the poison pill's
line: a plain bad request ("Invalid parameter", "field required")
still ends the route, as it would fail on every member, and
shapeRefused still excludes these words — the seat rests on its
model's own key (restAfterMarked's unserved branch, the #1235
mechanism), so the key's other models stay live and the group's next
request passes the dead seat.
Run: go test ./internal/gateway/ (TestGroupFailsOverAModelWithNoProvider
red on upstream/main, green here; the family and the plain-400 guards
green); -race targeted; gofmt; vet darwin/linux/windows; builds
darwin, linux and windows (-tags nogui).
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Generated-by: GLM-5.3-Flash (ZCode)
The test's polling loop returned as soon as the fake open had written
`opened`, but the relaunch's shell writes its note for that try only
after open returns: under load the test could be gone and TempDir's
RemoveAll with it while the shell was still appending that note to the
log in the third TempDir, and the cleanup failed with "unlinkat
.../003: directory not empty" (yetone, at machine load 50-95). Once the
note for the open that went through is in the log, the shell has
nothing left to write (it only exits), so the test now waits for it
before returning, the way the gateway's tests wait out the writes of
what they started (#1524, #1543). The cleanup assertion itself is
untouched: it is what guards against a test leaving files behind.
Run: with a shell made to write 20000 files into the log's TempDir
between the open that goes through and its note, the test failed with
the issue's "directory not empty" every time without the wait and
passed 5 of 5 with it (the write-tail injection was for the runs only,
not committed). Without it, -count=5 and the package's -tags nogui
suite pass.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Generated-by: GLM-5.3-Flash (ZCode)
Tony-ooo's retest (magpie 0.1.2322, VS Code 1.144.0 on Windows): the
false positive of #3269 is back — bin\copilot-shim on PATH, no ~\.copilot,
and magpie ls still lists Copilot CLI. The marker check 6f435677c reads
six product.json places around the launcher (its folder and two above,
directly or under resources\app), and all six are absent: VS Code 1.139's
versioned Windows layout (win32VersionedUpdate) keeps the app's payload
in a folder named for the build's commit — the short hash, ten lowercase
hex digits, 2c33b50b16 for 1.144.0 — with resources\app under it and bin
beside it (microsoft/vscode#343045), so product.json is at
<install>\2c33b50b16\resources\app\product.json, one level under the
deepest place the walk reaches.
The walk now also takes a build folder a commit's short hash names: a
child of any of the three folders whose name is ten lowercase hex digits
and that keeps resources\app\product.json there. A folder of the user's
is not named as a commit's short hash is, so the cap keeps its meaning —
nothing wider than the same three folders is read, and a product.json
further up still says nothing of an editor.
vscodeCodeBinary is left alone: it reads product.json to tell WHICH build
a code launcher belongs to, and when it reads none, keeping the PATH
fallback is that function's own documented behavior; #3269's judge only
asks whether an editor keeps the folder at all.
Run:
- TestCopilotLauncherBesideTheBuildsHashFolderIsNotTheCLI (new): red on
fb29cd30f ("VS Code 1.144's copilot launcher is taken for the Copilot
CLI"; "the CLI looked for is .../bin/copilot-shim/copilot, the
launcher"), green now.
- The name guard alone is the mutation: commitHashName made to take
every name turns the same test's last case red ("a folder beside bin
that is no build's hash counts as an editor's install").
- TestCopilotLauncherFromAnEditorIsNotTheCLI: green (1.143's layout, a
Mac's app, bin itself, the CLI where a user's installs put it, npm's
global under a far product.json, a link on PATH).
- go test -tags nogui ./internal/agent: green but TestMothX, which fails
the same on the untouched tree (this Mac's PATH has a real mothx).
- gofmt -l internal/agent clean; go vet darwin, GOOS=linux -tags nogui,
GOOS=windows; go build darwin, GOOS=linux -tags nogui, GOOS=windows.
Not tried: a real Windows 1.144.0 install — this was written on a Mac;
the layout is read from microsoft/vscode#343045 and from Tony-ooo's
paths on disk.
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Generated-by: GLM-5.3-Flash (ZCode)
A request via Top-API for deepseek-v4.1-flash answered under
deepseek-flash was marked a swap. It isn't one: DeepSeek renamed its
V4.1 Flash deepseek-flash (api-docs.deepseek.com/updates, 2026-09-10:
"Change the model name to deepseek-flash to call the latest V4.1 Flash
model"), and every exemption Swapped knows is structural - a dated or
pinned tail, a Bedrock geography, a relay's word in front, a serving
name - none of which an official rename reads as.
VendorAlias reads a small table of rename pairs the vendor's own docs
state (deepseek-flash is V4.1 Flash), both ways, over squashed bare
names so case and separators don't matter; a bareModel'd name feeds it,
so the dated spellings either side writes hit it too. Only pairs the
docs state go in: a retired name routed elsewhere (deepseek-v4-flash)
is another model, and catalog's SameModel keeps deepseek-flash an id of
its own. The kept-row readers take the alias in beside the other
exemptions, so rows recorded before it are read back as not swapped.
Run (sandbox HOME, GOTOOLCHAIN=auto, -tags nogui):
go test ./internal/usage -run 'TestSwappedVendorAlias|
TestKeptRowVendorAliasNotSwapped' -> ok (base f811bf291: both FAIL,
the seven alias pairs read as swaps)
go test ./internal/usage -run 'TestSwapped|TestKeptRow|TestListed|
TestRelay' -> ok
Reviewed and landed as one batch of 12 commits (gua's #4593, #3269,
#3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path
sibling, and four review follow-ups). Run for the batch, whose last
commit's tree is 5d58a75f3:
- Full suite before the rebase (base d307aa648, wsl-run magpie-desktop,
go test -tags nogui -count=1 -timeout 45m ./...): 81 packages ok. Reds,
all with issues and none in code this batch touches: internal/agent
TestInstalledVersion, TestGrokInstalled, TestOmpDetectedWithPiDir
(#4033, #3548, #3141); gateway TestUnroutedHeldReportSaved (#4300);
gui TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestColdTurnsTaken (#4510); provider
TestClaudeAccountServesModelsListedSinceItsFetch (#3174). Run alone at
origin/main 573b21f4b, TestGrokInstalled, TestOmpDetectedWithPiDir
and TestSettingsSaveKeepsWhatItDoesNotSend are red there too. The
other four pass there alone.
- After the rebase onto origin/main 573b21f4b, at this tree:
internal/usage, update, gateway and provider ok. In internal/agent,
the #4033/#3141 install-detection reds plus TestCopilotFolderFrom-
AnIDEPluginIsNotTheCLI and TestZedAppPath. Those two are flaky the
same way at origin/main (-count=10 alone: 4 and 5 of 10 red) and are
already listed in #4033. The #3269 tests (TestCopilotLauncher*) pass
5 of 5.
- Rebased onto origin/main ef63ef4a2. The #2855 commit met 0b9727ec9
(#2974) in responses.go: the streamed item's done now takes both, the
upstream's own id (thinkUp) and the made-over item; and in
gateway-routing.md main's paragraph is kept with #2855's clause. That
matches gua's latest head (range-diff: context only). At tree d7c76c6fa:
internal/gateway, provider, usage, redact and update ok; vet
GOOS=linux -tags nogui ./internal/..., darwin and GOOS=windows for
gateway and provider.
- Rebased last onto origin/main d8f7d089f (5 commits: internal/agent
and GUI files only). At tree 0d4bfd8c8, the pushed one: internal/agent's
TestCopilotLauncher*, TestClaude*, TestOwn* and TestVSCode* ok, -count=3;
TestCopilotFolderFromAnIDEPluginIsNotTheCLI red once there, as it is at
main (#4033). Vet of internal/agent: darwin, linux and windows.
- gofmt -l clean. On mote: go vet darwin, GOOS=linux -tags nogui and
GOOS=windows.
- Broken by hand, each turning its guard red: the lift gate
(TestReadingKeepsARefusalsRest, TestAutoVisionKeepsOffARefusedAccount);
the named-time condition (TestNamedQuotaTimeReplacesAGuess); the
filter-chain hop (WholeReply/glm-5.3-flash); Edward's aAt
(TestKeyAllowanceElapsedResetStartsAgain); and the old
magpieMadeReasoning, which panics in TestMadeReasoningSaysItsTextOnce/
no_summary. Every new test of gua's is red at base d307aa648.
Not tried: real OpenAI, DeepSeek, GLM or ChatGPT accounts; a real VS Code
1.144 install on Windows; a GUI run (no GUI files are touched).
Generated-by: GLM-5.3-Flash (ZCode)
The model field (and a WSL Claude Code's, asleep) appended
claudeViaMagpie's list to Claude Code's own models, which copies it,
after claudeViaMagpie had copied it once already: 6.3 MB of forty polls
with real accounts. claudeViaShared gives the list kept, read only, to
such a caller; the append makes the field's list one of its own.
claudeViaMagpie still gives every other caller a copy.
TestClaudeViaMagpieKept now also writes into the model field's options
and checks that neither kept list (folded or not) changes.
Run on mote at 68ebd1ec4 plus this change:
- gofmt; go vet darwin, windows, linux: ok
- go test ./internal/agent -timeout 45m: ok (317.0s), with the test's
first version, which read only the unfolded list
- that version broken by hand (the field returns the kept list itself)
went red on the folded-list check, not its own; the check now reads
both lists. Alone 3/3 ok, and broken by hand red with "reached the
options kept (folded true)"; the whole package not run again after
- real accounts, sandbox HOME, network blocked, 40 polls, against
v0.1.2494's change set: claudeIn.func57 23.4 -> 19.1 MB,
claudeViaMagpie's 6.3 MB copy gone; state and drift answers byte for
byte the same; footprint peak 141 MB, RSS at end 181 MB (noise between
runs is about this size)
Not run: the GUI suite (no GUI file changed), Windows and Linux test runs.
Rebased onto 9f75279e9 (two GUI commits, nothing in internal/agent); not run again there.
3f2faef62 moved .rt-mask's rules from routing.css to app.css and gave
the shared rule flex: none, which the Providers page's switch needs
beside its search box. Routing's and Usage's buttons had flex 0 1 auto
before; flex: none is now scoped to #view-providers .pv-head >
.rt-mask, so those two pages lay out as they did.
Run on mote: provider-mask, window-mask, mask-emails,
privacy-hides-accounts and routing-many-keys, 91/92. The red is
routing-many-keys "a wire ends at each key in sight at the foot"
(webkit en), which goes red 1 run in 3 with or without this change
and green 3 of 3 at origin/main 6712e367e alone; it is #4082 (red on
main under load). Not tried: Routing and Usage headers at every width
in a whole GUI run after this change.
3f2faef62 (the Providers page's own Hide accounts switch) was rebased
onto a main whose core had grown since its first budget run, and took
the core's scripts to 1,533,238 bytes, over their 1,533,105 budget:
TestCoreScriptBudget red on main. Its comment over the two switches is
cut to four lines; the core is 1,533,004, app.js 1,311,915. No raise.
Run on mote at this tree: go test -tags nogui -run Budget
./internal/gui ok (red at 3f2faef62: "the core's scripts are 1533238
bytes"); provider-mask.test.cjs 60/60. Comment-only change, nothing
else run.
Goose's model field asked ownOptions each poll, for the picker and again
for Drift, and each provider's models were made into options anew
(catalog.Provider, options, group, its icon): ownOptionsFrom was 21.2 MB
of forty polls with real accounts. For agents without a registry of
their own (native == nil), each provider's options are now kept in
ownBuilt per provider.StampNow (a minute at most) and copied into the
caller's list; Pi's and omp's, which read their own registries, are
built as before (ownProvider is the old loop body).
TestOwnOptionsKept: a catalog of 200 OpenAI models; asking again takes a
fifth or less of the allocations building does, a caller's write doesn't
reach what is kept, and a model the catalog lists since is offered.
Run on mote at c1457f2ee plus this commit and the next one (Goose's own
options kept), together:
- gofmt; go vet darwin, windows, linux: ok
- TestClaudeViaMagpieKept and TestOwnOptionsKept alone 3/3 ok
- go test ./internal/agent -timeout 45m: ok (267.7s)
- real accounts, sandbox HOME, network blocked, 40 polls, both commits
against c1457f2ee: state and drift answers byte for byte the same;
footprint peak 134 MB, RSS at end 177 MB
- broken by hand (ownOptionsFrom builds each time): red, "took 211
allocations, building them 202"
- ownOptionsFrom 21.2 -> 7.0 MB, gooseIn.func10 28.9 -> 16.0 MB; Picks
134 -> 118 MB with the commit before
Not run: the GUI suite (no GUI file changed), Windows and Linux test runs.
Picked onto ef63ef4a2 (with ef63ef4a2, Codex's subagent models kept, and gateway, redact and GUI commits; none in internal/agent); not run again there.
Claude Code's model and tier fields asked claudeViaMagpie each poll, for
the picker and again for Drift, and it built the list anew each time:
19.1 MB of forty polls of the Agents, Providers and Drift answers with
real accounts. It is now kept in builtOptions per provider.StampNow (a
minute at most), folded and not apart, and each caller has a copy of
its own (buildClaudeVia is the old body).
TestClaudeViaMagpieKept: a provider of 102 models; asking again takes a
fifth or less of the allocations building does, a caller's write doesn't
reach the kept list, the folded list is kept apart, and a provider saved
since is offered.
Run on mote at c1457f2ee plus this commit and the next one (Goose's own
options kept), together:
- gofmt; go vet darwin, windows, linux: ok
- TestClaudeViaMagpieKept and TestOwnOptionsKept alone 3/3 ok
- go test ./internal/agent -timeout 45m: ok (267.7s)
- real accounts, sandbox HOME, network blocked, 40 polls, both commits
against c1457f2ee: state and drift answers byte for byte the same;
footprint peak 134 MB, RSS at end 177 MB
- broken by hand (claudeViaMagpie builds each time): red, "took 345
allocations, building them 345"
- claudeViaMagpie 19.1 MB -> 6.3 MB, claudeIn.func57 33.8 -> 23.4 MB
Not run: the GUI suite (no GUI file changed), Windows and Linux test runs.
Picked onto ef63ef4a2 (with ef63ef4a2, Codex's subagent models kept, and gateway, redact and GUI commits; none in internal/agent); not run again there.
Codex's Agents row asked CodexSubagentModels each poll, and each time it
took a copy of Codex's whole catalog (CatalogFor) and made a list from
it: 21.8 MB of forty polls of the Agents, Providers and Drift answers
with real accounts. The list is now kept as the catalog is (keptOf, per
provider.StampNow and keptFor), read from the catalog's own kept lists
(catalogKept) without a copy, and clipped so a caller appending makes
a list of its own. Its one caller, codex.go, only ranges over it.
TestCodexSubagentModelsKept: 200 models of a relay under Hold; asking
again allocates a quarter or less of what building them does.
Run on mote at c1457f2ee plus this change:
- gofmt; go vet darwin, windows, linux: ok
- TestCodexSubagentModelsKept alone 3/3 ok
- broken by hand (CodexSubagentModels builds each time): red, "allocated
1089523 bytes, building them 1089513"
- go test ./internal/provider ./internal/agent -timeout 45m: agent ok
(231.7s); provider ok but for this test's first version, whose
allocation-count bar failed (StampNow's stats count too); the test now
compares bytes and was run alone and broken again as above, not in the
whole package again
- real accounts, sandbox HOME, network blocked, 40 polls, against
c1457f2ee: CodexSubagentModels 21.8 MB -> not in the profile;
codexIn.func84 22.3 MB -> gone; Picks 135 -> 92 MB; state and drift
answers byte for byte the same, providers the same but for its
fetched times; footprint peak 135 MB, RSS at end 178 MB
Not run: the GUI suite (no GUI file changed), Windows and Linux test runs.
Rebased onto e4384fc3c (gateway, redact and GUI commits, none in internal/provider or internal/agent); not run again there.
#3377's patch writes response.failed when the upstream cuts a Codex
stream mid-reply. When the cut lands inside a line, the half line was
still open, so the events streamError writes were read as more of that
line's data and the client never parsed the failure. A blank line now
goes first, ending the half event (as #2446 and #2580 do on the other
relays).
TestCodexStreamCutMidLineFailureParses cuts the stream inside a delta's
data and checks every event the client reads parses, apart from the half
line itself, and that response.failed is among them.
Landing record (yetone):
Run at the pushed batch head (tree a6b084d0b, on origin/main 616405061),
go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider and internal/plugin (this batch's
packages and those main changed since the full run): all ok. gofmt -l
clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags
nogui ./... clean. internal/gui on macOS (mote-run):
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestMainWindowCorners
(#3949), both red at main too.
- The full go test ./... -timeout 45m -count=1 ran one rebase earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2 (main then gained 5bfa9f076's
group stand-in, b19d08593, f856d381a and 616405061). It ran on Linux
(wsl-run): 82 packages ok. internal/agent has 4 reds, all red at
origin/main on that box as well: TestInstalledVersion,
TestGrokInstalled, TestOmpDetectedWithPiDir and
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, #3548). The root
package and internal/cli need gtk4 to build, so they ran on macOS
(mote-run): ok. TestColdTurnsTaken (#4510) was red there once. An
earlier full run at base d307aa648 was red once in
TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone at both
the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
Broken by hand: the blank line removed:
TestCodexStreamCutMidLineFailureParses goes red; restored, green.
Not tried: a real cut inside a line from chatgpt.com.
#3377's patch writes response.failed when the upstream cuts a Codex
stream mid-reply. When the cut lands inside a line, the half line was
still open, so the events streamError writes were read as more of that
line's data and the client never parsed the failure. A blank line now
goes first, ending the half event (as #2446 and #2580 do on the other
relays).
TestCodexStreamCutMidLineFailureParses cuts the stream inside a delta's
data and checks every event the client reads parses, apart from the half
line itself, and that response.failed is among them.
Landing record (yetone):
Run at tree 7d7955eb9 (this batch on origin/main 3cfba2e37), go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider, internal/agent and internal/usage
(this batch's packages, plus those main changed since the full run): all
ok except internal/agent's TestInstalledVersion, TestGrokInstalled and
TestOmpDetectedWithPiDir, red at origin/main on that box too (#4033,
#3548). gofmt -l clean; go vet ./... (darwin), GOOS=linux and
GOOS=windows go vet -tags nogui ./... clean. On macOS (mote-run), the
root package and internal/cli ok; internal/gui red in
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510), the first two red at main too.
- The full go test ./... -timeout 45m -count=1 ran two rebases earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2, on Linux (wsl-run): 82
packages ok, internal/agent's 4 reds as above, plus
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, red at main). The
root package, internal/cli and internal/gui need gtk4 to build, so they
ran on macOS as above. An earlier full run at base d307aa648 was red
once in TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone
at both the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
- Rebased after these runs onto origin/main c1457f2ee. Its two commits
since 3cfba2e37 (3f2faef62 gui, c1457f2ee agent) touch neither
internal/gateway nor internal/redact, nor any file this batch changes,
and were not run again here.
Broken by hand: the blank line removed:
TestCodexStreamCutMidLineFailureParses goes red; restored, green.
Not tried: a real cut inside a line from chatgpt.com.
#3526's patch compacts locally when the summary ask ends short with an
error. The same cut can come back as a recorded 502 whose error says it
ended short (errEndedShort), with no error returned, and that still went
to the client as a 5xx. The local fallback now runs before the status
check, for both shapes (summaryEndedShort), and says why from the
recorded error. A 502 that says anything else still goes to the client
as it did. Edward4226 pointed at the 502 shape in the thread.
TestCodexCompactCutShapesCompactLocally covers a stream error, a 502
saying it ended short (compacts locally) and a 502 saying more (stays
502).
Landing record (yetone):
Run at the pushed batch head (tree a6b084d0b, on origin/main 616405061),
go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider and internal/plugin (this batch's
packages and those main changed since the full run): all ok. gofmt -l
clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags
nogui ./... clean. internal/gui on macOS (mote-run):
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestMainWindowCorners
(#3949), both red at main too.
- The full go test ./... -timeout 45m -count=1 ran one rebase earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2 (main then gained 5bfa9f076's
group stand-in, b19d08593, f856d381a and 616405061). It ran on Linux
(wsl-run): 82 packages ok. internal/agent has 4 reds, all red at
origin/main on that box as well: TestInstalledVersion,
TestGrokInstalled, TestOmpDetectedWithPiDir and
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, #3548). The root
package and internal/cli need gtk4 to build, so they ran on macOS
(mote-run): ok. TestColdTurnsTaken (#4510) was red there once. An
earlier full run at base d307aa648 was red once in
TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone at both
the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
Broken by hand: summaryEndedShort made to return false: the "HTTP 502"
subtest goes red; restored, green.
Not tried: a real ChatGPT summary ask answered 502.
#3526's patch compacts locally when the summary ask ends short with an
error. The same cut can come back as a recorded 502 whose error says it
ended short (errEndedShort), with no error returned, and that still went
to the client as a 5xx. The local fallback now runs before the status
check, for both shapes (summaryEndedShort), and says why from the
recorded error. A 502 that says anything else still goes to the client
as it did. Edward4226 pointed at the 502 shape in the thread.
TestCodexCompactCutShapesCompactLocally covers a stream error, a 502
saying it ended short (compacts locally) and a 502 saying more (stays
502).
Landing record (yetone):
Run at tree 7d7955eb9 (this batch on origin/main 3cfba2e37), go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider, internal/agent and internal/usage
(this batch's packages, plus those main changed since the full run): all
ok except internal/agent's TestInstalledVersion, TestGrokInstalled and
TestOmpDetectedWithPiDir, red at origin/main on that box too (#4033,
#3548). gofmt -l clean; go vet ./... (darwin), GOOS=linux and
GOOS=windows go vet -tags nogui ./... clean. On macOS (mote-run), the
root package and internal/cli ok; internal/gui red in
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510), the first two red at main too.
- The full go test ./... -timeout 45m -count=1 ran two rebases earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2, on Linux (wsl-run): 82
packages ok, internal/agent's 4 reds as above, plus
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, red at main). The
root package, internal/cli and internal/gui need gtk4 to build, so they
ran on macOS as above. An earlier full run at base d307aa648 was red
once in TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone
at both the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
- Rebased after these runs onto origin/main c1457f2ee. Its two commits
since 3cfba2e37 (3f2faef62 gui, c1457f2ee agent) touch neither
internal/gateway nor internal/redact, nor any file this batch changes,
and were not run again here.
Broken by hand: summaryEndedShort made to return false: the "HTTP 502"
subtest goes red; restored, green.
Not tried: a real ChatGPT summary ask answered 502.
Co-authored-by: Edward4226 <234070868+Edward4226@users.noreply.github.com>
Co-authored-by: Edward4226 <234070868+Edward4226@users.noreply.github.com>
#2946's patch masked any JSON value whose field name looks like a
secret's (api_key, password, *_token) anywhere in a request body outside
tool definitions. That is an exemption, and a mask, keyed on a field's
name: it rewrote what the agent itself sends (mcp_servers'
authorization_token, a top-level api_key, metadata.session_token) as
well as the user's data. The name check now runs only where the user's
data sits in the protocol: a tool call's arguments (Anthropic tool_use
input, OpenAI arguments, Gemini functionCall args) and a tool's result
(Gemini functionResponse.response is added to the places scan reads),
and only with secrets masking on.
The Authorization/Cookie rule masked the word after the header name in
prose too ("Authorization: required for this route"). It now masks only
a value with a credential's shape: one token, or a scheme word and a
token, of 8 or more characters with a non-letter and not a ${VARIABLE};
or name=value cookie pairs.
Tests: TestMaskJSONNamedSecrets puts its values in tool_use input,
functionCall args and functionResponse response;
TestMaskJSONSecretNamesOnlyInToolArgs holds the agent's own fields as
written and nothing masked with secrets off; TestMaskAuthHeaders gains
prose rows (no mask) and a Cookie row.
docs/subsystems/gateway-routing.md says where the name check runs.
Landing record (yetone):
Run at the pushed batch head (tree a6b084d0b, on origin/main 616405061),
go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider and internal/plugin (this batch's
packages and those main changed since the full run): all ok. gofmt -l
clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags
nogui ./... clean. internal/gui on macOS (mote-run):
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestMainWindowCorners
(#3949), both red at main too.
- The full go test ./... -timeout 45m -count=1 ran one rebase earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2 (main then gained 5bfa9f076's
group stand-in, b19d08593, f856d381a and 616405061). It ran on Linux
(wsl-run): 82 packages ok. internal/agent has 4 reds, all red at
origin/main on that box as well: TestInstalledVersion,
TestGrokInstalled, TestOmpDetectedWithPiDir and
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, #3548). The root
package and internal/cli need gtk4 to build, so they ran on macOS
(mote-run): ok. TestColdTurnsTaken (#4510) was red there once. An
earlier full run at base d307aa648 was red once in
TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone at both
the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
Broken by hand: the name check's scope put back to everywhere but tool
definitions: TestMaskJSONSecretNamesOnlyInToolArgs goes red; headerValue
made to accept anything: TestMaskAuthHeaders' prose rows go red;
restored, green.
Not tried: a real agent's request through the gateway with masking on.
#2946's patch masked any JSON value whose field name looks like a
secret's (api_key, password, *_token) anywhere in a request body outside
tool definitions. That is an exemption, and a mask, keyed on a field's
name: it rewrote what the agent itself sends (mcp_servers'
authorization_token, a top-level api_key, metadata.session_token) as
well as the user's data. The name check now runs only where the user's
data sits in the protocol: a tool call's arguments (Anthropic tool_use
input, OpenAI arguments, Gemini functionCall args) and a tool's result
(Gemini functionResponse.response is added to the places scan reads),
and only with secrets masking on.
The Authorization/Cookie rule masked the word after the header name in
prose too ("Authorization: required for this route"). It now masks only
a value with a credential's shape: one token, or a scheme word and a
token, of 8 or more characters with a non-letter and not a ${VARIABLE};
or name=value cookie pairs.
Tests: TestMaskJSONNamedSecrets puts its values in tool_use input,
functionCall args and functionResponse response;
TestMaskJSONSecretNamesOnlyInToolArgs holds the agent's own fields as
written and nothing masked with secrets off; TestMaskAuthHeaders gains
prose rows (no mask) and a Cookie row.
docs/subsystems/gateway-routing.md says where the name check runs.
Landing record (yetone):
Run at tree 7d7955eb9 (this batch on origin/main 3cfba2e37), go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider, internal/agent and internal/usage
(this batch's packages, plus those main changed since the full run): all
ok except internal/agent's TestInstalledVersion, TestGrokInstalled and
TestOmpDetectedWithPiDir, red at origin/main on that box too (#4033,
#3548). gofmt -l clean; go vet ./... (darwin), GOOS=linux and
GOOS=windows go vet -tags nogui ./... clean. On macOS (mote-run), the
root package and internal/cli ok; internal/gui red in
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510), the first two red at main too.
- The full go test ./... -timeout 45m -count=1 ran two rebases earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2, on Linux (wsl-run): 82
packages ok, internal/agent's 4 reds as above, plus
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, red at main). The
root package, internal/cli and internal/gui need gtk4 to build, so they
ran on macOS as above. An earlier full run at base d307aa648 was red
once in TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone
at both the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
- Rebased after these runs onto origin/main c1457f2ee. Its two commits
since 3cfba2e37 (3f2faef62 gui, c1457f2ee agent) touch neither
internal/gateway nor internal/redact, nor any file this batch changes,
and were not run again here.
Broken by hand: the name check's scope put back to everywhere but tool
definitions: TestMaskJSONSecretNamesOnlyInToolArgs goes red; headerValue
made to accept anything: TestMaskAuthHeaders' prose rows go red;
restored, green.
Not tried: a real agent's request through the gateway with masking on.
ggbdpq's #3197 commit, rebased on a main that already holds the line a
read left unfinished (df1c3dace, #2580: write, unheld, dropHalf), still
put a second hold in front of it: a wrapper that replaced write for SSE
and held the same pending line again, with a 1 MiB bound main's write
does not have. Two holds over one buffer is two places to get the same
rule wrong, and the wrapper returned 0 for bytes it held. This takes
the wrapper out and keeps what #3197 adds over #2580: a Chat stream the
upstream severed ends on data: [DONE] after its error event.
Landing record (yetone):
Run at the pushed batch head (tree a6b084d0b, on origin/main 616405061),
go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider and internal/plugin (this batch's
packages and those main changed since the full run): all ok. gofmt -l
clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags
nogui ./... clean. internal/gui on macOS (mote-run):
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestMainWindowCorners
(#3949), both red at main too.
- The full go test ./... -timeout 45m -count=1 ran one rebase earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2 (main then gained 5bfa9f076's
group stand-in, b19d08593, f856d381a and 616405061). It ran on Linux
(wsl-run): 82 packages ok. internal/agent has 4 reds, all red at
origin/main on that box as well: TestInstalledVersion,
TestGrokInstalled, TestOmpDetectedWithPiDir and
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, #3548). The root
package and internal/cli need gtk4 to build, so they ran on macOS
(mote-run): ok. TestColdTurnsTaken (#4510) was red there once. An
earlier full run at base d307aa648 was red once in
TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone at both
the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
Broken by hand: the [DONE] after a severed Chat stream's error removed:
TestPassthroughChatSeveredMidLine and
TestPassthroughChatSeveredAtLineEnd go red; restored, green. The #2580
hold tests stay green without the wrapper.
Not tried: a real severed upstream.
Landing record (yetone):
Run at tree 7d7955eb9 (this batch on origin/main 3cfba2e37), go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider, internal/agent and internal/usage
(this batch's packages, plus those main changed since the full run): all
ok except internal/agent's TestInstalledVersion, TestGrokInstalled and
TestOmpDetectedWithPiDir, red at origin/main on that box too (#4033,
#3548). gofmt -l clean; go vet ./... (darwin), GOOS=linux and
GOOS=windows go vet -tags nogui ./... clean. On macOS (mote-run), the
root package and internal/cli ok; internal/gui red in
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510), the first two red at main too.
- The full go test ./... -timeout 45m -count=1 ran two rebases earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2, on Linux (wsl-run): 82
packages ok, internal/agent's 4 reds as above, plus
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, red at main). The
root package, internal/cli and internal/gui need gtk4 to build, so they
ran on macOS as above. An earlier full run at base d307aa648 was red
once in TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone
at both the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
- Rebased after these runs onto origin/main c1457f2ee. Its two commits
since 3cfba2e37 (3f2faef62 gui, c1457f2ee agent) touch neither
internal/gateway nor internal/redact, nor any file this batch changes,
and were not run again here.
Broken by hand: the [DONE] after a severed Chat stream's error removed:
TestPassthroughChatSeveredMidLine and
TestPassthroughChatSeveredAtLineEnd go red; restored, green. The #2580
hold tests stay green without the wrapper.
Not tried: a real severed upstream.
A plugin that reads a model's text-form tool calls ends a turn whose
upstream stream died mid-call as a failure, so the gateway can act
(magpie-community/plugins#38: the turn ends as an error "the gateway can
retry or fail over"). The gateway did neither: the error was classified
as an unknown failure, the account was rested for a minute of backoff,
and the failure was passed to the client — the retry the plugin
engineered never happened, and the user's next attempt met the backoff
too (#2873's routing record: status 200, usage null, fail "other",
rest "backoff", 60s).
What changed: the contract's own error wording ("the model's tool call,
written as text, was cut short", shared by the plugins that read
text-form calls — packages/trae, packages/qoder's CUT_SHORT) is
classified as a failure of its own, "cut". Nobody rests for it and no
failure is counted: the same member is asked again once — the plugin's
parser reads the same but the cut doesn't come again — then the next
member as any failure's is; the last member left keeps its usual
same-member retries, and the agent is told only after the retries run
out.
Why: a cut is transient and nobody's fault — the account is as good as
it was, and a minute of backoff only pushed the user's next attempt off
the same account the plugin had proven works.
Run: the new tests (plugin_cutshort_test.go) fail on the unfixed tree —
the failing account is tried once, rested, and its mate answers; with
the fix the same member answers on its second try, nobody rests, and
every member cutting still ends the turn with nobody rested. Full
gateway package green (316s), targeted family green under -race, vet
and gofmt clean, builds fine on darwin and windows; the linux
cross-build fails in the wails GUI dependency exactly as it does on the
unfixed base (needs a native linux build), and the gateway package
itself builds for linux.
Landing record (yetone):
Run at the pushed batch head (tree a6b084d0b, on origin/main 616405061),
go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider and internal/plugin (this batch's
packages and those main changed since the full run): all ok. gofmt -l
clean; go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags
nogui ./... clean. internal/gui on macOS (mote-run):
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and TestMainWindowCorners
(#3949), both red at main too.
- The full go test ./... -timeout 45m -count=1 ran one rebase earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2 (main then gained 5bfa9f076's
group stand-in, b19d08593, f856d381a and 616405061). It ran on Linux
(wsl-run): 82 packages ok. internal/agent has 4 reds, all red at
origin/main on that box as well: TestInstalledVersion,
TestGrokInstalled, TestOmpDetectedWithPiDir and
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, #3548). The root
package and internal/cli need gtk4 to build, so they ran on macOS
(mote-run): ok. TestColdTurnsTaken (#4510) was red there once. An
earlier full run at base d307aa648 was red once in
TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone at both
the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
Broken by hand: the cut-short path made to fall through to the old
failure: TestPluginCutShortIsRetriedNotRested and
TestPluginCutShortEveryMemberCutEndsTheTurn go red; restored, green.
Not tried: a real plugin whose model cuts a text-form tool call short;
the words matched are the plugin's own.
Landing record (yetone):
Run at tree 7d7955eb9 (this batch on origin/main 3cfba2e37), go1.26.8:
- go test -count=1 -timeout 45m on Linux (wsl-run) of internal/gateway,
internal/redact, internal/provider, internal/agent and internal/usage
(this batch's packages, plus those main changed since the full run): all
ok except internal/agent's TestInstalledVersion, TestGrokInstalled and
TestOmpDetectedWithPiDir, red at origin/main on that box too (#4033,
#3548). gofmt -l clean; go vet ./... (darwin), GOOS=linux and
GOOS=windows go vet -tags nogui ./... clean. On macOS (mote-run), the
root package and internal/cli ok; internal/gui red in
TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestMainWindowCorners
(#3949) and TestColdTurnsTaken (#4510), the first two red at main too.
- The full go test ./... -timeout 45m -count=1 ran two rebases earlier,
at tree 66a7a4c17 on origin/main 3a3bdb9f2, on Linux (wsl-run): 82
packages ok, internal/agent's 4 reds as above, plus
TestCopilotFolderFromAnIDEPluginIsNotTheCLI (#4033, red at main). The
root package, internal/cli and internal/gui need gtk4 to build, so they
ran on macOS as above. An earlier full run at base d307aa648 was red
once in TestUnroutedHeldReportSaved (#4300), which passes 5 of 5 alone
at both the head and main.
- Each landed patch's diff matches the head ggbdpq posted last on its
issue (patch-id).
- No GUI file is touched, so no GUI test file was run.
- Rebased after these runs onto origin/main c1457f2ee. Its two commits
since 3cfba2e37 (3f2faef62 gui, c1457f2ee agent) touch neither
internal/gateway nor internal/redact, nor any file this batch changes,
and were not run again here.
Broken by hand: the cut-short path made to fall through to the old
failure: TestPluginCutShortIsRetriedNotRested and
TestPluginCutShortEveryMemberCutEndsTheTurn go red; restored, green.
Not tried: a real plugin whose model cuts a text-form tool call short;
the words matched are the plugin's own.
Generated-by: GLM-5.3-Flash (ZCode)