ac4af582301a4e8a29245dbba767eba31334ddf9
7089
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
94f6f60925 |
tray: every window a card reports can be picked alone for the menu bar, Cursor's Grok Bot too (CrazyJal on X)
CrazyJal on X (tweet 2116833523604886006): Settings > Usage > Menu bar
windows, Cursor's pill had no choice for the Grok Bot window alone.
Why: the picker offered only the windows the menu bar shows unpicked
(trayWindows), which leaves out every window set aside. The Cursor
plugin reports Grok Bot aside (so it doesn't stop Cursor's models), so
it was never offered. And kinds were only a span ("7d"): Grok Bot and a
weekly plan's Weekly are both 7 days, as are Antigravity's two pools, so
two windows shared one kind, the GUI showed one of them, and picking it
picked both. The plugin reports the window fine; nothing changes there.
Fix (the class, every provider): trayChoices lists every window of a
card that the menu bar can say as a percent (trayCounted): the usual
ones first, then the rest (money aside, one model's window, Grok Bot),
marked TrayExtra and shown only when picked. Every choice has a kind of
its own: a usual window keeps its span's kind where it is the only one
of that span (so existing picks like claude:["5h"] keep working);
another of that span, and every extra, gets its model or name after it
("7d:grok bot", "7d:gemini · 7 days"). Unpicked, every card shows what
it showed before. The Settings pill offers the extras, and drops a pick
only when it is empty or exactly the usual windows.
Run (mote, at this tree, committed then as 0750aa783, on origin/main
|
||
|
|
c0477aa728 |
providers, settings: a Codex account's resets are used where they are shown, its Providers row and Settings' auto-use rows (roamlog, husky_bobo on X)
roamlog on X (使用重置卡的功能哪去了): the Providers page's Codex editor
showed "↺ 2 张重置卡" on each ChatGPT account, windows at 0% left, and no
way to use one. Nothing was removed: the use (askReset, resetask.js) was
only ever on the Usage card ("Use a reset") and the menu bar panel ("Use
one…"); the Providers row's chip (#813) was words. husky_bobo (X, Windows
10, v0.1.2597, 为什么我没有这个手动用卡按钮呢?) looked for it in Settings ›
Usage, under "Codex: auto-use resets" with both times on, where it never
was either.
- Providers editor: a Codex account's "↺ N resets" is a button (a span
with role=button, the window meters' aq-set look and hover, no colour of
its own; Enter and Space too) opening the same confirmation, its
tooltip saying which reset a use spends. A GLM team's resets, counted
by window and used on the vendor's page, stay words.
- The confirmation asked from the editor goes back to it on Cancel or
once spent (ed.back, as Sign out's does): the editor is the modal, and
closing would have closed it too.
- Settings › Usage › Codex: auto-use resets: each account holding resets
says "↺ N resets · until … · auto-used before it expires" under its
name with "Use a reset" beside it, read as the editor reads them
(loginUsageOf, cached a minute), drawn again once spent. In
autoresetown.js, loaded with those rows.
- No new strings. The core's scripts are 1,533,441 bytes, 305 under
their size before, budget 1,533,802 not raised: a span-as-button helper
(spanBtn) shared with windowCapMeter, and the reset helpers' comments
cut down.
Run, at base
|
||
|
|
15b035eef0 |
claude: the interactive mode takes an image known by its URL
The interactive mode is pasted files, so an image a client names by its
URL alone made the run fall to the refusal list ("image"), which with
the TUI on means a 502. Now serveSubscription downloads each such image
first (fetchURLImages): from public addresses only (publicClient, the
same fetch the other providers use), checked to be an image by its
bytes, and kept by URL (32 of them) so a conversation that hands the
same URLs over each turn downloads each once. One that can't be had
fails the request with a 400 naming the URL and why; nothing of a
non-image's content is echoed. claudePrint's "image" entry stays as a
backstop, unreachable with the mode on.
The provider editor's tooltip for claude -p no longer lists the image
among what the interactive mode can't take (en, zh, zh-TW, ja, de), and
the bridge's subsystem page says how the image is fetched.
Run (mote, at this tree on
|
||
|
|
9d08993c8b |
routing: Cheapest first prices Ollama Cloud's DeepSeek models at double from 12:00 to 18:00 UTC on weekdays (hayden4608)
hayden4608 on Discord asked that time-of-day routing use the gap between peak and off-peak prices, citing https://ollama.com/pricing. That page (read live on 11-01) gives Off-Peak rows for two models only, deepseek-v4.1-flash ($0.30/$1.20 peak, $0.15/$0.60 off-peak) and deepseek-v4-pro ($1.32/$3.96 peak, $0.66/$1.98), and says off-peak is "outside 12:00 and 18:00 UTC on weekdays and all day on weekends". models.dev's ollama-cloud catalog lists the off-peak prices, so magpie priced Ollama Cloud's peak hours at half. - catalog: a new Peak kind, PeakOllama. Its hours are 12:00 to 18:00 UTC, Monday to Friday, with no holidays. PeakFactor (2) matches the page for both models, cache reads included. - provider: a peakBill for ollama.com (preset/catalog ollama-cloud) that names the two models. Dated tags (deepseek-v4-pro:1017) count as their model; the bare name before ':' is compared without allocating. Every other model there (glm-5.3, gpt-oss...) and every other vendor stays flat. A local Ollama, a relay that names itself ollama-cloud, and an ollama.com.evil host are not matched. - GUI: a model's price tooltip names Ollama's hours for peak "ollama". The Cheapest first and rate-window texts no longer say that only DeepSeek's hours count, in en, zh, zh-TW, ja and de. - docs/reference.md, site docs (en, zh, ja) and the gateway-routing and providers-accounts subsystem pages say the same. Run (on mote through mote-run, at this tree rebased on |
||
|
|
7d1f2ecba3 |
claudecode: magpie keeps the Claude Code it downloaded at the newest release
alextjy on Discord runs magpie in Docker with Claude Code from `magpie claude-code install`, and asked whether a magpie update touches it and how it updates. The download lives in <cache>/claude-code (/config/cache, on the volume), so a new image keeps it. But nothing ever updated it: every run magpie starts sets DISABLE_AUTOUPDATER, so it stayed at the version first installed until the user ran install again. claudecode.KeepCurrent now runs while magpie serves (a WhileServing loop): a minute after start and every six hours it asks downloads.claude.ai for the latest release and downloads a newer one, checked against the manifest's SHA-256 and size as install does. The version it replaced is removed on the next look rather than at once, since a run being started may hold its path (Install, the CLI's, still removes it at once; a folder with a .part download in it is left alone). It does nothing when magpie downloaded none, when the machine has its own `claude` (that one is run and updates itself), or when DISABLE_AUTOUPDATER is set for magpie, Claude Code's own way to hold a version. A failed look keeps the download and is logged. It never downgrades. The status line of `magpie claude-code`, the Docker docs (en, zh, ja) and the bridge's subsystem page say so. Run: - wsl-run (Ubuntu 24.04, Go 1.26.8): go vet, then go test -race -v ./internal/claudecode/ -run 'Keep|Install|Find': all pass. - Broken by hand on WSL, each red: no newer() check (UpdatesMagpiesDownload, LeavesWhatIsntMagpiesToUpdate), no own() check (the_machine's_own), pruning at install (UpdatesMagpiesDownload), no prune on the next look (UpdatesMagpiesDownload). - Real use on WSL, sandbox HOME and XDG_CACHE_HOME: a throwaway program with a fake 2.1.1 download ran KeepCurrent against the real downloads.claude.ai. After 1m34s it logged "updated from 2.1.1 to 2.1.316", the kept binary's --version said "2.1.316 (Claude Code)", 2.1.1 was still there for the next look, and the loop ended with its context. - mote, at this tree: GOOS=windows and GOOS=linux go vet -tags nogui of both packages, go vet ./internal/claudecode/, go build ., then go test -tags nogui ./internal/claudecode/ ./internal/cli/ -timeout 45m: VET-OK; claudecode ok 0.680s, cli ok 56.673s. - gofmt -l clean. Not tried: the Docker image itself (no docker on the test boxes), and a Windows run whose replaced binary is still in use (prune leaves what it can't remove for the next look). Full suite not run: the change is the claudecode package, one WhileServing line and one CLI status line. A WSL run of ./internal/cli/ at the default 10m timeout timed out while the box ran other sessions' full suites; the 45m run above replaces it. |
||
|
|
ef3e74a077 |
gateway: the Claude bridge offers a magpie Library tool under its own name, not mcp__magpie__ twice
packinggoods (Discord, 11-01): through the Claude bridge the model saw mcp__magpie__mcp__magpie__magpie-browser__browser_click for each tool the client sent up front, while deferred tools named in the client's text kept one prefix. The client (Claude Code with magpie's Library MCP) already names those tools mcp__magpie__<server>__<tool>, and the bridge's MCP helper is also called "magpie", so bridgeToolName put the prefix on again. bridgeToolName, which the tool list, tool_choice, history and the call's mapping back (bridgeNames/declaredName) all go through, now offers such a tool under the rest of its name, so the run's model sees the client's own name and a call comes back as declared. Siblings: only the Claude bridge wraps a client's tools in an MCP server (grep of mcpServers / mcp__ in internal); Codex and direct Claude Code pass names as written. Other servers' tools (mcp__linear__x) still show as mcp__magpie__mcp__linear__x through the bridge; that is nesting, not a doubled prefix, and is left as it was. A client offering both "mcp__magpie__x" and a bare "x" would have them offered alike (not handled). A resumed bridge session's older turns name the tool with the doubled prefix. Run (on mote, via mote-run, at this tree before a comment-only reword): - TestClaudeBridgeKeepsMagpieMCPNames with the old bridgeToolName put back: FAIL, "mcp__magpie__magpie-browser__browser_click is shown to the run's model as mcp__magpie__mcp__magpie__magpie-browser__browser_click", and the same for history and tool choice. Passes with the fix. - go vet ./internal/gateway, GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: ok. - go test -tags nogui -timeout 45m ./internal/gateway: ok (895s). - gofmt -l internal/gateway: nothing. Not run: the full ./... suite, Windows/Linux test runs, and a real Claude Code bridge session with the reporter's Library servers. |
||
|
|
9f17ad4c12 |
claude: the interactive mode takes safeguards and a client's cache marks
With the interactive mode on, nothing runs as -p any more (
|
||
|
|
ee7b8b0723 |
commandcode: a key's Credits window says GOAT/Go/Pro's month in credits, not dollars
jiezhengj on Discord (#feedback): Command Code GOAT says "$100 on
DeepSeek V4.1 Flash", but magpie's bar counts against $70. Command Code
counts Go, GOAT and Pro in usage-value credits
(docs/resources/usage-limits: "full-allowance models like GLM-5.2 get
$1 of usage per credit, and lower-allowance models draw proportionally
more credits per dollar"); GOAT's month is 70 of them, $100 of DeepSeek
V4.1 Flash or $70 of GLM-5.2 (pricing page, read 2026-11-01). The 70 is
right: command-code 1.88.2's getPlanInfo still has individual-goat 70,
and billing/credits' monthlyCredits counts down in the same units. The
signed-in subscription's card, served by the plugin, says "credits"
since 0.1.20 (plugins #556; mover min is 0.1.21). magpie's own card for
a Command Code key (cmdQuotaOf, via cmdKeyWindows) still said
"$28.80 / $70.00" and added bought dollars into the pool.
Now, as the plugin: on Go, GOAT and Pro the window is "28.80 / 70.00
credits", used of the month's credits alone, with bought and free
credits said beside it ("+ $5.00 extra"); Max, Ultra and Teams Pro keep
the CLI's dollar pool; Provider, pay as you go, has no month.
Run (mote): go test ./internal/provider -count=1 ok at this commit on
origin/main d1a94f579; at the same change on
|
||
|
|
d1a94f5792 |
provider: a Codex pick the ChatGPT list dropped is not offered (#4772)
Cause: the owner's codex provider keeps picks (providers.json "models")
made while ChatGPT listed gpt-5.5. ChatGPT has since stopped listing it:
the backend's /codex/models for the Pro account (client_version 0.165.0,
asked 11-01) and the saved Plus account's list both have gpt-6.1-sol,
gpt-6-astra, gpt-6.1-terra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol/terra/luna
and no gpt-5.5, and Codex CLI 0.165.0's models_cache.json has none
either. ExposedOf offers a pick the vendor's list lacks as typed in by
hand, and an account's refetch never drops gone picks (dropGonePicks is
for key providers), so codex/gpt-5.5 stayed first in /v1/models. The
backend refuses any model its list leaves out: a real request for
gpt-5.5 on the Pro account answered 400 model_not_found "The 'gpt-5.5'
model is not supported when using Codex with a ChatGPT account", while
gpt-5.6-luna answered 200. Not plan-specific: Plus and Pro alike.
Fix: a ChatGPT account (listedOnly) is treated as Copilot's already is:
with its list fetched, a pick the list doesn't have is left out of what
agents are offered. The pick itself stays saved and comes back when the
list has it again. The list is the pool's (codexPoolModels), so a model
only a saved account has is still offered and routed to it
(Account.Lists).
Run (mote, at this tree on origin/main
|
||
|
|
cbfbcb383b |
usage: a lead's answers are looked up in the blocks that name its conversation (#4370)
loggedAnswers, which leadFirst falls back to when affinity has lost a Codex subagent's lead, read thirty days of the log into a Record a row and kept the rows of one conversation. usage.VisitSessions reads only those rows: a block whose Session and NativeSession strings don't name the conversation is skipped, a row of another session is passed over by its shape's string ids without becoming a Record, and a matched row's strings are cloned out of the lent decode buffer. Each packed block's sessions are kept once it is decoded (blockSessions, by weak pointer, so no block the log let go is held), so a lookup decodes only the blocks the conversation is in and the open tail. A page's copy with Codex identities (which rewrite Session as a row is read) is read whole and filtered on its records. Run on mote (macOS 27.2), at load ~70: - BenchmarkLeadLookup (40 blocks of 3000 rows, one conversation of 300): visit+filter 39-56ms and 2.9MB an op; VisitSessions 0.38-0.52ms and 12KB. - A copy of the owner's real usage.jsonl (8,853 rows, 1,270 sessions, 18 blocks): every session looked up both ways gives the same records; 6.9ms a lookup before, 3.4ms for the first and 0.39ms after, 14us for a conversation that isn't there. - TestVisitSessionsIsVisitOfThoseSessions, red with the shape filter's session ids taken out; TestVisitSessionsRecordsKeepTheirStrings, red with the clone taken out; TestVisitSessionsSkipsBlocksOfOtherSessions, red with the known-sessions skip taken out. - GOOS=windows go vet; GOOS=linux -tags nogui go vet: ok. gofmt -l: clean. - go test -race of the new tests and the gateway tests of a lead's answers, in internal/usage and internal/gateway: ok (4.4s, 31.3s). - go test ./internal/usage ./internal/gateway (whole packages) was still running on mote at load ~190 when this was pushed; its result goes on #4370. Not tried: a real Codex subagent whose lead lost affinity; the lookup's callers and filters are as they were, and the gateway's loggedAnswers tests cover them. |
||
|
|
9621168c46 |
provider: a plugin's thinking model with no variants borrows its maker's reasoning levels
laomao04_65777 on Discord: in Codex, with SenseTime Raccoon (商汤小浣熊) picked, the reasoning effort couldn't be switched. Cause: Raccoon's plugin lists its models as thinking with no variants. Its sn-* ids (sn-glm-5-3, sn-kimi-k3, sn-glm-5-3-flash, sn-deepseek-v4-1-flash, sn-deepseek-v4-pro) are ones models.dev knows under the maker's spelling (catalog.Knows). So levelsUnknown counted them as known and offered nothing, and pluginCatalog borrowed the maker's levels only for moved built-ins and Cline. Codex's catalog got supported_reasoning_levels [] and hid the picker. A custom provider's same id already borrows them (effortsOf), and an id models.dev doesn't know already got low/medium/high ( |
||
|
|
57246b3818 |
usage: a provider's accounts together, and a routing group's (CryptoSarom on X)
CryptoSarom on X (tweet 2116797183207035245, the tray panel's Usage tab):
"能否支持合并用量和额度显示? 有时候更关心某个模型还能用多少 ... 同个供应商
同模型可以合并 ... 或者单个路由组单独显示用量和额度. 有需要关心账号限制
的时候可以进详情再去看".
What it does:
- A Usage card of several accounts has "All N accounts" under its head:
each window the accounts share, one figure and a thin bar, and how
many couldn't be read. The tray panel's group of several has the same
strip above its cards (at most 3 windows). Each account stays below it
as it was: the details are where they were.
- A routing group's row (Routing › groups) has a line for each provider
among its members: "WorkBuddy AI, 4 accounts: Credits 355 / 1,500
credits · 23.7% used · 1 couldn't be read", following Used/Left.
The design, and why:
- Only what reads alike goes together (mergeQuotas). Counted windows of
one name and unit add their amounts and limits, the share is of the
sum; wallets add balances in one unit. A window said only as a share
is the mean over accounts on one plan, whose allowances are the same
size, so the mean is the share of their allowance together; two plans
are never averaged, and a share is never added to a count. Text-only
windows are left out; unlimited only when every account read says so.
- An account whose reading failed is unknown, not 0 or 100: left out of
the figure and counted ("1 couldn't be read"). A window an earlier
reading (asOf) stands in for, past its reset, is left out the same way
and counted in its tooltip. No single reset is claimed for the whole;
the tooltip says when the first of them starts again.
- Only what two or more accounts have goes together: one account's
window is already below it.
- No switch: the strip is additive and quiet (no gradient, no coloured
stripe; the pill grey of the page, the accent bar the cards use), and
it names no account, so Hide accounts holds.
- The code is in quotaall.js, imported when a provider first has two
accounts (quotaAllJS) or a routing group's member has readings, and
each place is drawn again once it is in. app.js has the loader and the
two call sites; three comments in the quota code were cut to keep the
core inside its budget (1,533,096 of 1,533,105), no raise.
Run, at this tree (rebased on origin/main
|
||
|
|
34f51bbbca |
context: the head's agent icon is 14px again, not the agent cards' 20px
The owner: Pi's icon in the context window's head was oversized. context.css had two unscoped `.ctx-who` rules. The later one, for the Context tab's agent cards (20px icon, 8px gap, display flex), overrode the head's 14px one by source order. The card rules are now scoped to `.ctx-who-box`, where both card renderers put their `.ctx-who`. Run on mote, both engines, every language: ctx-route (52), context-window (24), context-scripts (22), routing-ctx-fold (6), routing-context-fold (24), routing-live-patch (10), all pass. These are every GUI file that renders .ctx-who. Broken by hand: with the old context.css, ctx-route's new width check fails with "the agent icon is 14px wide (20)". Not run: the rest of the GUI suite. Nothing outside context.js uses .ctx-who. |
||
|
|
d7b42fcf23 |
usage: a chunk's one-byte numbers are read without Uvarint's loop, and a copying pass keeps its decode buffer (#4372)
A pass over packed chunks decodes every row's ~40 varints, and most are
under 128. binary.Uvarint was 42% of a lent pass's CPU on mote; take
now reads a one-byte number itself. A pass that copies its strings
(visitBlocks, rowsOf, within, the Codex pairs) decoded into a sync.Pool
buffer, which each collection empties, so after one it made the buffer
again and grew it to the largest block. It now decodes into its
rowBuffer's, as a lent pass does; unpackReusing takes the buffer and
whether its strings are lent apart.
Run on mote (M5 Pro), BenchmarkChunkRowsPass, 40 chunks of 3000 rows,
4 runs each, base
|
||
|
|
43d442700c |
usage: a row keeps its zone as an id, so the collector never scans rows (#4737)
A packedRow held its *time.Location, and that one pointer made every
[]packedRow a slice the GC scans word by word: the pages' rows of a
period, the kept decode buffers and every unpacked chunk, hundreds of
thousands of rows on each cycle. #4737's profile has gcDrain at 12% of
the CPU, scanObject 7.65% of it.
A row now keeps its zone as a uint16 into rowZones, a copy-on-write
list read with one atomic load. A zone is known by its String() and
offset, not its pointer: a time parsed with an offset, and a chunk read
from disk, has a new FixedZone each, and 30 parses of +05:30 are one
zone. time.Local is a zone as any other (a test sets it to UTC), so a
row keeps the zone it was written in, as before. Past 65535 zones a new
one's times are kept in UTC: the same instants. unpack looks a chunk's
Locations up once, not once a row. packedRow is 8 bytes smaller, so
TestPackedGatewayRetainsOversizedSnapshot's fixture has 180000 rows to
stay over its 32 MB.
Run on mote (M5 Pro):
- BenchmarkCollectWithRowsHeld, a runtime.GC() with 1M rows held:
4.1-7.9 ms at origin/main
|
||
|
|
1fac66c06d |
usage: a log snapshot read inside its stamp's tick is checked once, when it settles (#4368)
Each request the gateway writes wakes several readers at once: the menu bar, the pages, the Sessions list. They all read inside the change stamp's tick (100ms on a fine clock, 1s on a whole-second one). The read that built the snapshot hashed the whole log after its parse, each later reader in the tick hashed it again, and the first read once it settled hashed it once more. That was four times the log for one request with three readers, the recordHash 3.08s in KaranocaVe's profile. Now a snapshot read inside the tick is not hashed after its parse, and a reader still inside the tick takes it as it is. The first read once the tick settles hashes it and makes it settled, as before, so nothing settled is made of an unchecked read. A snapshot continued from one that never settled still hashes its prefix first, since trusted needs the old one settled. The disk copy is checked against the file when it is loaded, as before. What changes: a same-size rewrite by another program inside the tick reaches readers when the tick settles, up to 100ms or 1s later, not within it. A read a moment earlier would have had the old bytes anyway. TestUsageSameTickRewriteIsNotCached's case with no append and no settle now settles before it checks; its other seven cases are as they were. Run: - TestUsageReadersOfOneAppendHashTheLogOnce (new): an append, three readers in the tick, one after it settles. 1.00x the log hashed per append, 4.00x on the old code (red there). - TestUsageAppendReadHashesNoPreReadScan: 0.80x per append + read, 1.80x before. - go test ./internal/usage: ok on mote (macOS 27.2, 44s) and in WSL magpie-desktop (Ubuntu 24.04, 32s). - GOOS=windows and GOOS=linux go vet ./internal/usage: ok. gofmt: clean. Not tried: the reporter's log size, and a filesystem with whole-second stamps (where the tick is 1s, the same path). |
||
|
|
f823657d7f |
gui: the menu bar sums magpie's total at most once a minute (#4366)
The menu bar is read again whenever an allowance read lands, an account answers or the agent switches account (toldUsage, servedMoved), seconds apart on a busy day. With no cards to show, each read summed today for the tooltip through usage.QueryPage. That read every session file's state (readRequestState), and right after a request it hashed the gateway log too (#4368), then built a Requests page. In KaranocaVe's profile that was 7.2s of CPU in 30s. A total card did the same. trayTotalSum now keeps each period's sum for a minute, for the day it was made on. The tooltip and the cards can lag the Requests tab by up to a minute. A new day is summed at once, and the sum is still the Requests tab's own. Not changed: one sum still costs a QueryPage, now at most once a minute instead of on every wake. A Totals read that builds no page is #4366's other suggestion; this keeps the sum exactly the page's. Run: - TestTrayTotalSummedOnceAMinute: 20 reads 2s apart sum once, 7d is its own, a minute later and past midnight sum again. With the memo taken out by hand it fails: "read 1: summed 2 times". - go test -run TestTray ./internal/gui on mote (macOS 27.2): ok. - GOOS=windows go vet, GOOS=linux -tags nogui go vet: ok. gofmt: clean. Not tried: the reporter's profile after the change. |
||
|
|
e5f66f8a61 |
claude: with the interactive mode on, nothing ever runs as -p; the editor switches TUI and claude -p
The owner (11-01): the interactive mode falling back to -p is dangerous,
for the account (a -p request counts as another client's) and for the
cache (a -p run starts without the interactive mode's), so it goes
entirely. With Settings › Models › Replies' interactive mode on:
- a request it can't take (safeguards, client cache marks, a JSON
schema, an image by URL, words over 400KB, a branch of a -p session,
a WSL Claude Code whose home or transcripts magpie can't reach) is
refused before any Claude Code starts, saying why and naming the
setting (claudeTUIErr), never run as -p;
- a helper that can't start the interactive mode (sign-in asked,
first-run notes, an untrusted folder, no prompt within ReadyWait)
ends saying why (claudetui fail); printMode, OnlyEnv and the
claude-tui-broken mark that sent every run to -p for a day are gone;
- a helper that never answers initialize fails the turn
(tuiNoStart), and the next turn tries again.
Off still runs every request as -p. The "Interactive only" choice of
v0.1.2448 (claudeTUIOnly) is what On is now; the setting is no longer
read or sent.
The Claude Code provider editor's "Claude Code runs as" row is a
switch between Interactive mode (TUI) and claude -p (owner, 11-01),
saving claudePrintMode and reading /api/claude/mode again; disabled in
magpie web. It reads the settings first when the Settings page was
never opened (prefs null crashed the switch; found by the GUI test).
Chromium has no onfocusin property, so the card on keyboard focus
listens for focusin/focusout. Words in en, zh, zh-TW, ja and de.
Docs: claude-subscription-bridge.md describes refusal, not fallback.
Not covered yet, now refused under On rather than run as -p (follow-
ups, each to be done inside the interactive mode): an image by URL, a
JSON schema, safeguards, client cache marks, over 400KB, a -p
session's branch, WSL transcripts Windows can't read. /usage reads
the allowance with claude -p /usage (no model request) either way.
Run (worktree at
|
||
|
|
bd5152ce3b |
sessions: a Codex rollout with nothing to change is only read, never written out again (#4735)
portRollout and repairLineages ran every rollout they looked at through editRollout, which opened a temp file (and a zstd encoder for a packed one) and wrote the whole rollout out before it could know whether any line changed; a rollout with nothing to change was then thrown away. On every pass over ~/.codex/sessions that was a full rewrite per file. editRollout now reads first (eachEditedLine with no writer, which stops at the first line that changes) and only then makes the temp file and the encoder. If the second, writing pass changes nothing the file moved between the reads and is held (errRolloutHeld), as a stat change already was. The edit is built afresh per pass, so per-file state (portRollout's "ours") starts over. Lines are read with ReadSlice into a 64KB buffer; a longer line is gathered whole. The encoder is closed on every early return now; it was left open before. Run on mote (macOS 27.2), 10 rollouts of 4MB each with nothing to change: - plain: 686ms -> 106ms per pass, 46MB -> 0.66MB allocated, 232k -> 120 allocations. - zst: 127ms -> 120ms per pass, 237MB -> 0.67MB allocated; the process's CPU (with the same setup) 2.55s -> 1.43s, sys 0.6s -> 0.17s. - TestPortCodexRolloutsOnlyReadsWhatHasNothingToChange, plain and zst, with a 300KB line: nothing written out and the bytes the same; then with one line to change it is rewritten, the long line kept. With the reading pass taken out by hand it fails: "1 rollouts written out for nothing". - TestPortCodex* and TestPortLine*: ok. - go test ./internal/sessions ./internal/agent: ok (36.7s, 228.9s). - GOOS=windows and GOOS=linux go vet of both: ok. gofmt -l: clean. Not tried: a real ~/.codex/sessions pass in the app; the numbers are the benchmark's, not a sample of the reporter's machine. |
||
|
|
85fcac4a47 |
codexcat: a model with no known window still compacts where the user set
jiangguochao666 on X: "这个软件自动压缩设置之后还是不会启动啊,codex里面压缩还剩<一半的时候报错,只能手动压缩才可以".
Cause: when magpie knows no window for a model (a relay that lists no
context_length, a model models.dev lacks), entriesAt and listedEntry
wrote neither context_window nor auto_compact_token_limit, so Long
conversations' Compact at (and a model's own) was dropped. Codex 0.165's
ModelInfo::auto_compact_token_limit is then None and it never
auto-compacts; on the vendor's context_length_exceeded it calls
set_total_tokens_full, a no-op with no window, and errors, so every
later turn errors again until a manual /compact. Codex shows such a
model on its fallback window, which is why the error comes with "<half"
left.
Now such an entry gets the threshold alone as auto_compact_token_limit
(the model's Compact, else settings.Compact(): Compact at, else 272K;
none under Full window). A relay's own listed entry gets a user-set one
only (the model's, or Compact at), and not when its own context_window
or limit is already at or under it.
Run:
- Real Codex 0.165 on mote, sandbox HOME (~/cxc/h*), a fake relay
refusing past 100K with context_length_exceeded and listing no
window, magpie serve on 47812, `magpie model compact 80k`, 7 turns of
~20K tokens through `codex exec` / `exec resume --last`:
- old build (h2): catalog None/None, 400 at ~119K, every later turn
"Codex ran out of room";
- this build (h4): catalog None/80000, CONTEXT CHECKPOINT COMPACTION
at 80.6K, no 400 in 7 turns.
- control (h1, old build, relay lists 200K): compacted at ~80.5K.
- go test ./... -timeout 45m on mote at
|
||
|
|
dfe868a1eb |
gui: only a Mac page is told it is hidden, and focus tells it it is back (#4293)
On top of pipi-1997's 9704a0901, which is kept as written. Off the Mac the panel is shown again by Wails' ToggleWindow, which never ran showWebview. With hideWebview telling every page it was hidden, an Escape-closed panel on Windows or Linux would have come back with document.hidden true, its polling stopped for good. WebView2 and WebKitGTK mark a hidden window's page hidden themselves, so only the Mac is told now (pageHiddenJSOn), and a page that takes focus marks itself visible whichever path showed it. The page side is the same behaviour in fewer bytes (729 for 1,237), in a try as before. The core scripts are 1,533,802 bytes, over 1,533,073 at origin/main ace58117a; the budget is raised to that, with no room added, and says why. Run on mote (macOS 27.2): - TestClosingWindowMarksPageOutOfSight passes. With hideWebview's signal taken out by hand it fails: "while hidden the page saw hidden=true state=\"hidden\" marked=false play=\"running\"". So on 27.2 WebKit does mark the page hidden by itself; the CSS animations still run, which is what the reporter's sample shows (updateRendering from the RemoteLayerTreeDrawingArea timer). The reporter's 27.0 is not tried here. - TestPageToldHiddenOnTheMacOnly, red with the GOOS check taken out. - go test ./internal/gui: ok except TestMainWindowCorners (#3949) and TestColdTurnsTaken (#4510, reopened with the output); neither touches window visibility. - GOOS=windows go vet ./internal/gui; GOOS=linux -tags nogui vet: ok. - gofmt -l: clean. GUI on WSL magpie-desktop (another session's suite was on mote): the whole suite (make test-ui) ran past its 3500s bound at load ~90 with no result. The eight Routing files it showed red, plus window-visibility, were then run at this head and at origin/main |
||
|
|
f06551c277 |
gui: a closed window's page is told it is out of sight
A macOS orderOut hides the NSWindow but can leave its WKWebView document visible. The Routing page's frame loop and SVG animations therefore kept running in a closed window (20-40% Web Content CPU; reopening and closing returned it to 0%). Tell the page before every app-window hide and again on show. Compose that signal with WebKit's own hidden state, and pause CSS animations while out of sight. Verified with: - go test ./internal/gui -run '^(TestCoreScriptBudget|TestClosingWindowMarksPageOutOfSight|TestClosingHidesShownAccounts|TestPanelCloseHidesIt|TestPanelJoinsFullScreenSpaces)$' -count=1 - node --test internal/gui/tests/window-visibility.test.cjs (Chromium and WebKit) - the new JS test against v0.1.2049's app.js: it times out without the bridge - the new AppKit test with hideMain calling Hide directly: it times out without the visibility signal - go vet ./internal/gui - GOOS=linux CGO_ENABLED=0 go vet -tags nogui ./internal/gui - GOOS=windows CGO_ENABLED=0 go vet ./internal/gui The full GUI package still has unrelated environment failures in TestProxyCheckSaysAProxyPassedBy and TestMainWindowCorners on this macOS 27 setup. |
||
|
|
e42ee3b816 |
library: Magpie Browser's extension sits in ~/Magpie Browser Extension, dragged from the sheet onto chrome://extensions
The owner, on the v0.1.2442 sheet: the extension was written to ~/.config/magpie/browser-extension, a hidden folder no one can find to choose in Load unpacked. - Set up writes it to "Magpie Browser Extension" in the home folder (browserExtDir), where Finder and Explorer show it, and shows it selected in its parent (open -R on the Mac, explorer /select, on Windows, the home folder on Linux) rather than opened, to drag from. - On the Mac the sheet has the folder itself: a press on it that moves hands the folder to the system's drag (POST /api/library/browser/drag, filedrag_darwin.go: beginDraggingSession from the key window with a file URL and the folder's icon, only while the button is still down), so it drops onto chrome://extensions as from Finder. Chromium's extensions page loads a dropped folder as unpacked (drag_and_drop_handler.ts: entry.isDirectory -> loadUnpackedFromDrag), with Developer mode on, which step 2 asks for. - Elsewhere step 3 says to drag the folder from the window that opened, or Load unpacked and choose it. - Old installs: a browser that loaded the hidden folder still does, and that folder is kept up to date as long as it has a manifest; the sheet offers set up again, into the new folder. Run at |
||
|
|
6dc94f57aa |
library: the MCP market offers the registry's 478 most starred servers, and 100 a search
The owner: both markets have too little in them. With nothing searched, the MCP market offered only its 31 featured servers. A search asked the MCP Registry and kept at most 30 of its results. What changed: - market_servers.json is a snapshot of the registry, crawled 2026-11-01: 54,048 latest entries and the GitHub stars of their 27,816 repositories. It keeps the 500 most starred servers that can be installed: an https remote, or an npm/pypi/oci stdio package with no required named argument left blank. At most 3 come from one repository. Smithery's re-hosts, inactive entries and entries with no description are left out. - A name has to belong to the repository it points to. io.github.<owner>/ matches the repository's owner, and a domain name's main label is in the repository's path. That drops name squatters pointing at famous repos (IncorporatedPartners → paperclip, secforge → ChromeDevTools, ai.com.mcp → agentskills). Past that, star order is the only rule. - After the featured servers and their copies, 478 remain. Browsing offers featured, then these by stars: 509 in all. Show more pages them 60 at a time ( |
||
|
|
ace58117af |
gui tests: balance-quota-left and sessions-cache-tokens load with a minute's room (#3193, #2591)
The two test files from the #3193 and #2591 patches (landed in v0.1.2583) set a 5s default timeout on their pages and no navigation timeout of their own. Their page.goto calls therefore had a 5s limit, and nav-timeout.test.cjs failed on main with three entries: balance-quota-left's page and panel, and sessions-cache-tokens' page. Each page now gets setDefaultNavigationTimeout(60000), as #4470 asked. Run on the test Mac at this change on |
||
|
|
77e8535887 |
gui: Busy models last puts its choices under its words in a narrow window
In the app window (not the web page, whose narrow rows wrap already) the six choices of Settings > Network > Busy models last took the whole row at 390px, and squeezed the words beside them to 0px: one word a line, the row 2,379px tall. The whole Settings page grew by that much, and allow-ips.test.cjs's en case went red in both engines (Remove moved the page 3160 -> 3127), first at |
||
|
|
df0320156b |
library: the skill market offers every skill skills.sh lists, 60 at a time
The owner: the Library's markets had too little in them ("这两个市场的
东西都太少了"). The skill market showed at most 60, four a repository.
Now it offers every skill on skills.sh's front page (its 600 most
installed), then each one on its trending page that isn't there, with no
count of installs: trending counts recent installs only, so the card
shows none rather than a wrong one. A repository's first skill comes
before anyone's second, so the first page still isn't one author's, and
nothing is cut. A search asks skills.sh for 200, not 40. The snapshot
magpie ships with has the same 772.
The page shows 60 cards and a "Show more (N left)" button that adds 60
under them; what was shown stays where it is, and skills' about is asked
for the cards shown only. MCP's list pages the same way. Strings in zh,
zh-TW, ja and de.
Run on mote at 0de6f2e57 (origin/main
|
||
|
|
7c712847b7 |
agent: Antigravity's desktop app is a row, wired through its gateway setting (ryougi_hachi on X)
Antigravity (Google's desktop app, 2.15 and later; not Antigravity IDE)
takes a gateway from ~/.antigravity/settings.json: Google's Antigravity
Enterprise Gateway, documented at
docs.cloud.google.com/gemini/enterprise/docs/ai-developer-tools/connect-enterprise-gateway.
magpie writes gateway {enabled, url: magpie's, apiKey: magpie-antigravity,
wireProtocol: openai} and models.defaultModelId, and takes out models.list
(it would narrow the picker). The user's gateway, default model and list
are stashed and put back on disconnect or when a model of their own is
picked; caCertPath and the rest of the file are untouched. Sync keeps what
the user added to magpie's block, and so does a set again (a moved port,
Reconnect). Check speaks when admin_settings.json or AGY_LLM_GATEWAY_URL
wins over the file, and when the block's url or key is no longer magpie's
(wiringOff), so drift and a port move see it. AGY_LLM_GATEWAY_URL joins
agentenv.Vars, cleared in every sandbox. Found by its bundle
(com.google.antigravity, 2.15+) or the file its backend writes
(~/.gemini/antigravity/agyhub_summaries_proto.pb); ~/.antigravity alone is
the IDE's and agy's too. The notices are translated (zh, zh-TW, ja, de).
`magpie antigravity` now names the app; agy stays `magpie agy` /
`antigravity-cli`.
Run (worktree base
|
||
|
|
1d8ded3ec6 |
site: the contributors table keeps to a phone's width
On the deployed page at 390px the table ran past its frame: one long word in some release's line set the second column's width for every row, and docs.css keeps a first column on one line. The table now has fixed columns (11em for names, 8em under 600px) and both cells wrap. Run: the deployed /docs/zh/contributors with this docs.css, in Chromium on mote at 390px dark and 1280px light: the table's own overflow 0 (it scrolled sideways before), the page's 0, screenshots read. node --test site/*.test.mjs 77/77. Not tried: WebKit. |
||
|
|
768228a4f4 |
gui tests: routing-groups-jump's goto keeps its minute (#3478, #4470)
03c631b36 gave the goto { timeout: 15000 }. A goto's own timeout wins
over the page's setDefaultNavigationTimeout(60000), which
|
||
|
|
7e57898eb9 |
test(gui): the routing-groups-jump waits that span a page load get 15s
Under the whole suite's load (the routing files run together, load ~130, concurrency 2), webkit en 480px web once waited past the 5s default for the head button's fit (#3478): the page sizes the button a frame after the head's layout, and a loaded machine serves those first frames late, the fit with them. The file alone in webkit passed 3 of 3 (15/15) right after. The waits that span the page's boot (the goto, the rows it fills, the head and the fit it gets in the first frames) now get 15s; the ones inside a loaded page (the click's jump and its settle) keep the quick 5s. Nothing asserted changes: the fit's value, the tooltip, the jump and where the view settles are read as before. An injected 8s frame starvation (requestAnimationFrame deferred, the way a loaded machine runs it) reproduces the red on the old waits: all 15 webkit cases time out at the fit's wait with the reported wording. With the new budget the injected run passes on both engines, and without the injection the file passes 30/30 in ten runs on Chromium and WebKit. Fixes #3478 Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
f3512114b5 |
gui tests: Built-in's wheel can leave a row's switch under the Plugins head; wheel it clear before the click (#3498)
JoeyWu-tech's follow-up on #3498: wheelTo's own check passed, then the click on Observability's switch timed out, every retry saying the stuck Plugins head takes the click (webkit, 1 of 3 runs, Ubuntu 22.04, Playwright 1.62.1). The wheel's check (`below`) only looks at the list's foot: a last wheel that clamps at the list's end carries the switch past the fold - under the sticky head (`.lib-head pm-head`, position sticky top 0 at the narrow widths, z-index 5) or past the view's top, where elementFromPoint at the switch's centre is the head or nothing. The switch is still visible to Playwright and partly in sight, so it does not scroll, and the app puts back a scroll that is not the reader's (scrollOnPurpose), so the click waits out its timeout. Measured on a copy of the page at 420 (webkit, Playwright 1.57): wheeled to the end the way a clamped wheel lands, the switch sat at -33px with the head at 50-90 - below false, the wheel's check green, the click point on the head or in the void. This machine's engine escapes by scrolling (the app's put-back loses the race), so the red at the click itself needs the reporter's engine; the state is reached deterministically, and seeded, the new check fails before the fix and passes after it, red again with the one-line ablation. outFromUnder wheels back over what shows of the list (the same point the wheel above turns over, 50px a turn, up to 20) until elementFromPoint at the switch's centre is the switch again, then says so, after each of the three wheeled clicks: Observability, Routing and Usage, all one face. wheelTo itself is untouched: its turns and its check are 95a4180c's, left as written. Run: builtins webkit 3 and chromium 2, all green (2 tests each); the seeded state red before, green after, red again with the rescue line ablated; sidebar and gateway-mode webkit and chromium green. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
4006ac7b64 |
gui tests: cli-update waits for the pill's busy state, not 150ms
What changed: the update subtest clicked the pill, slept a fixed 150ms, then read "Updating…" off it. The busy state is what that read wants, and it is painted the frame the click lands (paintCLIButton turns the class and the words on together); under a full GUI run's load the sleep overshot — the fake update (700ms in the fixture) had finished and the pill was gone, so the read sat out its whole 5s on `.row.agent[data-id="codex"] .ag-up` and the subtest went red (#3473, chromium). The test now waits for the pill's busy class instead, so the reads, the svg ring check and the while-busy force click land inside the run whatever the load. The asserts are unchanged. Test-only; no product code touched. Run: node --test internal/gui/tests/cli-update.test.cjs, 10 consecutive runs, 100/100 green (Chromium + WebKit). With the fixture's update delay cut to 100ms (injected, not committed) the old flow failed 3/3 with the reported timeout waiting for that locator and the new one passed 3/3; putting the sleep back with the same injection failed again, the diff then being that one line. agent-update-all (18), agent-app-version (16) and agent-connect (4) still pass, both engines. Fixes #3473 Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
50d5fcaef5 |
gui: Long conversations says its scope — magpie's models only (#3440)
The line said Codex, Claude Code and Grok Build compact at 272K (or the size typed) with no word on which models: the threshold rides the model list magpie serves, so a subscription's own models (the ChatGPT or Claude account's own entries, #674) never see it — they keep their own window and the agent's own compaction. The reporter asked for exactly this in #3440: say the scope in the interface. The line and its four translations (zh, zh-TW, ja, de) now do. No behavior changes — the list magpie serves is what it was. What changed: the sub line of #fullContextRow (index.html) and the matching key and values in i18n.js, all four languages. The key is the English itself, so the key moves with the copy. Rebased onto main |
||
|
|
947377307b |
usage: the Sessions tab's token totals count the cache, as the Overview's do (#2591)
n1majne3 reports the usage totals ignoring the cache reads the same page
shows beside them. The Overview's totals have counted the cache on request
since #2378 (magpie.usageWithCache); the Sessions tab counted tokens in and
out alone wherever they showed: the tokens tile, a session's row in both
lists (the Usage page's and the Sessions page's, sessSpent), the projects
and models bars and pickers (sessSums, spent), the day chart's bars,
tooltips and calendar, and the top sessions. A reader who asked for the
cache on the Overview saw two different totals for the same period.
The tab now reads usageTokens everywhere, so the one pick decides for both
pages. Its tokens tile carries the same label pop-up and says the cache's
count in its line; a pick made there refreshes the tab it is on, not the
Overview. The chart's day and week buckets carry the cache's counts now
that their value reads them, and the top sessions, ranked without the
cache, are ranked again by the count the reader sees. The default stays
without the cache, as #2378 left it; the per-session median and p90 stay
counted in and out (Stats.Overview ranks them), and the Requests tab's
totals always counted every token (allTokens).
Run at
|
||
|
|
434982e5a7 |
usage: balanceMeter and balanceText fit the core's budget (#3193)
89f0bf890 put the core's scripts at 1533435 bytes, 330 over TestCoreScriptBudget's 1533105 (no raise). Its two new comments say the same in fewer words, and balanceText clamps through to100, the helper balanceMeter already uses. No behaviour changes. Run on mote at this head: go test -tags nogui -run Budget ./internal/gui/ ok (red at 89f0bf890, ok at its parent |
||
|
|
63cccbb47c |
usage: a custom provider's balance percent reads as Left or Used, as a window's does
The Left/Used switch turned every subscription window, but a custom provider's balance meter stayed on the used share, its figure and its bar alike (#3193): with balance.path "Daily: windows.0.used / 100%" the card read "Daily 8.9%" with an 8.9% bar while Left showed every window as what is left of it. Windows go through quotaFill/quotaText, which do quotaLeft ? 100 - used : used; the two places that render a balance part handed the percent to balanceMeter and drew the part's figure as the reply had it, and neither reads the switch. A part asked as a percent now reads the way a window does: on Left the figure says what is left of it ("91.1% left", the "{n} left" wording every language already has) and the bar fills with that; on Used the figure and the bar are as the reply had them. The nearly-full colour keeps to the used share, the meter warning either way. A part without a percent (money, counts) is untouched, and the Go side's BalancePart keeps its Text and Percent as they were: the balance line, the tooltip and the history still say the reply's number, and the switch is a rendering choice, so it is made where the windows' own one is. balanceMeter fills with the switched share and colours by the used one; balanceText, beside it, says a percent part's figure. panelBalances and balanceRow, the tray panel's balance card and the Usage page's balance row, put their parts through them. Ran: balance-quota-left.test.cjs, new, on Chromium, en and zh, Left and Used, the Usage page and the panel's Allowances tab. At this fix's parent, red: the Left run waited 5s for "91.1% left" and timed out on the figure the page never showed. At this head, green: the figure, the bar's fill, the nearly-full colour on by the used share in both displays, and a money part's figure and absent meter unchanged. With the fix reverted at the tree the run went red again, and green once more when restored. panel-balance-order, quota-balance-error, balance-parts, panel-usage, routing-quota-left, usage-quota-head and quota-pools, 30 tests, green. go test -tags nogui ./internal/gui: TestProxyCheckSays AProxyPassedBy red, as it is at the parent; the rest of the package ok. gofmt -l clean. go vet ./... and GOOS=linux and GOOS=windows go vet -tags nogui ./... clean (a cgo enum warning in trayimage_darwin.go, at the parent too). go build -tags nogui on darwin, linux/amd64 and windows/amd64 ok. Fixes #3193 Reported by pc418 in #3193. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
b9fc90a940 |
test(pii): a first request's wait waits for the fake pf-serve's start (#3860)
waitFor's 10s bar covers everything up to a first request reaching the stand-in pf-serve, the stand-in's start included. A cold start alone took 6s of it on the reporter's machine (the warm runs 2.7s), so on a loaded machine the start ate the whole bar and the wait died as "a first piece asked: never" - the request was never the slow part. The waits that time a first request now wait for the stand-in's start line first (the way TestStatusAndStopDontWaitForALoad already waits for "pf-serve starting"): the start gets a bar of its own, and the request's bar times only the request. The six first-request waits of the package get it; the second-request and cache-file waits keep their bars, their stand-in is up by then. Fixes #3860 Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
eb9215ad45 |
test(gui): TestDesktopSubagentModelNotice's rerun leak (#3787)
The test saved Desktop's tier pick ("sonnet") last and left it there.
That pick lives in magpie's own folder, $XDG_CONFIG_HOME/magpie
(claude-desktop.tiers.json), which testenv.SetHome doesn't move: it
points HOME and USERPROFILE alone. So the second run of the test read
the first one's tier back, its value said a model of magpie's
(magpieValue), and Wired() came out true before the test had wired
anything — "saving an unwired preference showed notice "" or connected
Desktop". -count=3 failed 2 of 3 on macOS arm64, the reporter's own
platform and command.
The test now points XDG_CONFIG_HOME and XDG_CACHE_HOME at a folder of
its own, as its neighbours do (providers_desktop_test.go, and the
provider package's desktopSubagentHome from the same commit that added
this test): magpie's own files start fresh with everything else.
Fixes #3787
Generated-by: GLM-5.3-Flash (ZCode)
|
||
|
|
3993853079 |
library: an empty GitHub answer is said so, and latestRTK says a cut one (#3045)
Rebase of this issue's patch onto current main, narrowed to what main
still misses:
|
||
|
|
655d23f790 |
library: an MCP server signed in to in Codex itself says so instead of "needs sign-in" (#3508)
A server signed in to with `codex mcp login` was still "needs sign-in"
in the Library. Codex keeps those tokens in its keyring, or in a
.credentials.json of CODEX_HOME when its config's
mcp_oauth_credentials_store is file or the keyring is missing, and the
check read no such file.
It now reads it for each Codex target, beside the config.toml the
target already has, a distro's too (codexCredentialsOf, readCodex in
mcp_agent_signin.go). The file holds an entry per server under the key
codex-rs's compute_store_key makes of its name and a 16 hex of the
hash of its config, each entry naming its server and URL with the
tokens flattened into it (its FallbackTokenEntry, read from codex-rs's
rmcp-client/src/oauth.rs — not the StoredOAuthTokens of the login's
memory the report guessed at). An entry of the server's name and URL
with an access or refresh token names Codex in
ServerHealth.AgentSignIn, and the row says "signed in in Codex"
instead of "needs sign-in". An entry with neither token, one of the
executor's (executor_owned: codex answers no host's lookup with it),
another URL by the same name, and a file that can't be read or parsed
name nobody, so the row stays "needs sign-in". The keyring itself is
never read. A stopped distro has no target and isn't started. The
sign-ins are already part of the check's cache key, and the page names
any agent's id in the row, so mcp_check.go and the GUI needed nothing.
Run:
- TestCheckNamesCodexSignedInItself (internal/library): agent.FakeWSL
forces the Windows+WSL switch (Ubuntu running, its home a temp root),
sandbox HOME/USERPROFILE, CODEX_HOME cleared, a real httptest server
answering 401 with WWW-Authenticate.
- Broken by hand, each red with a FAIL naming the behavior:
- the old behavior (the reader names nobody): codexCredentialsOf
returns "": "signed in in codex@wsl:Ubuntu, the check says
{State:auth ... AgentSignIn:[]}".
- counting an executor's entry: "only the executor's sign-in
counted".
- counting an entry with no token: "a sign-in with no token counted".
- gofmt -l (nothing); go vet on darwin, GOOS=linux -tags nogui and
GOOS=windows for ./internal/library; go build darwin, GOOS=windows
and GOOS=linux -tags nogui ./...; go test -tags nogui -count=1
./internal/library: ok (71s); the two sign-in tests also with -race:
ok.
Codex's file format was read from codex-rs's source (rmcp-client/src/
oauth.rs, oauth/resolved_store.rs, core/src/config/mod.rs).
Not tried: a real `codex mcp login` (no .credentials.json on this
machine, whose Codex keeps its MCP tokens in the keyring, which is
never read); the test's file is built from codex-rs's writer
(save_oauth_tokens_to_file, its FallbackTokenEntry), and the WSL
distro's file is a temp root behind a FakeWSL probe.
Generated-by: GLM-5.3-Flash (ZCode)
|
||
|
|
ec03bca72e |
tests: the search queue's idle client times the state, not the headers (#2547)
TestSearchQueueKeepsCodexAlive/silent went red under load (yetone's
runs at load ~250 and ~330-420, passing alone): pings=0, complete=false
at search_queue_test.go:139. The client's 300ms idle was armed at the
response headers, so the loaded path from headers to the first
translated event counted against the window, cancel cut the stream
before the first ping, and a covered-while-speaking upstream looked
like a covered-forever one.
What changed
- The idle window now starts at the first data line, the same state
line its resets already followed: 300ms still bounds every gap the
stream leaves, the 5s hard cap still ends a stream that never speaks,
and a truly covered-forever upstream still fails the pings>12 check.
- The silent subtest holds the fake queue's first event back 500ms
past the headers, which deterministically reds the old headers-armed
window (pings=0) without any real load.
Run at
|
||
|
|
2f95bd1c65 |
tests: the past-the-budget images budget holds the ten each turn ends with (#3045)
Review follow-up to ggbdpq's 9ac2842a8. Its budget was the last ten shots and half the eleventh, which settles what turn 1 keeps (20 to 29). Turn 2 ends holding 10 to 19, and turn 3's count of 20 rests on those ten fitting the same budget, which the construction didn't promise: it held on these shots by 148 bytes on go1.26.8 and 203 on go1.27.0. The budget is now the larger of the two tens, and the test says so plainly when no budget can hold ten of either and no eleven. Sizes on mote: go1.26.8 fits the shots at 278-282 bytes (20-29: 2807, 10-19: 2799), go1.27.0 at 336-387 (3625, 3613; go1.27.0 downloaded by GOTOOLCHAIN on mote). Run on mote, -tags nogui ./internal/gateway/ -run 'TestCodexFittedImagesPastTheBudget$': - main's test (10*one+one/2), GOTOOLCHAIN=go1.27.0: FAIL "turn 2 made 19 of 30 images, with 10 kept", and turn 3 the same; go1.26.8: ok. - this commit, go1.26.8 and go1.27.0: ok. - budget one byte short: FAIL "turn 2 made 21 of 30"; budget one shot over: FAIL "turn 2 made 19 of 30", turn 3 the same. |
||
|
|
e6b557c018 |
gateway: the past-the-budget images test counts its budget on the shots as they fit
TestCodexFittedImagesPastTheBudget went red standalone on machines whose
Go is 1.27 ("turn 2 made 19 of 30 images, with 10 kept", twice), with no
product change in sight: the test and the byte-budget cache it pins came
together in
|
||
|
|
8a4e32febe |
tests: the overflow memory's compacted and answered cases stay one conversation (#3453)
TestOverflowRefusedOnceIsAskedLast's "compacted" request changed the conversation's only user message. A ruled group keeps a conversation by its first user message (firstWords in the stick key), so that request was another conversation, and passed with behindOverflow's size check taken out. Nothing asked that what a member answered is forgotten. The conversation now has turns after its first user message, and the compacted request keeps that message and drops the rest: the same key, a smaller body. a answers it, and the conversation grown back to the size a once refused begins with a again. Run on mote, -tags nogui ./internal/gateway/: - -run TestOverflowRefusedOnceIsAskedLast: ok. - size check taken out (size >= r.bytes always true): FAIL at overflow_learn_test.go:71 "compacted: ... (a 0, b 1)". - forgetOverflow call taken out: FAIL at :81 "after a answered: ... (a 0, b 1)". - -race -count=20 of this test, TestOverflowMemoryReadWhileNoted and TestRelayInputCapGoesToTheNextMember: ok. |
||
|
|
3af592f587 |
gateway: the overflow memory is read under its lock, so two requests of one conversation don't crash the gateway (#3453)
Review follow-up to ggbdpq's 075aaef62. behindOverflow took the conversation's inner map under overflowLearned's lock, let go, and then read it, while noteOverflow and forgetOverflow write that same map under the lock. Two requests of one conversation at once (a turn beside its title ask, a client's retry) read and wrote one Go map together, which is a fatal "concurrent map read and map write", the whole gateway gone. The loop now runs under the lock. TestOverflowMemoryReadWhileNoted notes and forgets on one goroutine while another orders members by the memory. Before this commit, on mote: go test -tags nogui -race -count=1 -run TestOverflowMemoryReadWhileNoted ./internal/gateway/ -> "--- FAIL: TestOverflowMemoryReadWhileNoted ... race detected during execution of test". With it, -race -count=20 of that test, TestOverflowRefusedOnceIsAskedLast and TestRelayInputCapGoesToTheNextMember: ok. Also: behindOverflow's comment said resting members keep their order; the code moves a refused member behind every other one, resting or not, so the sentence is dropped. gateway-routing.md now describes the memory beside withRoom's overflow paragraph. |
||
|
|
e0a5091b7d |
gateway: a member that refused this conversation as too long is asked last, not first
What changed: an overflow (400, "prompt is too long") is the request's
length, not the account's, so it rests nobody — and left no trace: the
next request of the same conversation tried the member again, failed the
same way, and fell back again, for every request (#3453: a rule sent
every turn to a Claude subscription bridge that answered "Prompt is too
long" and DeepSeek answered; two consecutive requests of one turn each
paid the refused try first). Now the conversation remembers, per
provider's model, how large the request was when it was refused, and the
member is put behind the others — behind, not out: it is still asked
when every other member has failed, a rule that names it is still
heard (ruleOver has run), and what it answers makes magpie forget the
refusal. A request smaller than what was refused — the agent has
compacted the conversation — finds the member where the rule put it.
Another conversation is unaffected, and a byte cap (413) is not
remembered: it is not the conversation too long for the model.
TestRelayInputCapGoesToTheNextMember's second phase shares its server
with the first, whose overflow left this conversation's memory of a's
refusal behind; as that phase says how a plain bad request is classed,
its memory starts empty.
Run: go test -tags nogui -count=1 -run
'TestOverflowRefusedOnceIsAskedLast' ./internal/gateway/ (red on
|
||
|
|
9a4eaab82a |
gateway: a Chat body relayed to Gemini's OpenAI-compatible API goes without Ollama's options (#3097)
What changed: a client that takes the gateway for an Ollama server (its
/api/show is answered in Ollama's shape) sends Ollama's per-request
options beside its Chat fields. The google preset serves a model on
Gemini's OpenAI-compatible endpoint, so such a request is relayed as it
came, and that endpoint reads proto JSON: an unknown name turns the
whole request away with 400 "Invalid JSON payload received. Unknown
name \"options\": Cannot find field", every call, whatever the effort.
A body relayed to a Gemini OpenAI-compatible upstream (geminiCompat)
now goes without the top-level options, whose runner settings have no
place on a Chat API, as the Ollama route's own body builder already
leaves them out (ollamaChatBody). Another vendor's Chat upstream still
gets the body as the client sent it, and translated requests are
unchanged: they are built from the request's own fields, which never
carried options. geminiCompat is worked out once where the thought
signatures ask for it too.
Run: TestGeminiCompatRelayLeavesOutOllamaOptions fails on the old code
with "Ollama's options reached Gemini's OpenAI-compatible API" and
passes with the change; a request to another vendor's Chat upstream
still carries options there. go test ./internal/gateway/ ok (346.6s);
go test ./... -timeout 45m: 66 packages ok, internal/agent TestMothX
and internal/gui TestProxyCheckSaysAProxyPassedBy red, both red with
the change stashed on
|
||
|
|
026d4423d0 |
gateway: a Command Code stream that ends with no finish_reason is a cut (#2471)
What changed: a Chat stream of Command Code's whose reply ends with no finish_reason anywhere - esp32gallery's day had 665 requests, 624 ended with one, and the 20 that didn't were turns its slow starts lost to a killed worker, each a ledger 200 with no stop and no error while the client read "Stream ended without finish_reason" - was taken for a turn that ended as it should, silence in the ledger and a bare half-reply for the agent. Its API joins Gemini's OpenAI-compatible one in saysItsEnd: every whole reply of its says its end, so a stream that stops short of a finish_reason is said as the cut it is, in the stream, the same way a relayed Gemini one is (#1644) - and one still held, with nothing of the reply said yet, fails there for the group's next candidate. Another vendor's Chat stream may still end whole with neither a finish_reason nor [DONE]: nothing changes there. Run: Four new tests, the first two red on cef8c1a4a before the change (the cut passing as a whole reply, the next member never asked): TestCommandCodeRelayEndedShort, a half-reply cut ends with "the reply ended before it was complete", no finish_reason filled in; TestCommandCodeTaillessFailsOver, a held lead-only stream fails 502 for the next member; TestAnotherChatStreamWithoutAFinishReasonStaysAsItCame, another vendor's tailless stream goes as it came; and TestCommandCodeRelayWholeStaysWhole, a finished reply is never given a second end. TestGeminiCompatRelayEndedShort and TestGeminiCompatTranslatedEndedShort green throughout. Not tried: a real Command Code upstream (the frames are the reporter's ledger shapes, the host the one balance.go reads). Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
eb7e72cc7f |
gateway: a response.completed with no output and no tokens fails over (#2471)
What changed: a Responses upstream that ends its 200 stream with a
response.completed carrying no output and counting no token - WorkBuddy
AI's account answered Codex's request with created, in_progress,
completed and `output: []` three times running (MurmuredVelpro) - had
the completed event taken for a reply's end: the held stream went to the
agent as a completed turn, the try stood as a 200 success, and the
group's healthy members were never asked. streamEvent now reads a
completed with an empty output and a zero usage as the no reply it is -
the same shape a translated reply that said nothing and counted nothing
has failed as since #2086 (repliesCounted) - and fails the held try for
the group's next candidate, in the candidate walk as an empty reply's
does: nobody rests, as the reply's shape failed, not the account. A
completed that counted a token stays a reply, as Claude's own empty
end_turn does; and an event this reaches is one nothing was said before,
since the hold lets the first content through and reads no event beside
it, so nothing of the try has reached the agent when it fires.
The fields said are what is read: a completed that names neither field
goes as it came, as the streamEvent table pinned it
(TestStreamEventRefusals, which caught the first draft reading an
omitted output as an empty one), and a completed that counted a token
stays a reply.
Run: TestEmptyCompletedFailsOver (new) red on
|