73ecef0b36cd8a3467eb70fbdd9799ea98db9b7d
8210
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
73ecef0b36 |
memory: each memory is a Markdown file of its own
memory.json held every memory in one JSON file, which grew without
bound, was hard to read or fix by hand, and was rewritten whole on every
change. Memory is now a folder, `memory/` beside where memory.json was:
- `<id>.md` is the memory: YAML front matter (kind, scope, status,
origin, pinned, tags, why, sources, times) and the text as the body.
The file is the source of truth.
- `meta.json` holds what isn't one memory's: projects, the digest,
dismissed texts, deletions, declined suggestions, when a search last
returned each memory (so a search never rewrites a memory's file), and
the hash of each file as magpie last wrote it.
- `index.json` is a cache of the parsed files by size and mtime only:
deleted or garbled, memory reads the same.
- `journal.json` holds a change to more than one file (a merge, a sync)
before any is written; the next read finishes one cut off halfway.
A file whose hash isn't the one magpie wrote was edited or added by hand:
it is the user's (origin user, Edited), so a tidy leaves it and an
agent's change synced from another computer never writes over it. A file
with no front matter is a global fact named by its file. A write leaves
any file that changed on disk since it was read (a hand edit made
meanwhile), and so does a remove. A file that can't be parsed is left
out and never written over nor removed, sync included; meta.json that
can't be read is unknown (an error), as memory.json was.
memory.json is moved in on the first read, all under one journal, and
kept as memory.json.migrated. One that can't be read is an error and
nothing is written.
The scope of a hand-written file keeps its case (a project's holds a
path); "global" in any case is global.
Ran at this head (rebased on origin/main
|
||
|
|
50d88f17ce |
sessions: the Claude subscription bridge's own runs are not local sessions
iwinux on X: a Pi request through a group a Claude subscription serves was listed twice in the request log, once as "Pi · Claude Code" and once as "Claude Code · Local session", with the same tokens and cost. Cause: a bridge run is the real Claude Code. It saves its session in the account's projects folder, in the caller's folder's project: the user's own ~/.claude or a saved account's claude-accounts folder, both of which appdir.ClaudeHomes lists. listCCFiles read it as a session of the user's, and the ledger's pairing (request id, then session and tokens) didn't match it with the gateway's record, whose session is the caller's. So every call was counted twice: request log, usage ledger, cost totals, the Sessions page. -p runs and interactive (TUI) runs alike, plus a branch's cut copy and a replayed transcript. Fix: every session a bridge run saves is named by the new internal/bridgesid. New is a version 4 UUID whose last six bytes are a keyed SHA-256 of its first ten, the key a random file of this computer's (<config>/claude-bridge-session-key, made once by temp file + link). To Anthropic, which Claude Code sends the session id to, it is as random as any, so it marks nothing upstream. startRun passes --session-id for a new run (-p and interactive; the TUI helper keeps a --session-id it is given and makes a marked one otherwise), replaySession and cutSessionWhere name their files with it. listCCFiles leaves out a .jsonl, and a session's sub-agent folder, whose id bridgesid.Is knows, for agent "claude" only. That one listing feeds calls, the ledger, the request log, Sessions, traces and WSL distros, so all of them drop the double count. Other bridged runs (warm-up, askClaude, /usage, WSL -p) use --no-session-persistence and write no session. Rows already counted twice: a bridge session already removed (a run's session is removed when it ends) is gone from the ledger already, as it is read from the files there are. One still on disk under an old random id (a live or shelved run resumed under it, or a stopped gateway's leftover in a caller's folder) can't be told from the user's and stays counted until it is removed; old ids carry no mark to fix it on read. Tests: TestNewIsKnown, TestKeyKept, TestKeyMadeOnce (bridgesid); TestBridgeSessionsAreNotLocal (sessions: a marked session in the user's folder, its sub-agent file, and one in a saved account's folder give no calls and no rows; the user's session beside them counts); TestClaudeRunSessionsAreTheBridges (-p and interactive, a new run and a replayed transcript) and TestClaudeCutSessionIsTheBridges (gateway). Broken by hand, on mica: bridged() returning false made TestBridgeSessionsAreNotLocal red (calls req_m1..m4, want req_m1 alone); newUUID back in startRun, replaySession and cutSessionWhere made both gateway tests red (print, interactive and the cut copy). Run on mica at this head (rebased on |
||
|
|
7ea1e6a4b3 |
usage: the tray panel and the TUI leave out what the Usage page hides
onkashiko on X: a provider whose allowance card was hidden in the main
window (Usage > Overview, "Hide from Overview") still showed in the menu
bar's panel. The panel's Allowances tab had only its own Arrange list
(panelUsageHidden) and read the full cards.
Now the panel leaves out a card whose cardHideKey is in usageCardsHidden
and the rows in usageWindowsHidden (withoutHiddenRows), as Overview does;
a menu bar cell's card still shows (panelPeek). A subscription whose
every card the page hides counts in the foot's "{n} hidden" and shows as
hidden in Arrange; Show there
also drops its keys from usageCardsHidden, since the panel follows the
page. All of it is panelPageCut in the Usage plugin's page.js, which every
window loads, so the core scripts get no bigger (TestCoreScriptBudget
unchanged). Hiding from the panel alone still leaves the page as it is. The
panel reads settings again each time it is shown (loadBack), so a hide or
unhide in the main window reaches it with no restart.
Siblings: magpie tui's Usage page leaves out the same cards and rows
(usageShown, read at every quota read). The menu bar's cells and tooltip
show only the cards picked in Settings, so they keep a hidden card as
before; routing, caps and counting are unchanged.
Run:
- panel-page-hidden.test.cjs (new): chromium + webkit, en/zh/zh-TW/ja/de,
10/10 green; red on the old app.js/panelarrange.js (cards still drawn).
- TestUsagePageLeavesOutWhatTheAppHides (new): green; red on the old
pages.go (balance, account and row still listed).
- GUI: the 128 files that read the panel, Usage or tray code, chromium +
webkit, every language, on mote: 17 files red, rerun alone at
concurrency 1 here 123/449 red and at origin/main
|
||
|
|
667ac8bd6f |
settings: a look at one setting takes the shared settings, not a copy
settings.Load() copies the whole Settings (clone + deepCopy of every map and slice) for each caller. 133 places read one field of it and threw the rest away: the proxy for every outgoing request (netproxy), the GitHub token, the China mirror switch, a model's output cap, wire or price on a gateway request. With a real account in the tray, Load's clone was 26.6 MB of the 318 MB the process allocated in its first seven minutes, most of it through netproxy.For on each request. Each of them now reads settings.Shared(), the read-only settings every caller is given for the same settings.json. Only reads were changed: a scalar field (string, bool, int, float) or a map field's index read. A caller that keeps a whole map or slice, or calls a method on the settings, still takes Load's copy. |
||
|
|
8a59e76165 |
memory: candidates and set-aside memories don't stay forever
memory.json grew from distilled candidates nobody reviewed and from the superseded members of merges, which nothing ever removed. memory.Prune now applies retention on every hourly tick of memdistill.Keep, with distilling and dreaming on or off: - a candidate unchanged for 30 days (memory.Keep) is archived; - an archived or superseded memory unchanged for 30 more is removed, recorded in removed (a sync doesn't bring it back) and, if distilled, dismissed (never proposed again); - what the user wrote or pinned (Fixed) is never archived or removed. Untidy keeps a merged memory when one of its members was removed since: it is all that is left of that member. Run on mote at base |
||
|
|
90ad90646a |
gui: black draws a black dark theme, not Graphite's grey (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS, on v0.1.4124 (tweet 2121468612238266666), with three dark-theme screenshots of Settings > General, one each with Default, Graphite and a custom black picked: 「这三个颜色……都显示是一样的」, 「尤其是黑色始终一直是灰色」. Their screenshots show the same page in all three: ground (25,25,27), card (32,32,34). Why: - v0.1.4124 tints the grounds with the pick's hue only (base + k*(c - mean(c))), lightness kept. Black and Graphite have no hue, so they changed nothing. Default draws no look at all (magpie's own). - accentOn lifts a dark pick toward white only until it reads at 4.5:1, so black's dark ink came out #8a8a8a, next to Graphite's #89898f. What changes (appearance.go): - ground(): on the dark theme, a pick darker than the theme's background darkens every dark ground by as much (depth()). Black draws a black page (#000003), with cards, pills, lines, menus and the tray panel the same steps above it as in app.css (card #08080c, line #18181e). Graphite, and any colour as light as the ground, draw as before. - lifted(): black's ink starts most of the way to white, so it is a light mono ink (#e0e0e0, dark text on its buttons), not Graphite's grey. On the light theme black is #000000, as before. The sibling, white on the light theme, now gets a dark ink instead of a mid grey. - The light theme's grounds keep their lightness: a white pick would melt its white cards into the page. - app.css: a swatch's edge and the chosen ring take a little of the text's ink, so the black swatch stays seen on the black page it draws. - Default stays magpie's own look (grey grounds, indigo accent) for every user. Not changed here. Tests: - TestBlackIsBlack: black's dark page is black and each ground keeps its step; Graphite moves nothing; black's ink is light in dark (>= 1.8:1 from Graphite's) and #000000 in light; white's light ink is dark; text reads >= 7:1 on black's grounds. - appearance-look.test.cjs: "Default, Graphite and black are three looks", light and dark, both engines: three different --accent values; Graphite keeps the grey page; in dark, black's page is black, Settings' list sits on black's card a step above it, its ink is light; in light, black is #000000 ink. - TestLookFixture's fixture gains #000000 and #52525b. Run on mote (mote was unreachable for ~20 minutes; the red check ran on mica), at this commit rebased on origin/main |
||
|
|
fc896a9f6f |
redact: a Bilibili BV id, an av number or a YouTube link's id goes as written, whatever the local model takes it for (jimlee0824v2 on X)
jimlee0824v2 on X: in a script's list of nine Bilibili videos
(bvs = ['BV1f94c6uEr3', …]), five BV ids went to the vendor as
{{SECRET_…}}, and the script the vendor's model wrote back could no
longer fetch them. A BV id (BV1 and nine base58 characters) is a public
video's id, not a secret.
Which finder took them: no rule. With Secrets and Personal on and every
kind on, the rules alone mask none of them (the "by the rules" checks in
TestPublicVideoIDGoesAsWritten). The local model did. Asked for real
(Privacy Filter and AstrLink Guard from mote's ~/evalcache) on the
reporter's script: Privacy Filter took all nine BV ids for secrets,
AstrLink Guard eight, and AstrLink Guard took av170001 for an account
number. That the screenshot shows five of nine is the model's score
around its threshold.
The class: a public video's id that the vendor's model needs as written
to look the video up. Now modelFits takes no span of any kind that is
- a BV id (^BV1[base58]{9}$) or an av number (av and up to 12 digits),
by its own shape;
- a YouTube video's, playlist's or channel's id (10 to 64 of base64url's
characters) only where its link is right before it: watch?v=, list=,
youtu.be/, /shorts/, /embed/, /live/, /channel/ on youtube.com,
youtube-nocookie.com or youtu.be. Eleven base64url characters alone may
be a key's piece, so no shape alone exempts one.
Nothing is keyed on a field's name. The rules are unchanged: a key in a
BV id's shape after its name (api_key=BV1…) is masked still. Numeric
public ids (a Douyin video's, an X status's) were already held back by
the model checks for bare digits (numberNamedSecret, accountCues).
Tests:
- TestPublicVideoIDGoesAsWritten (new): the reporter's nine BV ids in
the tool call's arguments as the screenshot shows them, a bilibili.com
video link, av170001, YouTube watch/youtu.be/shorts/embed/playlist/
channel links; none masked by the rules, nor as secret or
account_number from the model. Still masked: a 12-character secret
(Xq7vR2mK9pLs), BV1 with 0/O/I/l (not base58), a BV id with a 13th
character, a bare 11-character run, the same run after example.com's
watch?v=, a key after a YouTube link's &key=, and api_key=BV1VMnk68E9Q
by the rules.
- TestBVScriptToolCallKeepsIDs (new): the same through MaskJSON as an
OpenAI tool call's arguments.
- TestMaskEval: cases bilibili-bvids (the reporter's script) and
video-links, with both real models' recordings added (only these two
entries; the rest of the recordings were left as committed).
- Broken by hand: the publicID check taken out of modelFits.
TestPublicVideoIDGoesAsWritten FAILs with each of the nine BV ids
masked ('"BV1VMnk68E9Q" as secret: masked in "…'{{SECRET_ekl3f6pv}}'…"'),
av170001 as {{SECRET_…}} and {{ACCOUNT_…}}, the watch?v= id and the
playlist id; TestBVScriptToolCallKeepsIDs FAILs with all nine as
{{SECRET_…}}. Restored: both pass.
Run at 3f862a27c's tree (base
|
||
|
|
1248dc16c7 |
gateway: Gemini's own tools (Google Search, URL context, code execution) reach Gemini (daoche_wuzui on X)
daoche_wuzui (X, v0.1.4095): magpie's Gemini route ignored Gemini's built-in
tools. A generateContent body's googleSearch/urlContext/codeExecution were
dropped in parseGemini, so the model never searched and no
groundingMetadata came back.
- ir.Request carries GoogleTools. parseGemini keeps googleSearch (and
google_search_retrieval), urlContext and codeExecution; chat's tools
read them in both shapes ({"googleSearch":{}} and {"type":"url_context"}).
- buildCodeAssistSent, shared by Code Assist, AI Studio, Vertex and plugins
spoken to on Code Assist, sends them when no function is declared
(Google refuses built-ins beside functionDeclarations), Gemini models only.
- A plugin whose API is googleapis.com (Antigravity) now searches itself
for Anthropic web_search, like the built-in Gemini accounts.
- The Gemini reply carries groundingMetadata (chunks + webSearchQueries),
streamed and not; executableCode/codeExecutionResult parts are read
as text instead of being lost.
Run:
- mote-run at 3dc1f13ed (before rebasing onto 27 newer commits):
go test -tags nogui ./internal/gateway ./internal/provider ok (916s, 139s);
go vet both; GOOS=windows go vet ./... ok; GOOS=linux go vet -tags nogui
./... ok; gofmt -l clean.
- At 80f1e05a3 (the rebase after it only took agent, claude and davsync commits): go vet and GOOS=windows go vet of gateway and provider ok; go test -run "Gemini|CodeAssist|Search|Google|Antigravity|AIStudio|Vertex|Chat|Plugin" ./internal/gateway ok (83s); go test ./internal/provider ok (136s).
- Broken by hand, each red: googleToolsFor, googlePlugin, the reply's
grounding, the ranCode decode, chatGoogleTool.
- Real account, sandbox HOME (Antigravity plugin, gemini-3.8-flash-low),
the plugin patched in the sandbox to log what magpie sent it:
- generateContent with googleSearch+urlContext+codeExecution: the three
tools reached the plugin, the reply had groundingMetadata (3 chunks,
webSearchQueries).
- streamGenerateContent: groundingMetadata in the stream.
- /v1/chat/completions with {"googleSearch":{}},{"type":"url_context"}:
both reached the plugin, a grounded answer came back.
- /v1/messages web_search_20250305: googleSearch sent, the reply had
server_tool_use + web_search_tool_result.
Not tried: an AI Studio key or Vertex account (unit tests only); the
Gemini CLI account (Google refuses individual Code Assist now); real
code-execution parts (Antigravity's model wrote code as text); whether
Antigravity honours urlContext (a fetch gave the same stale page with and
without it). Anthropic web_fetch is not mapped to urlContext. The full
./... suite is queued behind six runs on mote's suite.lock and had not
run when this was pushed.
|
||
|
|
6cc70b2b3c |
agent: deskCatalog cleans an absolute /-spelled path too (#4785)
Dopetaiga's 3751d6cb3 made ownCatalog clean an absolute catalog path, so a /-spelled one names magpie's list on Windows. deskCatalog, the same predicate for the Codex app's list, still joined dir onto an absolute path and never matched one. With the app gone, Sync left model_catalog_json naming a list it had removed. It now has the same shape; the WSL spelling keeps its branch. Run on Windows 11 (xiaomi-gpu, win-run, -tags nogui): TestCodexSyncMendsGoneCatalog, TestCodexDesktopListSlashSpelled (new), TestCodexOwnCatalogGoneNotPutBack and TestCodexDesktopList.* are ok at this tree. With main's codex.go, not_the_provider and the new test are red. With 3751d6cb3's codex.go (ownCatalog fixed, deskCatalog not), only the new test is red. On macOS the bug is not visible (/ is the native spelling there). Batch record (ggbdpq's five patches #3254 #3356 #4258 #6391 #4785 and the two follow-ups), on mica through suite.lock: - At 8c58d9b0b (base |
||
|
|
f62e93b8aa |
agent: Claude's Unwire gives up the stashed model in every case (#4258)
The #4258 patch kept the model in the stash until the write that puts it back or takes magpie's out has gone through. When neither write runs (the stash kept one of magpie's models and the user has picked their own since), the model stayed stashed after the Unwire. Before the patch, unroute's unstash always took it out. It is now forgotten after the switch in every case that returns nil, which is main's behaviour with #4258's ordering. Run (mica, at this tree): TestClaudeDisconnectLeavesNoModelStashed is ok here and ok at main's claude.go, codex.go and stash.go. With 46b365337's claude.go alone it is red ("the stash still holds a model after the Unwire: relay/glm-4.6"). TestDisconnectFailureKeepsStashedOriginals is ok. gofmt -l clean; go vet of internal/{provider,davsync,agent} on darwin, GOOS=windows and GOOS=linux is ok. Not changed: the other agents' restore paths, filed as #6601. |
||
|
|
f12a1f79d8 |
agent: ownCatalog cleans an absolute /-spelled catalog path on Windows (#4785)
A config.toml naming the catalog with an absolute /-spelled path was not recognised as magpie's own: the raw string matched neither the base-name ref nor the \ spelling, so Sync left the key in and Codex could not load its config once the list was gone. Clean the absolute path too; on Windows that turns its slashes into the native ones. The WSL spelling keeps its own branch. |
||
|
|
8cd8cf31bc |
claude: a saved account's directory sign-in older than the saved one is not taken over it (#6391)
A spare handed to Claude Code comes back from the switch signed out when its own config directory was made again meanwhile (#4750): the directory keeps the sign-in from before the hand-over, Claude Code refreshes its own copy while it serves on the account, and the switch back saves that as the account's. The next run on the account then took the directory's older sign-in over the fresh saved one — takeClaudeDir takes whatever tokens differ — so the spent copy replaced the fresh one in logins.json, the refresh in the directory was refused and emptied, and every request on the account failed till it is signed in again. The directory's sign-in is now left to the saved one when it is older (the later expiresAt is the newer, as the imports' newer-wins, #4532): has=false has claudeSavedDir make the directory from the saved sign-in again, so the account comes back usable whichever way the directory came to hold an older copy. What was there is cleared first, so an older keychain item cannot shadow the fresh file on a Mac. Run (-tags nogui, GOCACHE private, parent |
||
|
|
1dbd3bb07c |
agent: a Disconnect whose restore write fails leaves the originals stashed
skygunner (#4258): Claude and Codex unroute took the stashed originals
out of the stash before the config write that puts them back, so a write
that failed (a full disk, a file a watcher held) lost them for good, and
a retry had nothing to put back. The same shape was in Claude's
putClouds, and the model's original was taken out before the write that
restores or replaces it, which comes after unroute.
The originals are read with peek and taken out by forgetValues only once
the write has gone through, each only while it is still the value peeked:
one a concurrent change wrote since stays stashed. The model stays stashed
for the caller: Unwire takes it out after its write, and picking a model
of the agent's own after it.
A file that doesn't parse is copied aside before it is written over, as
it was (lastgood.KeepUnparsed); a change reports nothing new. The same
take-out-before-put-back shape in the other agents' restore paths (agy,
antigravity, cline, claudedesktop, astrbot) is left as it is.
Run (worktree at base
|
||
|
|
4082f6d00e |
davsync: a part re-enabled on a state with no Off mark joins again
kupakupar (#3356): re-enabling the library (or an agent's models) on a
computer that synced with the part left out sent that computer's older
content up over the server's newer one. What #6428 fixed for states
since it writes — a part left out is marked in Off, and one synced again
joins like a first sync — did not reach the states older magpies wrote:
they carry no Off mark, so the join saw a real hash against the
nothing-hash the last sync left and took it as a change here, against a
server it had already seen.
A part that syncs now, whose baseline is the nothing-hash a left-out
part carries and that holds something of its own here, joins again the
same way: each side's own counts as changed there, the newer stays. A
state since #6428 already names such parts in Off and takes the old
path; a first sync has no baseline to compare and is the join already.
Run (worktree at base
|
||
|
|
284b221727 |
claude: a forget waits for runs in the account's directory (#3254)
switchSavedLogin waits on the run marks another magpie's process leaves beside a saved account's directory (#4532), but ForgetLogin removed the directory with no look at them: another process's run in it (a /usage, a warm-up, a keep-alive) had its directory taken from under it, and the switch ForgetLogin does first handed nothing over — the removed account's run may still refresh its sign-in there. ForgetLogin (claude) now takes the account's in-process run mutex and waits on every other process's run mark up to claudeRunWait, refusing with errClaudeRunning past it, before it switches away or removes anything: nothing is removed under a run, and the saved sign-in stays. Left: forgetClaudeDir's two other callers keep their shape — a fresh sign-in's replacement of an older saved directory (signin.go) rebuilds one at once, and the switch hand-over's removal runs behind switchSavedLogin's own wait. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
aba6aeac22 |
lessons: the third raise landed by 13:00, not 11:00
Docs only; no code run. |
||
|
|
2a8e77f99d |
lessons: 11-14 a third core budget raise (27c998aba)
Docs only; no code run. |
||
|
|
015860f2da |
provider: the balance history is parsed once while the file is unchanged
Every usage read (the tray's, the panel's, a minute apart at most while something asks) gave each balance its trend by reading and parsing all of balance-history.json, 365 KB on the owner's real accounts, and sharedBalanceHist parsed it a second time. It showed as 6% of an idle tray's CPU profile, all of it encoding/json. balanceHistShared now reads it through filememo, kept while the file's size and time are the same (and, written just now, its bytes). readBalanceHist, for the two callers that change and write it (noteBalanceHistory's new points, fold's moved keys), is a copy of that with each key's points its own, so nothing changes the shared parse. The trends and shareBalances only read, and use the shared one. Run (mote): go vet ./internal/provider; go test -run 'Balance|Fold|Unread|Quota|Shared' ./internal/provider ok (writes and reads within one second among them). |
||
|
|
8f4ef16ea3 |
gui: a tray logo is masked once, when the cells come, not on every draw
mpCells kept each provider logo as the NSImage decoded from its file, and mpDraw masked it again (a 128x128 bitmap drawn, scanned twice and cut) every time the menu bar image was drawn: each show, each appearance change, each frame of the bird's flap. Drawing the source also left its full-size decode cached in the NSImage for as long as the cells were up, which vmmap showed as 4.6 MB of CG image on a tray with a few large PNG logos. mpGlyph now does the mask once per logo in mpCells and keeps only the cropped mask (copied out of the 128x128 bitmap, so that goes too) and whether it is a solid tile. The decoded logo is released at once. mpMasked only fits and tints the kept mask. Run (mote): - go vet ./internal/gui; go test -run 'Tray|Image|Cell' ./internal/gui ok (TestTrayImageMonoLogos, TestTrayImageLogoSizes among them). - Pixel identity: every logo in assets/icons (213), light and dark, at scale 1 and 2, rendered through trayImagePNG with the old and the new code: 852 of 852 PNGs byte-identical (a throwaway test, not committed). |
||
|
|
27c998aba0 |
usage: the tray panel's and Requests' costs follow each provider's currency
onkashiko on X: with Currency set to By provider, the menu bar panel still showed every cost in one currency; providers and models were not each in their own. drawLedColumns and drawLedRank (shared by the tray panel and the window's Requests tab) formatted every value with no provider, so fmtCost fell back to the Totals in currency. - usageapi.Ledger echoes the provider a page is filtered to (`provider`, omitempty). - app.js: ledProv(l, split, id) names the provider of a value: the ledger's filter, the row's provider (provider split), the provider part of a modelAt id, or for a model split the provider(s) that served it when they all share a currency. ledFormat/ledFormatLong take it, so the rank's values and sub-lines, the tooltip's rows and the axis (when one provider is picked) are in that provider's currency. Sums (the panel total, the tooltip total, a model served in two currencies) stay in the Totals in currency. - page.js: the Requests head and the cost head use the filter's provider; the heatmap tip too. Other fmtCost calls are sums or sessions with no provider and are unchanged. - core script budget +491 (1,269,040 -> 1,269,531): drawLedColumns and drawLedRank are drawn by the panel, so there is no lazy page to move this to; packed to the shortest form. - docs/subsystems/gui-shell.md says how By provider reaches the panel. Run: - At 065fb6a8b (rebased on |
||
|
|
7d5475769b |
gui: the page's files are typed from magpie's own table, not the system's
Handler registered the page's five types with mime.AddExtensionType. The first call makes the mime package read and parse the system's whole type table (/etc/apache2/mime.types on macOS, ~18,000 allocations) and keep it: ~2 MB of an idle tray magpie's live heap (pprof inuse_space on a real-account tray run on mote). http.ServeContent asks the same table for any file whose Content-Type isn't set. Now assetTypes names every type the page's own files, plugin pages' files and provider icons are served as. servedAs sets it before ServeContent looks at the name, so neither the registration nor ServeContent reads the system table. The system's table (Windows' registry, which another program may change) still never decides how the page's files are read. |
||
|
|
15d4acbadf |
lessons: 11-14 a second core budget raise (dc85a7ca5)
Docs only; no code run. |
||
|
|
6ad734802e |
plugin sign-in: a login page that carries the sign-in page in its address can be finished from a pasted address (plugins#1090)
CodeArts' international browser sign-in opens Huawei Cloud's login page
with the authorize page, port and all, in service=. loopbackPorts read
only the page's own query, found no port, and the sign-in offered no
paste box. On magpie running on a server (yfishyon on plugins#1090) the
browser ended on 127.0.0.1:<port>/oauth/callback and nothing could finish
it, while the mainland sign-in (port= in its own query) could be pasted.
loopbackPorts now also reads a web address in the query one page deep.
A redirect to a non-loopback https page (ZCode's) still names no port.
Run: TestLoopbackPorts has the international and mainland shapes; the
international one is red on the old code ("" want "37093"). go vet and
go test -tags nogui -count=1 ./internal/provider pass on mica. Not tried:
a real international sign-in pasted from another machine.
|
||
|
|
c51b0ca9fa |
sessions: the Antigravity app connected to WSL has its usage read from the distro (@guyng35955 on X)
@guyng35955 on X: on Windows, with the Antigravity app connected to a
WSL Ubuntu, magpie showed no Antigravity usage.
Why. Antigravity 2.x (dist/wsl.js and languageServer.js in its
app.asar) runs a Linux language server in the distro when it is
connected to WSL ($HOME/.antigravity-server/bin/<version>/
language_server, started through wsl.exe with --app_data_dir
antigravity), so the conversations go to the distro's
~/.gemini/antigravity, not %USERPROFILE%\.gemini\antigravity. magpie
read Antigravity's conversations only from this computer's folder:
- sessions.wslAgents had no antigravity (nor agy, whose
~/.gemini/antigravity-cli in a distro wasn't read either);
- internal/agent kept a distro for the Sessions page only when one of
wslKinds or the Copilot CLI's folder was there, so a distro with only
the app's data never reached sessions.WSLHomes;
- and, found on the Windows box: no SQLite database under
\\wsl.localhost opens in place. Every form (file: URI, plain path,
mode=ro, provider.OpenReadOnly) answers SQLITE_BUSY after its 3s
busy_timeout, since the share doesn't take the locks a WAL database
needs. So listing the files alone would have shown nothing still.
What changed.
- agent: wslKept keeps a distro with ~/.gemini/antigravity(-insiders),
and the probe looks for them (no agent row for them).
- sessions: wslAgents reads the app's conversations (insiders under
their own key) and agy's in a distro; their summary rows name the
distro's folders as Linux does (agyFolder with goos "linux", so
/home/me/site, not a Windows path). The distro's calls count in
Calls (wslFiles("antigravity"), wslCallFiles("agy")). The listing
kept on disk (sessions-wsl.json) carries each file's row, rev and
read-only, so a stopped distro keeps its titles and folders. A
distro's ~/.gemini that is this computer's own (a link) is read once,
as this computer's (sameDir).
- sessions: openAppStore opens agy's and the app's databases read only
in place, or, under \\wsl.localhost or \\wsl$, as OpenUntouched does
(immutable with no -wal, else from a copy of the db and its -wal).
- docs/subsystems/agent-wiring.md says which distros are kept for reads
only.
Not changed: session-read consent ("allow selected" names agents found
on this computer) doesn't look in WSL, as before for every WSL agent.
OpenCode's and ZCode's SQLite readers aren't used for a distro (not in
wslAgents), so they keep provider.OpenReadOnly.
Run (at the tree rebased on dc85a7ca5; then rebased on
|
||
|
|
c8290df259 |
provider: Devin's Adaptive and Fusion picks are no longer served
The live gateway's /v1/models listed devin/Adaptive and devin/adaptive, and Devin answered both with 502 "no API providers are available". They came from magpie, not the plugin: the plugin's list (and its cached copy in plugin-providers.json) has neither, since parseFamilies and parseConfigFamilies skip Adaptive and Fusion. The owner's providers.json keeps "Adaptive" and "adaptive" in the devin entry's picks (models), saved when the built-in still listed Devin's router families, before |
||
|
|
74c94b5db0 |
gui: a picked accent tints the theme's grounds (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked, on 0.1.4112 and again on 0.1.4116 ("依然没变,是不是
出bug了"), for the dark theme to follow the colour they picked. v0.1.4114
(
|
||
|
|
e36541ddf2 |
site: llms-full.txt names AIGoCode with the other preset relays
|
||
|
|
dc85a7ca59 |
providers: AIGoCode is a preset that takes a key (MindfulReturn on X)
MindfulReturn on X asked why magpie's plugins have no AIGoCode sign-in
and whether they have to add the provider by hand. AIGoCode has no
sign-in to plug in: it hands out API keys, each bound to one group. So
the answer is a preset, like 鱼鱼连线's, not a plugin: Add provider ›
AIGoCode asks only for the key.
From AIGoCode's own docs (www.aigocode.net/docs/api, openai-compatible,
anthropic-compatible, responses): one root, https://api.aigocode.dev,
with Chat Completions and Responses at /v1 and Messages at the root.
It runs on sub2api ("Model ... is not available for this group",
API_KEY_REQUIRED from /v1/models and /v1/usage, /api/v1/settings/public
answers), so a key's balance is read at sub2api's /v1/usage by the
relay probe already there; no BalanceURL is needed. A key spends its
plan (Pro/Max/Ultra) and then its balance, so its billing is unsaid,
like MiniMax's Coding Plan keys. Website is the invite AIGoCode
sponsors magpie with (site/sponsors.js has the same one); it is not
badged Sponsored, as 鱼鱼连线 isn't. Keys page: /dashboard/keys.
- presets.go: the aigocode preset (KindRelay, icon aigocode).
- billing.go: aigocode in unsaidPresets.
- icons/aigocode.png and pngIcons: AIGoCode's own logo
(www.aigocode.net/images/algocode-logo.png), trimmed to 124 in 128.
- core_budget_test.go: +12 for the name in pngIcons; main was at the
budget to the byte, and the list is read wherever an icon draws.
- site docs (en, zh, ja): import's preset ids and relay's preset list.
Not wired: AIGoCode's Gemini-native endpoint (PresetDef has no Gemini
field). A key serves only its group's models, so a third-party
("可外接") group such as Claude API(AWS) or ChatGPT API(Azure) is
the one to use. If AIGoCode later takes the in-app seat, its partner
entry needs an id other than aigocode (checkPartner).
Tests: TestAIGoCodePresetTakesAKey: kind, key, endpoints as documented,
keys page, balance probed at api.aigocode.dev, billing unsaid. Broken
by hand: without aigocode in unsaidPresets it is red (billing "payg").
Run on mote (mica and mote both over their cores, so no full suite;
CI runs it), at origin/main
|
||
|
|
b005d1a473 |
update: a fresh install of Stable's version stays on Stable (fishmagic80 on X)
The site now offers Stable's downloads, but the app's Update channel is Every version until changed, so a Stable install was offered the newest at its first check. Before that check, a fresh install (no version run before and magpie's folder new, from whatsNew.start) asks the feed for Stable's version and the newest; when it is Stable's and a newer one is out, settings take "updateChannel": "stable" (settings.TakeStable, under the file lock, keeping a channel already set). A feed that can't be read is unknown and asked again at the next check. A version that is both Stable's and the newest stays on Every version: its download can't be told apart. update.LatestStable never falls back to GitHub. docs/reference.md and the privacy pages (en, zh, ja, llms-full.txt) say a fresh install asks ?channel=stable once. Old installs: nothing changes for them. Until a release with this becomes Stable, a Stable download (0.1.3078 today) is still offered the newest unless Settings → Update channel is set to Stable. Run at 936c70756, on mote: gofmt -l internal/ clean; go vet (darwin), GOOS=linux and GOOS=windows go vet of internal/gui, update, settings ok; go test -count=1 ./internal/update ./internal/settings ./internal/gui ok (gui 99.9s). TestFreshStableInstallStaysOnStable goes red (2 subtests) with the takeStable call removed (broken by hand, on mica). llms-full.txt regenerated and current. Not run: the full go test ./... (mote and mica each had several suites queued on the lock); not tried with a real Stable install. |
||
|
|
60ad579979 |
site: show Stable's version and offer its downloads (fishmagic80 on X)
fishmagic80 asked on X for the site to show the Stable channel's version
and download it directly. The home page now asks /api/latest and
/api/latest?channel=stable together. When Stable is known and isn't the
newest, the hero's version line adds "· Stable <v>", and a quiet
two-button control over the platform cards switches every download link
between the newest (/download/<platform>) and Stable
(/download/stable/<platform>). #stable opens the page on Stable. While
Stable is unknown, or is the newest, the page is as before.
The worker serves /download/stable/<platform or file> from Stable's
release (the same stableOf ledger as ?channel=stable) and answers 503,
not the newest, while Stable is unknown. The download event's link
property gets a "stable/" prefix; no new property is sent.
Words in en, zh, ja, de, matching the app's (稳定版, 安定版, Stabil).
Run at 936c70756 (rebased on origin/main
|
||
|
|
24effac0ec |
gui: the tray keeps the words it asked for, not a language's whole table
The tray tooltip says each usage window's name and unit the way the Usage page does, from i18n.js's table. pageWords kept the language's whole parsed table for good: ~2 MB of an idle tray magpie's live heap (pprof inuse_space, real-account tray run on mote), for the dozen words a card asks for. Now pageWord keeps only the words asked for (capped at 512). A new word parses the table once, and the table is kept a minute for the other new words of the same card, then let go on the next ask. A word asked before is answered without parsing again. |
||
|
|
7b002b6be8 |
library: an MCP command's %USERPROFILE%, $USERPROFILE and ~\ are the home on every system (0xBCD18E on X)
0xBCD18E's Library server ran
"%USERPROFILE%\AppData\Local\Programs\Pinky\pinky.exe", and the check
said it couldn't find "%USERPROFILE%\A…": magpie read $NAME, ${NAME}
and ~ in a command but not cmd.exe's %NAME%, so the only way to share
one server across computers with different user names was a per-device
command.
Now HOME and USERPROFILE are both the home, on every system, as $NAME,
${NAME} or %NAME% (either case), and a leading ~ or ~\ too:
- library.json (and so sync and backups) keeps them as written;
- an agent that reads references in a command (Claude Code, CodeBuddy,
WorkBuddy, Grok, Gemini, omp/Qoder/AtomCode, OpenCode, Cursor) is
given the home's own variable where it runs: ${USERPROFILE} on
Windows, where an agent seldom has HOME, ${HOME} on a Mac, Linux and
in WSL, where nothing has USERPROFILE. Before this, $HOME went to
Claude Code on Windows as ${HOME}, which it usually hasn't;
- every other agent (Codex, Kiro, Droid, Copilot, Crush, Goose, Pi, ...)
and magpie's own start (the check, the router, Codex through the
gateway) get the home's path;
- any other %NAME% (%APPDATA%) is a variable on Windows only, and is
left as written elsewhere, so 100% or %Y% in an arg stays as it is;
- a command's environment: a leading ~ and %USERPROFILE% / %HOME% in a
value are put in as the home for every agent and for magpie's start
(homeEnv); ${NAME} there stays envref's.
No cwd: a Library server has none.
Tests: TestCmdVarsUserProfile forces cmdOS to windows, darwin and linux
for Codex, Claude, Cursor, OpenCode and Claude in WSL, command, args
and env; TestCmdVarsUserProfileLaunch starts a real server by
%USERPROFILE%<sep>prog, %HOME%/prog and $USERPROFILE/prog.
TestCmdVarsPerAgent pins the Unix variable; TestCmdVarsSync expects
${USERPROFILE} in .claude.json on Windows.
Run: the red was checked on origin/main e0889719c's cmdvars.go,
mcp_check.go and mcp_run.go with these tests: all 8 subtests of
TestCmdVarsUserProfile and TestCmdVarsUserProfileLaunch FAIL; with the
change, ok on mote (darwin), on xiaomi-gpu (Windows 11, win-run: the
real check starts the server by %USERPROFILE%\prog, and Claude Code's
.claude.json gets ${USERPROFILE}/bin/x) and in WSL magpie-desktop
(wsl-run). Full suite at b84b6dc3c (this change on
|
||
|
|
8df4239a8b |
lessons: 11-14 core budget raised again for one line (c5b40bf89)
Docs only; no code run. |
||
|
|
a4937f8ff9 |
gateway: the effort tests' fake upstream answers only the turns
TestEffortUpdateRefused went red on macOS CI at
|
||
|
|
6d8fcb93a7 |
memdistill: switched off, the background read asks no model
Keep called auto() before Run looked at the switch. auto is
gateway.AutoVision, which ranks every provider's models and loads the
whole models.dev catalog: 3.6 MB of a tray-only magpie's live heap
with real accounts, for a run that read nothing, five minutes after
start and every hour after. Memory reading is off by default.
Keep now reads distill.json first and skips the round when it is off;
a file it can't read goes on to Run as before, which reports it.
Run: go test ./internal/memdistill on mote, ok.
Broken by hand: skipping the check turns TestKeepOffAsksNoModel red
("switched off, it asked for a model"); the test then switches it on
and waits for the ask, so it can't pass on a loop that never runs.
|
||
|
|
6333ee5586 |
filememo: a parse unread for five minutes is let go
filememo kept every parse for the life of the process. What start up reads once, RenameLegacy's look at every agent's config (a 1 MB YAML look, a 600 KB JSON), stayed in a tray-only magpie's live heap: ~2 MB of its 12.8 MB with real accounts. A read sweeps when idleFor (5 minutes) has gone by since the last sweep, dropping the parses not read since. What a poll reads (the tray's every 3 minutes, the window's every 15 seconds) stays; a parse goes 5 to 10 minutes after its last read, and the next read parses it again. Swept on a read, not a timer, since a timer armed inside a test's synctest bubble is the bubble's. Run: go test ./internal/filememo on mote, ok. Broken by hand: never deleting turns TestUnreadParseLetGo red. |
||
|
|
b76016676f |
provider: Gemini's and Antigravity's offered models are kept per stamp, so the tray's usage read lets the catalog go
visibleQuotas built exposedIDs("gemini", "antigravity") on every usage
read, and each build loaded the whole models.dev catalog through
knownElsewhere → catalog.ListedBy. The tray reads usage every few
minutes, so a tray-only magpie with real accounts kept 5.6 MB of
catalog (of a 12.8 MB live heap) that loadIdle never got to drop.
keptExposedIDs keeps the answer while provider.StampNow is the same
(no provider, account, setting, plugin or catalog change) and for 30
minutes at most, for what a stamp can't see.
Run: go test -run 'ExposedIDs|Quota' ./internal/provider on mote, ok.
Broken by hand: always building turns TestKeptExposedIDsBuiltOncePerChange
red ("built 5 more times while nothing changed").
|
||
|
|
90932ed1fa |
gateway: Claude Code's model discovery is shown every model by an id it keeps
Claude Code's Gateway Model Discovery (CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY)
puts in /model only the ids matching /(claude|anthropic)/i: Tvi in the
2.1.316 bundle, te.data.data.filter((se)=>/(claude|anthropic)/i.test(se.id)),
on GET <ANTHROPIC_BASE_URL>/v1/models?limit=1000 with User-Agent
claude-code/<version> (Xs(), not claude-cli/) and anthropic-version:
2023-06-01. A remote magpie's Kimi, GLM and DeepSeek never showed (zent00
on X, tweet 2121440002244747428).
That request alone (claudeCodeDiscovers: the User-Agent and the header,
never another magpie) is now shown a chat model whose id says neither by
Claude Desktop's alias anthropic/magpie-<n> (aliasFor), which unprefixed
already serves as the model for every client, before any provider's
model of that spelling; no Claude id is spelled so. Its display_name is
the agents' list name, which /model shows. Ids Claude Code keeps, names a
gateway key gives models, and every other client's list are unchanged; a
bare-id row it wouldn't keep is left out (its full id's row is there).
"anthropic/<magpie id>" was not used: a provider named anthropic (the
Anthropic preset's id) serves any model asked by that spelling. Zero
config, so no switch.
Run:
- TestClaudeCodeDiscoveryKeepsEveryModel, on mote: red on the old
gateway.go ("not shown anthropic/magpie-9301644634 for auto/kimi-k3"),
green with the change; with the anthropic-version check broken by hand
it fails on the claude-cli/ client. TestCindyDiscovery and the Desktop
tests green.
- Real Claude Code 2.1.316 binary on mote, sandbox HOME, against the
gateway with a fake Anthropic upstream: its cache gateway-models.json
held {"id":"anthropic/magpie-4484984192","display_name":"DeepSeek V4 ·
DeepSeek"}; `claude -p --model anthropic/magpie-4484984192` answered
PONG and the upstream was asked model deepseek-v4. Claude Code warns it
assumes a 200k window for an id it doesn't know, as for any non-Claude
id.
- gofmt -l: clean. Package vets/builds and go test ./internal/gateway
started on mote; the full suite (go vet, GOOS=linux/windows vet,
builds, go test -tags nogui -timeout 45m ./...) is queued under
mote's suite.lock and runs after the push, per the ship-at-once rule;
its reds get their own commits.
Not tried: interactive /model screen (the rows come from that cache
file), a real remote magpie over LAN with a gateway key.
|
||
|
|
c5b40bf898 |
claude-desktop: after Use Claude Magpie the lit row is Claude Magpie, and its Code tab's row says it is on magpie (xMopf7RF on X)
xMopf7RF on X, 0.1.4111: clicking Use Claude Magpie seemed to connect their own Claude Desktop, and left "Claude Code · Claude Magpie" saying "Not connected · uses its own settings" with its switch off. The wiring was right: with the Separate app on, connecting claude-desktop writes only Claude-Magpie-3p's config (desktopSets), and the user's own Desktop is left alone. The page said otherwise twice: - the row that turned on was still named Claude Desktop. While the Separate app is on, state() now names the claude-desktop row Claude Magpie (desktopiso.Name), since that is the only config it wires. - the claude#magpie-desktop row is not wired itself, and need not be: Desktop's Code tab runs Claude Code with CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST, so its requests go through Claude Magpie whatever that folder's settings.json says. While Claude Magpie is on magpie, the row carries twinCode (agent.DesktopTwinCode) and its line, lit, says "On magpie through Claude Magpie" (en, zh, zh-TW, ja, de). The core script budget goes up 67 for that one connectLine line, cut to the shortest words that say it; the Agents rows draw it, so there is no page to move it to. docs/subsystems/agent-wiring.md says both. Tests: - TestClaudeMagpieCodeTabRowIsOnThroughIt (agent): DesktopTwinCode only for claude#magpie-desktop, only while Claude Magpie is on magpie. - TestClaudeMagpieRowsAfterUseClaudeMagpie (gui): sandbox HOME, POST connect after turning the Separate app on: the wired row is named Claude Magpie, the Code tab row has twinCode, the user's own Desktop config is unchanged and no Claude-3p folder is made. - desktop-twin-code.test.cjs: clicks Use Claude Magpie; no lit row is named Claude Desktop, the Code tab row's line is lit and fits, the click doesn't scroll; en/zh/zh-TW/ja/de, 1100 and 640 wide, Chromium and WebKit. Run (mica; mote's load was over its cores), at |
||
|
|
b325718f0a |
antigravity: turned-away lines go reworded, not broken up; Antigravity min 0.1.12 (#1118)
Since 11-14 Google's check reads past invisible characters. A system prompt with Claude Code's billing line and Agent SDK line, broken up with two U+200B in every word as the cloak sent them, was turned away 5 of 5 with the bare 429 "Resource has been exhausted". Claude Desktop's Code tab through magpie to Antigravity failed every turn (hc295971796 on X, tweet 2121429628019781849), and on v0.1.4110 with the Antigravity Cloak plugin Antigravity hit 429 very often (daoche_wuzui, tweet 2121432333769433178). The built-in cloak (codeassist.go) now rewords each line Google turns away, in plain words: - the x-anthropic-billing-header line is left out to its line's end; a system part or message holding only it is dropped; - "built on Anthropic's Claude Agent SDK" -> "built on the Claude Agent SDK by Anthropic"; - Codex's "based on GPT-5" -> "built on GPT-5"; - Hermes' "created by Nous Research" -> "built by Nous Research"; - omp's RFC "keywords" -> "key words". A copy an older magpie or middleware broke up (U+200B, U+2060, soft hyphen, inside or between words) is matched and reworded as the line. The Code tab's main line passes as written and is kept. The plugins repo's packages carry the same rewording (plugins 5bb41941: opencode-antigravity-auth 0.1.12, opencode-agy-cli-auth 0.1.41, middleware-antigravity-cloak 0.1.7 on the dist branch). The Antigravity mover's min goes to 0.1.12, the version dist has (these packages are not on npm); the cloak middleware is Official and updates itself. Run: - real Antigravity account, sandbox HOME, gemini-3.8-flash, 10 sequential requests each through the new plugin: Code tab main prompt as Claude Desktop sends it 10/10 200, Agent SDK subagent line 10/10, an old two-U+200B copy 10/10, Codex GPT-5 10/10, Hermes' earlier persona 10/10, omp's RFC line 10/10. The zero-width break went 0/5. - mote-run: gofmt -l; go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet of internal/gateway, provider, cli; go test -count=1 -timeout 45m ./internal/gateway/ ./internal/provider/ ./internal/cli/ ./internal/middleware/: all ok (gateway 926s); vet clean, gofmt clean. Broken by hand: codeassist.go from origin/main with these tests: 6 fail (TestAntigravityCloakClaudeCode2316, ...RewordsEveryLineItTurnsAway, ...AnswersHermesAndCodexByDefault, TestOnlyAntigravityIsSentThePrompt Reworded, ...LineWrappedOrWidened, ...TurnsCodexsGPT5ThreadAwayOnce). Not tried: models other than gemini-3.8-flash; the whole go test ./... (only the four packages this touches); Claude Desktop itself (its Code tab's system prompt was captured and replayed instead). |
||
|
|
71a806749d |
sessions: a paginated Codex rollout moves to a longer provider id by its row (@xMopf7RF on X)
@xMopf7RF on X (tweet 2121441393424113800): the Sessions page's Move refused an old Codex session with "rollout-2026-03-09T09-25-….jsonl.zst keeps its history by byte, and "magpie" is longer than the provider it names: Codex couldn't open it moved", and offered nothing else. Since |
||
|
|
a83fe23252 |
gui: a picked accent tints the chosen thumb too (CHENGJIAHEGOXIS on X)
「强调色是按照颜色走的,但是主题深色依然还是灰色」 and 「就是我截图的原来的 灰色,还是没变化」: after |
||
|
|
e0889719c8 |
gateway: a Responses WebSocket turn streams without the HTTP stream field (#5291)
OpenAI's WebSocket mode doesn't use the HTTP stream field: a
response.create leaves it out and is streamed all the same. magpie made
each frame into the HTTP body its route would have had and kept the
field as the frame said it, so a client that left it out (M4n5ter on X,
AnacondaKC's Niko in #5291) got the provider's reply unstreamed and
every frame of it at the end. Codex sends stream:true itself, so it
never showed there.
turn now sets stream:true on every generating turn, whatever the frame
says (left out or false). It is the one place the three socket routes
(/v1/responses, /responses and Codex's backend route) make their body,
so all three are covered; a warmup (generate false) still answers
locally before it, and HTTP POSTs are unchanged.
Ported from AnacondaKC's patch in #5291 (62e3fd1ad), with these
differences: the test runs on /v1/responses and /responses, with stream
left out and with stream:false, checks the body sent upstream, and
TestCodexSocketStreamsWithoutStreamField covers Codex's route.
Tests: TestResponsesSocketStreamsWithoutStreamField and
TestCodexSocketStreamsWithoutStreamField, both red with responses_ws.go
at origin/main
|
||
|
|
8ed2ae030c |
claudetui: an image goes into the interactive mode on Windows 10 as a long paste, not -p (ok123now on X, #5061)
ok123now (magpie v0.1.3901, Windows 10 LTSC 21H2, Claude Code 2.1.316,
Claude Desktop): text worked, one 64x64 PNG was a 502 every try, and the
client asked again without end.
Cause: the helper pastes an image as its file's path in bracketed-paste
marks. Windows 10's conhost (10.0.19041) drops the marks on the way in
(the reporter's lead; #5061 and #5205 measured it on 19044 and 19045),
so Claude Code got the path as typed words, the helper waited out
pasteWait and exited 1, and the gateway answered 502.
Fix:
- claudetui: Claude Code reads its console as VT input (mode 0x208, read
from a real claude.exe 2.1.316) and takes one read of over 800
characters as a paste with or without the marks ($X=800 in 2.1.316,
q6=800 in 2.1.281), a path with spaces after it as the image alone. On
Windows the path is sent padded with spaces to 900 characters, no
marks: over 800, and under the 1024-byte blocks the same conhost loses
of a longer write (#5205). Elsewhere it stays bracketed.
- If the interactive mode still doesn't take a message (an image, or a
block it can't paste), the helper ends the turn with an error result
beginning claudetui.Unpastable instead of exiting, the gateway asks it
once as claude -p with the image itself, and remembers that for 12
hours. A redo that can't run is a 400, not a 502, so no client loops.
- The reporter asked to keep images interactive: -p counts at about
twice the plan quota and has none of the interactive run's cache. The
-p reason (Routing chip, all four locales, and the log line) says so.
Run, at this head (rebased on
|
||
|
|
925bc7188b |
usage: the Requests card's up arrow opens what the bytes sent upstream were made of
theforeveriris (X, 2121408745616162998) saw 8169 requests send 8.6 GB up and 1.0 GB down and wanted to know why. About 1 MB a request is normal: every request sends the whole conversation again, with the system prompt and the tools' definitions. This shows it. Gateway: promptOf, which already parses the body off the request path, now also counts the bytes of the system prompt, the tool definitions and images in the body it read. upParts scales those to the wire bytes and puts them on Record.UpParts. Nothing new runs on the request path, and a body that isn't parsed stays "Not measured". Usage: a packed row keeps the mix in 255ths under flag rowUpParts (32768); the row stays 152 bytes. Totals gain up_calls, up_measured, up_system, up_tools and up_images, and Shares carry up_bytes and up_calls by agent and by model. settledCountVersion goes 4 -> 5, so settled days are counted again once on the next start. GUI (Usage -> Requests): the "↑ 8.6 GB" on the Requests card is a button that opens a "Sent upstream" card: the average per request, one sentence on why, a bar and legend for Conversation / Tool definitions / System prompt / Images / Not measured, and the top 8 agents and models with bytes sent and per request. The open state is kept; × closes it. A request's details get a "Made of" line. zh, zh-TW, ja, de strings. Entrance is 200ms ease-out, no movement under reduced motion. Run (mote, at this head on |
||
|
|
27e43ed26c |
LESSONS: 11-14, a budget guard left out before a push, a red fixed twice, a clock read twice
From the loop review of |
||
|
|
d6cb404754 |
gateway: the live reasoning fixture allows the time its first event really took
TestLiveVisibleReasoningFixture set start to now minus the event's at_ms and then called see, which reads the clock again. Any time between the two lands in the measured start, so on macOS CI (run 43530452364, |
||
|
|
14f0046e7d |
agent: Pi's offered thinking levels are kept per stamp, as the model lists are
v0.1.4108 kept the drift poll's "is this value magpie's" answers. After it, real accounts on mote (acgui6, w75, the window open) showed the poll's cost had moved into Pi's Values: piOffered on every Drift, every 15s. Each call walked the agent's model list and built the model's whole models.json entry, which reads settings again under GroupHasNative. That was 23 MB of the window's three minutes. piOffered is now kept per agent and model in a stampedLists, as sharedModels is: built again when provider.StampNow moves, or a minute after it was. Its callers (Pi-like Values, their effort options, Aside) only read it. Run: TestPiOfferedKeptPerStamp (new), TestThinkingWithoutLevels* and the Pi tests on mica. Broken by hand (the kept entry dropped on every call): red, "built again while nothing changed". Suite on mica at this commit: gofmt clean; go vet internal/agent for darwin, linux and windows; go test ./internal/agent ok (281.1s). |
||
|
|
f1f34d624f |
gui: a model's key tag is drawn from keyrates.js, back under the core budget
|
||
|
|
8ce32d7008 |
agent: the window's drift poll remembers which values are magpie's per stamp
/api/drift runs every agent's Drift every 15s while the window is up. Each Drift asked every field's whole option list whether a value is one of magpie's, and the model lists under them are built again once a minute. With real accounts on mote (acgui6, w74), that was 27 MB of the 50 MB magpie allocated in three minutes with the window open. DriftShown, which only /api/drift calls, keeps magpieValueIn's answer per agent, field, value and settings while provider.StampNow stays the same, 5 minutes at most. Drift is unchanged for Reapply, rewiring, a launch and /api/state, which act on the answer. A provider resting or a model retired by its date is something the stamp can't see. The window's drift row now shows that within 5 minutes, not 1. Run: TestDriftShownAsksAValueOncePerStamp and the Drift tests on mica. Broken by hand (the memo never hit): red, "five polls built the options 5 times, want 1". Suite on mica at |