Commit Graph
6066 Commits
Author SHA1 Message Date
yetone 01d4489a28 routing: the trace says what a classifier answered when no rule matched
95cf9d86d (ggbdpq, #4598) records a classifier's answer as it said it
(classified.said), even when no intent came of it. The Routing page
still showed every such turn as "said none". Geidorf's report was about
that page: a turn routed with "no rule matched" and nothing saying why.
When a decision model names a choice that no rule's intent came of
(its own "none of these", or a kind under the sure-enough bar), the
trace now says "answered “…”, which is no rule's intent". A chat
model's 0 is none and still says so. The new words are in zh, zh-TW,
ja and de.

Run (mote, at this commit's tree, chromium and webkit):
routing-classifier-said (new), routing-intent-fallback,
routing-smart-intent and i18n-keys: 104 of 104 pass.
Broken by hand: with the answer not read (answered = ""), the new file
is red in 20 of 30: every "answered" case in both engines, five
languages and two widths. The "0 still says none" cases stay green.
Not tried: the real app with a real decision model's answer; the rest
of the GUI suite (text only, no layout or API change).
2026-11-02 05:38:11 +08:00
yetone 06faf449af gateway: a relayed Responses stream's sequence numbers keep counting up
257b9ad49 (ggbdpq, #4743) makes a relayed Responses reply's text calls
into function_call items. It held the message's done events while it
read the text and numbered the events it made on from the last number
the upstream sent. The held done events then went out after the calls
with their older numbers, and the completed event kept its number,
below the calls' numbers. A client that orders a stream by
sequence_number saw the stream go back.

Everything the relay sends now goes through numbered(). An event whose
number is at or below the last one sent goes out as one past it, and an
event already past it keeps its number, so a stream nothing was made
in is sent as it came. This also removes responsesToolNames, which
nothing called: the wiring reads the names with chatToolNames.

Run (mote, at bfa911da8 on origin/main d89f03aa9): go test -tags nogui
-timeout 45m ./internal/gateway: every test passes but
TestCodexPoolSaysTheClientsVersion, the open #4807 (another test's
Codex identity reaches it; it passes alone, and is red the same way in
a full gateway run at d89f03aa9 alone). The new TestResponsesTextCallsNumberOn
(the reported text, cut into 37-byte writes) and the
TestInvokeReported* tests pass. Also library, provider, agent,
netproxy, davsync and cli ok; gofmt -l empty; go vet with GOOS=linux
and windows ok.
Broken by hand: on 257b9ad49's textcalls_relay.go,
TestResponsesTextCallsNumberOn is red: "event 13 (response.completed)
numbered 53 after 57". Without numbered() it is red too: "event 9
(response.output_item.added) numbered 0 after 52".
Not tried: a real Responses upstream; Codex with a stream renumbered
this way.
2026-11-02 05:38:11 +08:00
yetone 50be0751ff library: a skill lock entry doesn't take over a folder of the user's own
51be9afb0 (ggbdpq, #4645) lets a skill the skills CLI installed be
updated from where ~/.agents/.skill-lock.json says it came from. The
lock is matched by name and by the folder's write time, and lockOrigin
asked nothing about the skill's own source. A skill the user installed
from a folder of their own, under a name the lock also has (grill-me
from their own skills folder and a lock entry for mattpocock/skills),
showed GitHub as its origin, and an update replaced it with the
repository's copy.

lockOrigin now follows lockRepo's grouping rule: it is the origin only
of a skill with no source, or one whose folder is in ~/.agents/skills.

Run (mote, at this commit's tree): go test -tags nogui ./internal/library
ok, with TestSkillLockOriginUpdates, TestSkillLockOriginStale and the
new TestSkillLockOriginLeavesUsersFolder.
Broken by hand: without the guard, TestSkillLockOriginLeavesUsersFolder
is red: "origin https://github.com/mattpocock/skills" and, after the
update, the source is the GitHub tree, not the user's folder.
Not tried: the skills CLI itself; the lock is written by hand in the test.
2026-11-02 05:38:11 +08:00
yetone 50d9add249 netproxy: the global proxy's move is read from the shared settings
5a26a6af4 (ggbdpq, #4523) checks on every request whether the global
proxy changed, through settings.Load(), which reads and parses
settings.json each time. Every other per-request read of the settings
goes through settings.Shared(), which parses again only when the file
changed, so this one does too.

Run (mote, at this commit's tree): go test -tags nogui ./internal/netproxy
ok; TestGlobalSwitchDropsTheOldProxyConnections passes with Shared, so a
switch written to settings.json is still seen on the next request.
Broken by hand: none for this line itself (it changes cost, not
behaviour); the patch's own test goes red with the move check off
("1 connections through A, 0 through B").
Not tried: a real proxy switch in the app.
2026-11-02 05:38:11 +08:00
ggbdpq 20f27f5148 fix(gateway): a relayed Responses or Gemini reply's text is read for the calls written into it (#4743)
What changed
- textcalls_relay.go: responsesTextCalls reads a Responses reply relayed as
  it came — a Codex turn to a provider that speaks Responses itself. Text
  from where a call is written into it is held from output_text.delta on;
  the part's output_text.done, content_part.done and the message item's
  output_item.done wait with it; at response.completed the held calls
  become function_call items (added, arguments deltas, done) and the
  completed output says them too. A reply that came whole is read over its
  output's message items.
- geminiTextCalls does the same over candidates[].content.parts: text
  parts held or trimmed as the chunks come, the held calls functionCall
  parts at the candidate's finishReason; a whole generateContent reply
  (Vertex AI) the same. A reply that made calls itself (native) goes as
  textCallTidy lets a Chat one: only tags left in its text go.
- gateway.go: both wired into the relay funnel beside textCallTidy and
  anthropicTextCalls; geminiToolNames reads a Gemini request's
  functionDeclarations.

Run
- go test ./internal/gateway/ -run TestInvokeReported -count=1: the two new
  passthrough cases red before, green after; the package's full run green.
2026-11-02 05:38:11 +08:00
ggbdpq c57ac416d3 fix(library): MCP writes to Claude Code's .claude.json take its save lock (#4747)
What changed: the Library gave Claude Code its MCP servers by reading
~/.claude.json (or $CLAUDE_CONFIG_DIR's) and writing it back with no
lock held, while Claude Code saves the same file often (project state,
tips, usage counters) under a lock of its own, <the file's real
path>.lock: a save of its own between the Library's read and write was
lost. The lock helpers move out of internal/provider into a small
claudelock package (the mkdir lock Claude Code 2.1.316 takes, stale
after 10s for this file), putClaudeLogin keeps its #4532 behavior
through wrappers, and the Library's mcpFile.putEntry and mcpFile.del
take <file>.lock around the .claude.json read-modify-write: they wait
while Claude Code holds it, take over one left stale, and fail the
server's write with nothing changed when it holds one past 20s. A WSL
distro's copy is left as it was: the Claude Code there saves under a
lock in the distro's own files.

Run (mote, -tags nogui):
- TestClaudeJSONMCPWaitsForClaudeCodesLock and
  TestClaudeJSONMCPTakesAStaleLock (internal/library): red on the old
  code (saved while Claude Code held the lock; a stale lock left
  behind), green now.
- go test ./internal/library ./internal/provider -tags nogui: both
  packages green, the #4532 lock tests among them (TestClaudeSwitch…
  refresh/legacy/config, stale takeover, held past the wait).
- race on the lock tests of both packages; go vet on the three touched
  packages for darwin, linux and windows; gofmt clean; go build -tags
  nogui for darwin, linux and windows.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:11 +08:00
ggbdpq a4c74a059e fix(gateway): Copilot's Gemini takes Codex's disjoint unions as oneOf, its Grok the custom tools as functions (#4374)
What changed: Codex Desktop through Copilot failed on every tool-bearing
turn, on two wires at once (#4374). The Gemini models, served on chat
completions alone, answered 400 "invalid request body" to a turn whose
whole content was "hi" — the tool schemas' anyOf of object branches is
what Copilot's Gemini rejects, as #3931's comparisons showed (the same
request with the unions as oneOf came back 200). A union whose branches
are provably disjoint now goes as oneOf, renamed in place: both branches
require a string field whose enum or const values never meet, or one
requires a field the other forbids through additionalProperties: false.
A union that can't be proved stays an anyOf, Copilot's other models are
untouched.

Grok 4.7, served on /responses, answered 422 "422 Unprocessable Entity:
Unprocessable Entity" six requests in a row: xAI behind Copilot takes no
custom tool (#3392), and Copilot's answer in front of Grok says no more
than the status (#378), so the refusal-learner that serves the vendors
whose answer names them (#2656) has nothing to read. A Codex turn with a
custom tool to a Grok model on Copilot is translated from the first ask,
as a learned refusal does elsewhere.

Run (go test -tags nogui ./internal/gateway):

- TestCopilotGeminiTakesCodexUnionsAsOneOf: a fake Copilot refusing a
  tool schema with an anyOf, word for word as #4374's Gemini record, is
  answered; the union goes out as oneOf
- TestCopilotGeminiKeepsUnprovenUnions: a union no one can prove stays
  an anyOf and the refusal still reaches the client
- TestCopilotGrokTakesCustomToolsAsFunctions: a fake Copilot whose Grok
  refuses a custom tool with #2951's bare 422 is answered; apply_patch
  goes as a function, GPT on the same /responses keeps it as it came
- RED on the parent commit: the first and third fail with the refusals
  named above; the second holds before and after — it guards that only
  what is provable is renamed

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:11 +08:00
ggbdpq e02bc8c49b fix(agent/codex): keep the user's model_provider over a takeover or reset (#4347)
What changed: the beside wiring of a Codex takeover took the top-level
model_provider down silently whenever a magpie model was picked beside
the ChatGPT sign-in — a provider of the user's (CC Switch's custom, an
older takeover's) went with it, and every Codex thread saved with that
provider stopped resuming (modelProviderMismatch: Codex falls back to
its built-in openai, the threads name the provider they were started
on, #4347). The wiring now steps beside only from a provider magpie
puts back itself (its own, none, CC Switch's mirror of OpenAI, as Join
already has it); over a provider of the user's the takeover names
magpie instead and keeps the user's spelling in the stash, for Unwire
to put back, as any takeover does. A reset leaves the line where the
user put it too: it takes magpie's keys out, not theirs.

Run: go test -tags nogui -run 'TestCodexTakeoverKeepsUserProvider|TestCodexResetKeepsUserProvider' ./internal/agent/ (both fail on the parent, pass here); go test -tags nogui ./internal/agent/ passes.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:11 +08:00
ggbdpq 0639fdd8f9 fix(gateway): a Grok key relay's compaction-blob refusal now strips the sealed reasoning and asks again (#4412)
What changed: foreignReasoning — the words that mark a vendor's refusal
of sealed reasoning it cannot read, and put the conversation on the
asked-again-without-it path (strip, retry, and the seal left out of
later turns up front) — gains one alternative for xAI's "Could not
decode the compaction blob. Ensure it is unmodified from the compact
response." A key relay that proxies Grok (an opencode-go-style member,
no account, any base URL) hands back exactly that for the reasoning
item Codex writes with "content": null beside its encrypted_content,
and until now the 400 went to the client after a single try: the
#3392 shaping (xaiBody's null-content removal) never runs on such a
relay because its host is not api.x.ai, and the refusal named no item
and nothing of encrypted content, so foreignReasoning passed it by.
The wording anchors on "could not decode/decrypt ... compaction blob",
so a refusal at fault some other way still is not taken for one.

Run: go test ./internal/gateway/ -run 'TestForeignSealGrokRelayCompactionBlob|TestForeignReasoningWords' -tags nogui (both fail on the parent, pass here; the ablation — reverting internal/gateway/affinity.go alone — turns both red again); go test ./internal/gateway/ -tags nogui; gofmt clean on both files; go vet -tags nogui on internal/gateway for darwin, linux and windows; go build -tags nogui for all three.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:11 +08:00
ggbdpq 6803d7d51c fix(library): update skills the skills CLI installed from where its lock says (#4645)
What changed:
A skill installed with the skills CLI (npx skills add) and brought in
or handed over kept only a From label in library.json, so
`magpie library skill update` said it "isn't from GitHub or a git
repository" and the check for updates skipped it. The lock that named
its repository for grouping now names it for updating too: lockOrigin
(the lock entry's sourceType is github, the lock says when it wrote
the folder, and the folder is the one it wrote, madeBy) is asked where
CC Switch's record is, in updatable and prepare. Updated that way, the
skill carries the source in library.json from then on, as one
installed from GitHub does. A lock entry that says no time, or a
folder the CLI didn't write, only groups, and stays as it is.

Run:
go test ./internal/library/ -run 'TestSkillLockOrigin' -count=1 -v
go test ./internal/library/ -count=1 -tags nogui

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:11 +08:00
ggbdpq f73b780422 gateway: a group's trace says what its classifier said, as it said it (#4598)
What changed: Classified keeps the classifier's answer as it said it
(said): the number a chat model answered with, 0 for none, or the choice
a decision model named, "none of these" included. readIntent gives the
number back, readJev keeps the choice, and the trace's rule.classified
carries the said on. An answer that named no rule's intent — a chat
classifier's 0, a decision model's own none-of-the-kinds option, a kind
named under the sure-enough bar — all read "said none" in the trace
before, so a group's fallback kind ("not any of the above") that never
matched looked the same as an answer no rule could take.

The matching itself is as it was: a classifier that answers the
fallback kind's number still routes by that rule, which a test now
holds (it passes unchanged); the said is only what the trace tells.

Run: go test -tags nogui ./internal/gateway (pass; without the change
TestClassifiedSaysTheClassifiersAnswer fails "the classifier said 0,
the trace says \"\"" and TestClassifiedSaysWhatJevChose fails "Jev
chose \"none of these\", the trace says \"\""); gofmt -l prints
nothing; go vet and GOOS=linux/windows go vet on the package pass;
go build on darwin, linux (-tags nogui) and windows pass.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
ggbdpq 49c99e18d1 provider: quota history draws measured windows set aside for routing (#4612)
chowyuan1314: the Cursor plugin marks its Weekly window aside when
on-demand or free credit can pay, and Grok Bot always — using them up
doesn't stop the account, so routing sets them behind — and both carry a
real percentage. pointOf refused every window set aside that wasn't a
pool's, so quota-history.json took no point for them and the card had no
curve, while the same account's Codex windows drew theirs. The aside
check predates the pools' (#651); the pools' own exception (14e4d8040)
freed only the row the card shows, not every measured window.

Aside is for routing, not history: what a window says is drawn
independently of whether using it up stops the account. pointOf now
refuses only what has no share to tell — a window whose text alone is
told (Text), an unlimited one, a family's, an unnamed one, a NaN — so a
pool's window needs no exception of its own and every measured aside
window keeps its line: the Cursor plugin's Weekly and Grok Bot, Copilot's
completions, a Factory account's windows read while it may spend extra.

Factory's "Extra usage" row, a balance in cents, told no share either and
stayed out only because it was aside; it is Text now, its display alone —
as Claude's row of the same name already is (claudeOveragesWindow).
Without it, the new condition would have drawn it as a fictitious 100%
left.

Routing reads Aside where it did; nothing is set aside that wasn't.

Run (at d1a94f579 + this change, macOS arm64):
- TestQuotaHistoryKeepsAsideReadings and TestFactoryExtraUsageIsTextAlone
  (new) fail before and pass after; TestQuotaHistoryKeepsAntigravityPools
  now also expects the aside "Extra" window's line, the new rule's own
  doing.
- go test ./internal/provider -tags nogui -count=1: ok.
- gofmt -l clean; go vet ./internal/provider, GOOS=linux and
  GOOS=windows (nogui) clean; builds darwin, linux, windows ok.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
ggbdpq dd809ea60f gateway: an input item's id longer than the 64 an upstream that checks ids takes goes shorter, as its kind's prefix and the sha256 of the whole of it (#4525, #4527)
Codex carries every id an earlier turn came back with, and Copilot
gives its items ids hundreds of characters long: 420 as isnine's
sessions each showed (#4525), 444 as ghjkllasdf-fake's approval
session and its guardian review did (#4527), all of the characters
OpenAI takes an id of. plainItemIDs checked the characters only, so
every later turn went to Copilot as it came and was turned away
400 "Invalid 'input[N].id': string too long. Expected a string with
maximum length 64, but got a string with length 420 instead." — the
conversation stuck, a tool call never answered, Codex's automatic
approval review failing over it.

An id longer than the 64 goes as its kind's prefix ("msg_", "rs_")
and the sha256 of the whole of it, cut to fit: the same id to the
same shorter one every turn, and no two ids land on one, where a
plain cut could (ids of a vendor can begin alike). Copilot's own
reasoning, overlong but of the right characters, keeps its place
with its seal — an upstream that checks ids made that one, its
encrypted_content is its to read, unlike another vendor's, which
still goes as it did. A call's call_id was bound already
(BoundCallID); one shorter than 65 goes as it came.

What changed

- gateway: itemIDCap (64) and boundItemID, and plainItemIDs bounds
  an input item's id at them, on every relay that checks ids as
  OpenAI does — Copilot's /responses among them (validatesItemIDs)
- tests: an id checker that turns an overlong id away word for word
  as isnine got it; Codex's turn over a Copilot conversation of
  overlong ids asked twice, the same bound each turn; the 64/65
  boundary, determinism, idempotence, two ids that begin alike going
  to two; the parity harness holding plainItemIDs to it beside what
  it was

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
ggbdpq cb35d2fa94 fix(netproxy): a switch of the global proxy drops the old proxy's idle connections (#4523)
What changed
- Dispatch now remembers the proxy setting each request left under and,
  when it moves, closes the idle connections it kept (base's and every
  provider clone's), so the request after a switch dials through the
  proxy in force. A transport pools by target host, and its HTTP/2
  connections by the authority alone, so until now a Test after the
  switch rode the old proxy's connection and left by the old exit while
  the new proxy was the one shown.

Run
- go test ./internal/netproxy/ -run TestGlobalSwitchDropsTheOldProxyConnections
  fails on the parent (1 connection through A, 0 through B after the
  switch), passes here; the package's full suite passes (-tags nogui).

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
ggbdpq a73df419d8 davsync: a GitHub blob POST on a slow but live line is no longer cut off at 30 s
What changed: the stall watchdog saw a request as one whose body may
outlast the whole metadata limit only by method (GET, PUT), and gave every
other request a flat 30 s (#657's rule held for WebDAV and S3, whose
remaining requests move a few KB at most). GitHub's uploads ride a POST:
each blob POST hauls up to 16 MiB of file as about 21 MB of base64, and a
flat 30 s needs 550 KB/s to get one part through (#4576: on a slower line
the sync failed on the same POST at every attempt, automatic, at start and
manual, and never recovered -- the usage day file froze in the morning
while the machine kept working). A request hauling a big body (64 KiB or
more) now gets the same moving-aware budget as a PUT: the watchdog is put
back each time bytes move, and after the body is all handed over the
answer gets 60 s on top of as long as the write took. The metadata
requests (the GitHub tree, commit and ref POSTs and PATCH, WebDAV
PROPFIND/MKCOL/MOVE/DELETE -- kilobytes at most) keep their 30 s in all.

Run: TestGitHubSlowBlobUploadIsNotCutShort (a 272 KB base64 body through a
line at 320 KB/s, watchdogs shortened to 1 s/300 ms) fails on the old code
with "the server didn't answer in 300ms (POST)", the shape of #4576's
error, and passes now; TestGitHubSmallPostKeepsTheLimit pins the small
POSTs to the old limit either way. go test -tags nogui ./internal/davsync,
vet and builds for darwin, GOOS=linux and GOOS=windows pass. Not tried
against a real slow line to GitHub.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
ggbdpq 3b7fe8e5f3 fix(cli): visible <agent> all clears the models taken out and the only-picked switch
What changed: `magpie visible <agent> all` took only the visibility
narrowing out, leaving HiddenModels and PickedModels in place. An agent
shown none of them — shown only the models picked for it with none picked,
then switched to --show-new, which keeps what it is shown by taking the
rest out — stayed none through `all`, the very recovery `magpie models`
and the gateway's refusal to name a model point at; only deleting
hiddenModels.<agent> from settings.json brought the models back (#4587, a
DSH behind a Docker gateway saw an empty model list; #3432, closed as not
planned, the same for an only-picked agent). `all` now takes the hidden
models and the only-picked switch out together with the narrowing, and its
usage line says so.

Run: go test ./internal/cli/ -run 'TestVisibleAll' -tags nogui — two new
tests fail before the change and pass after it.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-02 05:38:10 +08:00
yetone 611ce90d15 agent: OpenBot, magpie's models in its model picker (jiezhengj)
OpenBot (nightly-labs/openbot, openbot.run, v0.58.0) is a new row on the
Agents page. jiezhengj on Discord asked for it: today they type magpie's
address into OpenBot by hand and add each model one at a time.

OpenBot lists the user's own OpenAI-compatible endpoints from
openbot-custom-providers-v1.json in its userData folder:
~/Library/Application Support/OpenBot, %APPDATA%\OpenBot, or
~/.config/OpenBot. Connecting adds an entry with id "magpie" pointing at
the gateway's /v1 and holding the models picked for OpenBot, with
secret null. OpenBot seals an entry's key in safeStorage, which magpie
doesn't open, so the entry has no key. OpenBot hands it to OpenCode
keyless, and the gateway accepts it as a request from this computer.

What the entry keeps to:
- OpenBot's decoders drop the whole list over one bad entry. So the entry
  has at most 64 models, only ids OpenBot accepts as magpie/<id>, and a
  context window only inside 1,024 to 100,000,000.
- The user's other entries stay. The name, harness and secret they give
  magpie's entry in OpenBot stay too.
- A sync with nothing to change doesn't write.
- A file whose version isn't the number 1, or whose providers isn't a
  list, is one OpenBot refuses itself, so magpie leaves it alone.
- Disconnect takes out magpie's entry, and the file too when only the
  version and an empty list are left.

OpenBot reads the file at start, so while it runs, a notice says to
restart it. The notice is in every language.

OpenBot is detected by its userData folder, OpenBot.app
(app.openbot.desktop), or OpenBot.exe under %LOCALAPPDATA%\Programs or
%ProgramFiles%. Docs updated: agent-wiring.md, reference.md, and both
READMEs.

Run at the pushed head, on mote:
- gofmt -l: clean.
- go vet -tags nogui for internal/agent and internal/gui, and for ./...
  with GOOS=linux and GOOS=windows: ok.
- go test -tags nogui -count=1 -timeout 45m on internal/agent and every
  package that imports it (., backup, cli, davsync, gui, library,
  profile, stats, tui, uninstall, plugins/...): ok.
- GUI: agent-notice-lang, i18n-keys, header-relang and about-notices in
  Chromium and WebKit: 58 of 58 pass.

After rebasing on d20caffae (appdir, i18n.js and gui changed on main), these were run again: gofmt; linux and windows vet of agent, gui and appdir; go test of the same three: ok. The four GUI files plus checkin-now-account: 80 of 80 pass.

Real OpenBot 0.58.0: the arm64 zip, sha512 checked against
latest-mac.yml, notarized by Akudama GmbH. It ran on mote under a
sandbox HOME with --user-data-dir and --use-mock-keychain, on a file
that magpie's own openBotWire wrote.
- OpenBot started without setting the file aside.
- Asked over CDP, window.openbot.customProviders.list() returned magpie's
  entry with all three models and harness opencode.
- Saving another endpoint in OpenBot wrote magpie's entry back unchanged.
- The notice's pgrep pattern matched the running OpenBot.

Broken by hand, each red:
- the 64 cap
- the id filter
- the version check
- keeping the user's name, secret and harness
- writing version 1 into a new file
- the notice's Running check

One break stayed green: dropping openBotWire's own no-change check.
edit.SetJSON already skips a write that changes nothing, so the test
holds at that layer.

Not tried:
- a chat through OpenBot to the gateway. OpenBot's onboarding and its
  OpenCode download were not gone through, so no request reached magpie.
- OpenBot's MCP servers. They live in its SQLite database, which magpie
  doesn't write; magpie's /mcp/magpie/... servers are added by hand.
- Windows. Its install folder is read from electron-builder's defaults,
  not from a real install.
- Linux and the AppImage.
- A request from OpenBot is counted under OpenCode's name, since
  OpenCode sends it.
2026-11-02 05:37:32 +08:00
yetone d20caffae1 release: notes written again on magpie-releases are copied here each hour
GrayRabbit on Discord (11-02): the "更新内容" dialog in Chinese listed
v0.1.2634 on as raw English commit subjects. magpie-releases' release
runs got "Insufficient Balance" from DeepSeek for both the changelog
and its Chinese since v0.1.2634, so those releases went out with the
commit list and no <!-- lang:zh --> part, as v0.1.1233 to 1242 did
(#2122). magpie-releases b90a82b now writes such notes again each hour
(notes.yml) once DeepSeek answers.

- notes-mirror.yml, hourly at :53 and by hand: a release here still
  without the zh marker gets magpie-releases' notes of the same tag
  once those have it, with the mirror's footer. The app reads
  magpie-releases through usemagpie.ai, so this is the GitHub page.
- release.yml's notice on #2260 names insufficient_balance_error as a
  DeepSeek top-up and says the notes are written again by themselves.

v0.1.2634 to 2644's notes were written by hand from their commits, in
English and Chinese, on both repos' releases.

Run: actionlint 1.7.7 (mote) on notes-mirror.yml and release.yml:
nothing but release.yml's existing unknown runner labels. No Go or GUI
code changed.
Not tried: notes-mirror.yml on GitHub's runners before this push.
2026-11-02 05:22:19 +08:00
yetone e87140242b settings: Check in now for one account, its switch left as it is (xiaowu_95660)
xiaowu_95660 (Discord #general) asked for a way to check in one account
right now where its daily check-in switch is, without turning the switch.

- provider: a checkiner can be held to one account (`only`), and
  CheckInAccount(ctx, by, key) runs the same claim path once for it, for
  WorkBuddy, Trae, MiniMax, Qoder and every plugin with a check-in.
  CheckinOff is not read or written.
- gui: POST /api/usage/checkin-account {By, Key}. Settings' daily check-in
  group (built-ins and plugins) gets a "Check in now" row under its
  accounts. One account checks in at once; several open the app menu to
  pick one. The line says done, already checked in, not eligible,
  inactive, captcha, own-app or the failure. Only quotas reload, so
  Settings isn't redrawn under the button.
- The row and press live in the lazy checkinnow.js (core budget unchanged,
  three check-in comments cut). Once loaded it draws at once, so a redraw
  by the switch doesn't shorten the page for a moment.
- Strings in zh, zh-TW, ja, de. provider-plugins.md says how it works.

Run at befdfa72b (on origin/main d89f03aa9; 4ffd5b96d, the Cursor min line, landed after), on mote:
- gofmt -l clean; GOOS=linux go vet -tags nogui and GOOS=windows go vet of
  internal/provider and internal/gui ok.
- go test ./internal/provider ok. go test ./internal/gui: only
  TestMainWindowCorners/macOS_26_SDK red, the same at base de7953e3b
  (#3949, macOS 27 box).
- GUI, chromium and webkit, every language, narrow widths: checkin-now-
  account (new), checkin-account, plugin-checkin, checkin-reason,
  checkin-reason-once, checkin-early-done, usage-checkin,
  qoder-checkin-recheck, settings-groups, settings-lines-wrap,
  click-scroll, old-webkit, i18n-keys: 252 of 252 ok.
- Earlier at the pre-rebase head: warm-now webkit 440 en/ja/de click
  timeouts (#4322) and segs-press-redraw (#4566) red, both the same at the
  base.

Broken by hand: without the `only` branch in reaches(),
TestCheckinOneAccountNow goes red (every account is claimed). Loading
checkinnow.js after every redraw made checkin-account's "the switch moved
the page" red on webkit 420 zh/zh-TW/ja; fixed as above.

Not tried: the whole GUI suite (another session's full suite was running
on mote); a press against a real account (no real claim was made).
2026-11-02 05:22:12 +08:00
yetone 9f1734645a appdir: exports go to the Downloads folder the system keeps, not home/Downloads
1Shin on Discord (#feedback, 11-02): an export (Settings' backup, a
request saved from the archive, a session as Markdown, the usage file)
joined $HOME/Downloads, which is wrong when Downloads was moved: Windows'
known folder (to another drive or OneDrive) or the XDG one on Linux
(~/下载 on a Chinese desktop).

appdir.UserFolder(kind) asks the system: SHGetKnownFolderPath
(FOLDERID_Downloads/Desktop/Documents, KF_FLAG_DONT_VERIFY) on Windows,
used when magpie's home is the profile Windows keeps it for (a home given
of its own, as a test's, keeps home\Downloads); $XDG_CONFIG_HOME/
user-dirs.dirs on Linux and the BSDs, read as xdg-user-dir does ("$HOME/x"
or "/x", quoted, backslash escapes, the last line wins); ~/Downloads on a
Mac. A failed lookup is home/kind, as before. gui's downloads() tries it,
then home/Downloads, then home. appdir's sharedFolder (a data folder
beside magpie there isn't portable data) adds the system's folders to
home's, and Cursor's AppImage is looked for in the system's Downloads too.
update's isDownloadFolder already asked Windows for its known folders and
is unchanged.

Run at this head (rebased on origin/main):
- mote (macOS): gofmt -l clean; go vet ./internal/appdir ./internal/gui
  ./internal/agent; GOOS=windows go vet of those and ./internal/update;
  GOOS=linux go vet -tags nogui of the three; go test ./internal/appdir ok,
  -run "Backup|Export|Archive" ./internal/gui ok, -run
  "Cursor|Desktop|Sandbox" ./internal/agent ok.
- wsl-run (Ubuntu 24.04): appdir's UserFolder/SharedFolder/ResolveDownloads
  tests and gui's TestExportGoesToTheSystemsDownloads,
  TestBackupLibraryRoundTrip and the session exports pass. Against the real
  xdg-user-dir in a sandbox HOME, "$HOME/下载", "/mnt/d/My Downloads" and
  "$HOME/a \"b\"" read the same; "$HOME/" gives home without the trailing
  slash.
- win-run (Windows 11): the appdir tests pass, and
  TestKnownFolderIsExplorers checks the known folder against Explorer's
  User Shell Folders value (read only). Windows expands that value's
  %USERPROFILE% once a process, with the first call's environment, so the
  check runs in a child of its own. The real profile gives
  C:\Users\yeton\Downloads, Desktop and Documents.

Broken by hand: no user-dirs.dirs read, or no profile check on Windows:
TestUserFolderXDG, XDGLines, XDGConfigHome and TestUserFolderWindows go
red. gui's downloads() without the system's folder:
TestExportGoesToTheSystemsDownloads red in WSL (saved in ~/Downloads, want
~/下载).

Not tried: a Downloads really redirected on Windows (to D:\ or OneDrive).
Moving it means writing the user's own User Shell Folders on the test box,
so the redirect is a faked known folder in TestUserFolderWindows only. Not
run: the GUI suite (no GUI file changed) and a full go test ./....
2026-11-02 05:19:45 +08:00
yetone 4ffd5b96dc provider: the Cursor move asks for plugin 0.2.36 (plugins#550)
Cursor plugin 0.2.36 (magpie-community/plugins@24cd0b9, on npm, checked
with npm view --prefer-online): a stateless Run whose step sent its calls
and then only heartbeats, with no tool count, hands the calls that came
to the caller 60 s after Cursor's last non-heartbeat frame instead of
waiting 240 s to go quiet. Windsland52's fifth wire trace: a native
stall pushed the retry onto the stateless path, where two calls and no
count cost another 4 minutes. keepMovedCurrent updates moved users.

Run at this head (mote): go test ./internal/provider -run
"Mover|Moved|Migrat|Retir|Plugin|Min": ok. GOOS=linux and GOOS=windows
go vet ./internal/provider: ok. gofmt -l: clean. The plugin's own run is
in its commit (bun test packages/cursor: 380 pass).
Not tried: a real Cursor account on the plugin.
2026-11-02 05:12:52 +08:00
yetone d89f03aa92 settings: trayNoNumber is a key magpie settings sets, and GET /api/quit is the window's own (#4793, #4794)
da275848b saved trayNoNumber without naming it in settingsapi.Keys, and
8826a15ea added GET /api/quit without naming it in the CLI parity table,
so TestKeysAreWhatTheSaveWrites, TestSettingsCLISetsWhatTheWindowSaves
and TestEveryRouteHasACommandOrIsNamed have been red on main since.
/api/quit only reads which agents the window's Quit question names, so
it is the window's own (W), with nothing to do in a terminal.

Run at a8e98e1ab plus this, on mote: go test -tags nogui -count=1
./internal/settingsapi ./internal/cli ./internal/settings: ok. The same
three tests were red at 6b3a6d42c without it.
2026-11-02 04:51:42 +08:00
yetone 3f393a4fae redact: a user name is not masked where code has the same word as a name (Tomyu_2034 on X)
Tomyu_2034 on X: "magpie 里面的 masking 很容易把参数变量名当成 user name
给 mask 掉". No sample was given, so the class was measured: with "User
name in home folders" and "User and computer names" on, two finders took
names in code for the user's.

- Known values (known.go). A user name the home rule found once
  (/Users/developer/…) is known from then on when it is 8 bytes or more,
  and standsAlone's default bound is a letter or a digit only, so it was
  masked wherever the word stood between anything else: def
  run(developer, developer_dir), developer_mode = True, const developer
  = 1, {"developer": true}, -    developer_count := 0 in a diff, a tool
  call's old_string. A user name such as developer or workspace1 is a
  word code has too.
- The "User:" line rule (more.go). Its unquoted value was any
  login-shaped word, so user = current_user, user: UserInfo, login =
  loginName, username = target_name, a Go struct's "\tUser  UserProfile"
  and a TS interface's "user: CurrentUser" went as made-up names.

nameAlone now decides a known USERNAME: it is the user's name as a word
of its own in text (a path's part, name@host, --author=name, ls -l's
owner, uid=501(name), prose, a quoted string, chown name:staff), and
code's where it is joined to another part (_ $ a letter or digit beside
it, or a . or - with one past it), declared (const/let/var/def/func/
class/return/import…), assigned or called (name =, name(, name[,
name :=, x = name), a JSON key ("name":), or a parameter ((name, ,name)
name: str, name string), but for id's 501(name)). Nothing is exempted
by a key's name: a tool call's arguments are read by the same rule as
any text, and a quoted value in them is masked as before. The "User:"
rule leaves an unquoted value made of two or more words (split at _ .
and camel humps) one of which says it holds a user (identParts: user,
name, login, current, target, info, obj, id…); a quoted one, and a
login of words of its own (deploy_bot, john_doe), are masked still.

The boundary costs this: prose that puts the name alone in a list
"(developer, alice)" or before "=" now goes as written; such text reads
as code to this rule. A name under 8 bytes was never matched as known,
so for those only the "User:" half changes anything.

Tests (identname_test.go), with "developer" (a common word) and
"rinakato" (a handle), known from a working directory first:
- TestUserNameInCodeIsNoUserName: a Python and a JS file read, a JSON
  file, Go code, a diff and an edit tool call's arguments go as written;
  a home path, --author=, ls -l, uid=501(), prose, a quoted string, a
  JSON value, chown and a bash tool call's ~name go as the made-up name.
- TestUserLineInCodeIsNoUserName: seven code lines unmasked; User:
  deploy_bot, USER=rinak, user: "current_user", ssh config's User and
  user = john_doe masked.

Broken by hand: with more.go and known.go as on main both tests are red
(12 and 7 failures); with standsAlone's USERNAME case returning true,
TestUserNameInCodeIsNoUserName alone is red.

Run at this head (on origin/main 89ffc58f5; nothing since touches
internal/redact or the doc), on mote:
- gofmt -l clean; go vet ./internal/redact ./internal/masking, and
  GOOS=linux -tags nogui and GOOS=windows go vet ./internal/redact: clean.
- go test ./internal/redact ./internal/masking ./internal/otlp
  ./internal/pii ./internal/sessions ./internal/settings: ok.
- go test ./internal/gateway -run '(?i)mask|redact|privacy|personal|
  standin|restore': ok.
- go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red, the
  AppKit title bar on mote's macOS 27 (#3949, open); nothing else.

Not tried: the full internal/gateway package and go test ./... (the
gateway takes ~45 min; pushed at once per the owner's ship rule); the
local model's PERSON finds, which already leave snake_case and
lower-case words (modelTakes, programWords); the home rule's
"/home/<segment>" in a web route ('/home/dashboard'), which reads as a
home folder and is unchanged; a real request with the reporter's code.
2026-11-02 04:49:42 +08:00
yetone a8e98e1abb gateway: a Claude Code run that exits mid-reply is a failure, not a 200 (#4822)
A Claude subscription run whose Claude Code exited after its reply began,
with no message_stop nor a result (only the message_start, or part of the
text), closed its segment as if the reply had ended. The client was
answered 200 with nothing or the words so far, and the agent took it as a
finished turn.

- readOutput: at the end of Claude Code's output, a reply begun on the
  open segment (KStart, tracked in emit as unended until a KStop or
  KError) ends with a KError, 502, "Claude Code exited before it ended
  its reply" and the end of its stderr. -p and the interactive mode share
  this path.
- relay, not streamed: any error is a status, words said before it too
  (was: a 200 with the partial reply), as a translated reply cut short is
  (errEndedShort). The try's usage is kept as before (d2a83de61).
- Streamed with nothing sent yet: the head's KError is a status, as
  before, so the spare answers by the existing failover rules, and the
  cut try keeps its handed_on usage row. Streamed after text: the
  protocol's error event (Anthropic `error`, chat's error chunk with no
  [DONE], Responses' response.failed), no end event, no other run.
- A reply that ended with message_stop, or whose stop was told, is
  unchanged.
- The tests' fake Claude Code (claudeSubscriptionFirstSays) answers
  control requests, so it runs in the interactive mode too.

TestClaudeSubscriptionRunExitedMidReplyFails: message_start then exit and
text then exit, on /v1/messages, /v1/chat/completions and /v1/responses,
streamed and not, -p and interactive (24 cases): the spare's answer and
the cut try's handed_on row (900 cache write) where nothing was sent, the
error event and no end where text was streamed.

Run, at this tree on origin/main 89ffc58f5:
- mote: go test -run TestClaudeSubscriptionRunExitedMidReplyFails
  ./internal/gateway ok (24/24); go vet -tags nogui ./internal/gateway
  for darwin, linux and windows ok; gofmt -l clean.
- mote: go test -tags nogui -timeout 45m ./internal/gateway
  ./internal/claudetui: claudetui ok; gateway red on
  TestCodexPoolSaysTheClientsVersion alone (#4807, another test's Codex
  identity, open and passes alone; this change doesn't touch Codex).
- Full suite (go test -tags nogui -timeout 45m ./..., Linux, wsl-run)
  was still running at push time; internal/agent's install-detection
  reds there are #4033. Its result goes on #4822.
Broken by hand: with claude_subscription.go at origin/main, all 24 cases
red (200, runs "own", partial or empty reply). With the relay change
alone reverted, the 6 text/not-streamed cases red (200 partial).
Not tried: a real Claude Code whose upstream cuts the stream and exits
mid-reply. A non-streamed reply cut after text now goes on to the spare
account, which is billed for the conversation again (the client gets a
whole answer instead of a cut one, as for translated providers).
2026-11-02 04:38:57 +08:00
yetoneand胡峻果 89ffc58f5b gui: a card's Refresh says the read's failure, and Claude Code's first-run screens say what to do (#4817, uiuing)
From uiuing's branch (1eeb8928b, 66818dbf6), adapted. A usage card's
Refresh showed nothing when the read came back as a card with an
error: only a thrown request reached status. quotaRefresh now says the
refreshed card's error through quotaError, for a single account and
for a provider whose cards were replaced (the one kept in quotas).
quotaError reads the helper's new "stays on its first-run screens" and
an older magpie's "shows its first-run notes" as "Finish Claude Code's
first-run setup, then refresh", in en, zh, zh-TW, ja and de. Comments in
quotaError and quotaRefresh were cut so the core scripts stay in their
budget (1,533,732 of 1,533,802; main was at 1,533,780), with no raise.

Run at the pushed head, on mote: node --test of claude-quota-onboarding,
quota-refresh-order, usage-card-refresh, usage-refresh,
usage-refresh-flight, account-refresh, editor-quota-quiet,
usage-no-reading, usage-remote-cards, tray-usages, glm-quota-error,
claude-usage-asked, allowance-open-read, api-key-usage,
key-balance-card, copilot-signed-out-account, signin-again, plugin-git
and i18n-keys (chromium and webkit, every language each file runs, 440px
where it sets it): 287 of 287.
go test -run 'Budget|I18n|Lang' ./internal/gui ok.
go test -run "Claude|TUI" ./internal/gateway ok. The full
./internal/gateway (-timeout 45m, before the rebase onto 6b3a6d42c) is ok but for
TestCodexPoolSaysTheClientsVersion, #4807 (another test's Codex
identity reaches it in a full run); nothing Claude or GUI.

Broken by hand: without the new status line, 13 of the 31 tests in
claude-quota-onboarding and quota-refresh-order go red (all ten
engine/language cases and three VM ones).

Not tried: the real app's card against a real signed-in Claude Code
that stays on its notes.

Co-authored-by: 胡峻果 <uiuing@foxmail.com>
2026-11-02 04:19:23 +08:00
yetone af4ff747bc claudetui: Claude Code's first-run screens are gone through as a person would, not the run's end (#4817, steven_4422 on Discord)
With "runs as" Interactive, a Claude Code whose onboarding was never
finished (no hasCompletedOnboarding in the state file: steven_4422's
every request 502'd, uiuing's /usage read in #4817) stopped on the
"Security notes" screen, and 88a0262bf ended the run there. A person
presses Enter. The helper now does the same:

- "Choose the text style": Enter (as before, now after the settle);
- "Security notes: ... Press Enter to continue": Enter;
- "Use Claude Code's terminal setup? ... Esc to skip" (shown for
  TERM_PROGRAM Apple_Terminal or vscode): Esc, so no one's terminal
  settings are changed.

Each key waits until its screen has stayed drawn trustSettle (300ms),
as the trust dialog's does, and each screen gets onboardTries (3)
presses; one that is still shown after that ends the run with "stays on
its first-run screens, its onboarding not done; run Claude Code once in
a terminal and go through them", plus the screen. Claude Code then
records the onboarding done itself (hasCompletedOnboarding,
lastOnboardingVersion); magpie writes nothing in the user's
.claude.json. There is no -p fallback: with On nothing runs as -p (the
owner's 11-01 call, e5f66f8a6).

Run at the pushed head, on mote: go test ./internal/claudetui ok;
gofmt -l clean; go vet darwin, linux, windows ok. wsl-run claudetui ok
(at the pre-rebase base). win-run claudetui: TestShimGoesThroughOnboarding
and TestShimNeverPrints pass; TestShimFirstMessageWaitsForTools (#4810)
and TestShimReadsUsage (#4820, filed for this) fail the same at
origin/main eb3b9376e on Windows. go test -run "Claude|TUI" ./internal/gateway ok;
the full package ok but for #4807's TestCodexPoolSaysTheClientsVersion.

Real Claude Code 2.1.316 (npm darwin-arm64) on mote, through a built
magpie's claude-tui-helper, in fresh sandbox HOMEs with a fake
CLAUDE_CODE_OAUTH_TOKEN and ANTHROPIC_BASE_URL at a closed port, for
TERM_PROGRAM unset, Apple_Terminal and vscode: the first run got
through theme, notes (and terminal setup) and trust to init in 5-6s,
the second in 2s; .claude.json then had hasCompletedOnboarding true and
lastOnboardingVersion 2.1.316, settings.json theme dark.

Broken by hand: no Enter on the notes, both TestShimGoesThroughOnboarding
subtests red; Enter instead of Esc on terminal setup, "the user's
terminal was set up" red. Taking the settle out still passes (the fake
redraws and is answered again), so the settle is not guarded.

Not tried: a real signed-in account (no token was provided), so no
request past init; real Claude Code on Windows or WSL; iTerm or other
TERM_PROGRAMs whose onboarding may show other screens.
2026-11-02 04:19:23 +08:00
yetone 62ffc40169 gateway: a waiting request goes to an account back from rest (01huadalang)
01huadalang on Discord (11-01): three ZCode accounts, three requests at
once each. The first two got a 405 and rested, so every request went to
the third, and those over its three waited in its lane. Once the first two
were back, the waiting ones stayed on the third, behind its long turns,
until its requests were cut by hand. Same under Smart, In turn and Stays
off.

Cause: a request that queued in a lane (lanes.take) waited only for that
lane's turn. Nothing looked again when another lane gave a slot back or a
rest ended. With ZCode's maxAccounts 2, the third took a seat while the
first two rested and was a reserve again once they were back, but the
requests already waiting for it stayed. laneMate also gave way to a mate
resting, because ready() checks only lane and RPM room.

Change:
- lanes.take takes a move func. While waiting (lanes.await), it looks
  again when any lane gives a slot back, when a rest is lifted (Unrest,
  UnrestAll signal lanes.freed), when the soonest rest among the others
  ends, and at least every 5s (laneRecheck). waitMate finds the first
  candidate after it in the planned order (then those probeOne left out
  for resting) of the same provider, or any member of a group, that has
  a free slot with no queue (tryTake), minute room, isn't resting, didn't
  give way, and isn't a reserve as keepAtOnce stands now. The request
  then leaves its queue (errMoved) and serve runs that candidate with the
  slot already taken for it. A fallback provider is never one. Strict
  stays leave no other candidate, so nothing changes there.
- laneMate skips resting mates.
- docs/subsystems/gateway-routing.md Limits row says so.

Tests:
- TestWaitingRequestGoesToAccountBackFromRest: 3 keys, cap 3, MaxAccounts
  2, k1 and k2 resting (405), 9 requests. 3 go to k3, 6 wait for it, and
  none reach the resting two. Then the rests are lifted (Unrest) or run
  out (300ms), and the six go to k1 and k2 while k3's three are still
  out (9 at once). Run under Smart and Rotate, with Stays default and
  off.
- TestWaitingRequestTakesSlotGivenBackElsewhere: 2 keys, cap 1. A third
  request waiting for one key goes to the other when that one's request
  ends, under default, order, rotate and usage routing.
- TestFullMemberGivesWay updated. c, waiting for first, now goes to second
  once second's b ends. d (first's fallback is second) still waits for
  first.

Run on mote (mote-run), rebased on e65bc8473:
- go test -count=1 -timeout 45m ./internal/gateway: every test ok
  except TestCodexPoolSaysTheClientsVersion (608s; #4807, below)
- go vet ./internal/gateway, GOOS=linux (-tags nogui), GOOS=windows: ok
- gofmt -l: clean
- go test -race -count=10 on the three tests above: ok
- That red is #4807, also the only red in an earlier full run (it passes alone,
  here and on origin/main e65bc8473; another test's Codex version reaches
  it).

Rebased again on 6b3a6d42c (VS Code agent host, gateway.go): at this
head, vet for darwin, linux and windows ok, gofmt clean, and go test -run
'Lane|Waiting|FullMember|AtOnce|VSCode|Vscode|AgentHost|Concurrency|
Queue|Rest|Probe|Affinity' ./internal/gateway ok (44s).

Broken by hand:
- On origin/main's code, the new tests and the updated
  TestFullMemberGivesWay are red. The rest test fails at "six waiting for
  k3" because laneMate handed requests to the resting keys.
- With waitMate's move ignored (if ok && false), every case is red at
  "the waiting ones at k1 and k2", and so is TestWaitingRequestTakesSlot-
  GivenBackElsewhere.
- With the rest's end ignored for the recheck timer (only laneRecheck),
  the four "ran out" cases are red.
- Two test races were found under -race and fixed in the test: the rest
  was timed from before the nine were sent, and the concurrency count was
  read before the ninth reached the fake vendor.

Not tried: real ZCode accounts or the ZCode plugin. The plugin's own 405
handling and maxAccounts are as before. Not run on Windows or Linux
machines; vet only.
2026-11-02 04:17:24 +08:00
yetone 6b3a6d42c0 agent: VS Code's Agents window (vscode_agent_host) counts as VS Code, its turns as Codex's
justruman on Discord (#general, 11-01): VS Code's Agents window showed
in Usage as a raw "vscode_agent_host" row, 23 calls, 7 failed, beside
the "VS Code" row.

Why: VS Code's agent host runs `codex app-server` with clientInfo
{name: "vscode_agent_host"} (microsoft/vscode main at 8fb6054,
src/vs/platform/agentHost/node/codex/codexAgent.ts CLIENT_INFO; it
bundles @openai/codex 0.163.0). Codex sends that name as its
originator and at the head of its User-Agent, and it reads the user's
~/.codex config, so with Codex connected to magpie its turns come here
under VS Code's name. No agent's UA list had it.

- Usage: vscode_agent_host is in VS Code's UA list
  (vscodeAgentHostUA), so those calls are VS Code's. Records are named
  again at read time (ReportedAs -> AgentOf), so calls already logged
  under the raw name fold into VS Code too. Insiders' and VSCodium's
  agent host send the same name and are counted as VS Code (Stable):
  nothing in the request tells them apart.
- Routing: fromCodex also takes vscode_agent_host (hostedCodex), so
  every Codex rule holds for those turns. The one that fails without
  it: one of Codex's own models asked there, which no account in
  magpie serves, was answered 404 "magpie knows no model" instead of
  going on Codex's sign-in (codexOwnOffMagpie). Also now applied:
  spawn_agent's model list, compaction told in the stream on a byte
  cap/overflow, Codex's headers to a keyed Codex-only relay.
- A test asked as Codex keeps only Codex's own names (codexNamed) as
  Codex's shape: the agent host's headers never become it.
- VS Code's Copilot-proxied names (vscode_codex, vscode_claude_code) go
  to GitHub, not magpie, and are not matched.
- docs/subsystems/gateway-routing.md says so.

Run on mote at this change rebased on origin/main 16ce5ed23; the
one commit since, e65bc8473 (#4802), changes internal/plugin and GUI
files only: gofmt -l empty; go vet ./internal/agent ./internal/gateway
./internal/usage for darwin, GOOS=linux -tags nogui and GOOS=windows
ok; go test -count=1 -timeout 45m on the three packages: agent ok,
usage ok, gateway ok except TestCodexPoolSaysTheClientsVersion
(#4807, filed at origin/main 79f83798f before this change; it sends
codex_cli_rs, which this change leaves as it was, and passes alone
at this head and at its base).

Broken by hand, each red: without hostedCodex in fromCodex,
TestVSCodeAgentHostIsCodex, TestVSCodeAgentHostOwnModelGoesOnSignIn
(404 "magpie knows no model \"gpt-6.1-sol\"") and
TestVSCodeAgentHostNotCodexTestShape (relay sent magpie/dev); with
SawClient ungated, TestVSCodeAgentHostNotCodexTestShape (as Codex sent
vscode_agent_host, 403); without the UA list entry, TestVSCodeAgentHostUA.

Not tried: a real VS Code Agents window against magpie (no VS Code on
this machine or mote). The UA and originator are from VS Code's and
Codex's source, not captured bytes, and the terminal part of the UA is
a guess (it isn't matched). The reporter's 7 failures weren't seen:
the 404 above is the failure class the source shows, not one confirmed
in their log. Other checks keyed on agent == "codex" (Codex memory
calls, image drawing on Codex's own models, title links, CodexBusy)
don't apply to these turns, since they are counted as VS Code.
2026-11-02 04:04:47 +08:00
yetone e65bc84731 plugins: a git plugin updated past the commit the look found waits no more (#4802)
matrix0487 (Discord, #4802): github:faithleysath/magpie-oh-my-aihub, unpinned.
The look at 14:38:55 wrote {version: fdaa691, latest: 3b411a5}; the repository
moved on to ba898e7 twenty seconds later, and Update installed ba898e7. The
dot, "Update all (1)" and the row's New commits stayed until the next hourly
look, and every Update after said only "is up to date".

Cause (checked against the source, as the reporter traced it):
- PendingUpdates kept a git entry until the commit installed was the
  recorded latest (GitBehind is installed != head, not "behind"), so a commit
  newer than latest kept it forever. The npm branch compares versions in
  order and was right.
- Upgrade, Update and add never touched plugin-updates.json; only the next
  CheckUpdates/CheckNow rewrote it.
- The page kept /api/plugins/git's old head (3b411a5) in its heads map, and
  merge() put it over the plugins' own fresher head after the update, so the
  row's New commits and Update all stayed even with the file right.

Changes:
- waitsNoMore (shared by PendingUpdates and the new settleWaiting): a git
  entry also waits no more once the commit installed is not the one the look
  saw installed (Version).
- settleWaiting rewrites plugin-updates.json without what waits no more,
  after add (every install, npm Upgrade, Update's pinned path), a git
  Upgrade, Update (Update all) and InstallMissing. Checked time is kept.
- reinstall's #2954 "left it at X" error now needs the commit to have stayed:
  a moved install that can't ask the repository again (rate limit, offline)
  isn't reported as stuck on the look's older head.
- plugins.js: an action on a plugin (Update all: on every one) drops the
  page's cached head for it, so the plugins' own head is drawn; a git Update whose
  commit moved says "{name} updated to {commit}" (zh, zh-TW, ja, de), and
  the Up to date chip's tooltip prefers the row's head over the check's.

Siblings: npm (version order already right; now also rewritten on file),
a commit pin (dropped once at the pin: test case), Update all (same flow as
Upgrade: test case), the toast (above). CheckNow/CheckUpdates rewrite the
file as before.

Tests (reporter's literal fdaa691 / 3b411a5 / ba898e7):
- TestGitWaitingGoneOnceUpdatedPastTheLook: installed ba898e7, 3b411a5, another
  commit, still fdaa691 (waits), and a pinned spec.
- TestSettleWaitingRewritesTheRecord: git + npm entries gone from the file.
- TestGitUpdatePastTheLookWaitsNoMore: fake bun + fake GitHub; look, push,
  then Upgrade / Update / Upgrade with GitHub down after; nothing waits on
  file or in PendingUpdates, and the update isn't an error.
- plugin-git.test.cjs: the repository moves on after Check for updates;
  Update installs ba898e7, no New commits, no Update all, toast names it.

Run at the pushed head (rebased on 99d9016fd), on mote:
- After the last rebase onto 16ce5ed23 (quotaall.js, i18n.js): internal/gui
  TestCoreScriptBudget ok, i18n-keys and plugin-git in both engines 10 of 10.
- gofmt -l internal/plugin internal/gui: empty. go vet darwin, linux
  (nogui) and windows on internal/plugin, gui, provider: ok (at d2a83de61;
  only plugins.js changed after).
- go test internal/plugin, internal/provider: ok. internal/gui
  TestCoreScriptBudget: ok, 1,533,780 of 1,533,802 with no room added (the
  JS's comments cut to one).
- go test internal/gui and internal/cli at d2a83de61: ok except
  TestMainWindowCorners (#3949), TestSettingsCLISetsWhatTheWindowSaves
  (#4793) and TestEveryRouteHasACommandOrIsNamed (#4794), main's own.
- node --test plugin-git, plugin-update-button, plugin-updates,
  plugin-check-updates, plugin-card-update, i18n-keys (chromium + webkit,
  every language they cover): 54 of 56; the 2 are plugin-card-update webkit
  waiting 5s for the card's Update button before any click, red 2 of 3
  alone at this head and 2 of 3 alone at origin/main 99d9016fd (#3079).
- Before the rebase, every plugin-*.test.cjs + i18n-keys +
  account-plugin-user: 956 of 960, the 4 being plugin-move-unserved's "Try
  again takes the models unticked", equally red at de7953e3b (#4410).

Broken by hand (on mote, then restored):
- all three Go parts removed: all three new Go tests red (the reporter's
  ba898e7 case keeps Waiting; the file keeps both entries; Upgrade/Update
  keep it waiting, and the GitHub-down Upgrade errors "left it at ...").
- plugins.js without the heads line: plugin-git red in both engines (New
  commits still shown, 6 of 6 red).
- only settleWaiting a no-op: TestSettleWaitingRewritesTheRecord and the
  on-file check of all three TestGitUpdatePastTheLookWaitsNoMore cases red.

Not tried: the reporter's real repository or a real bun against GitHub (the
fake bun and fake GitHub API stand in); the Windows and Linux apps.
2026-11-02 03:54:00 +08:00
yetone 16ce5ed232 usage: an account whose longer window is used up adds no headroom to the all-accounts sum (#4791)
hayden4608 (Discord) and handong66 (#4791) have four Codex accounts. Three
show 5 hours 100% left with 7 days 0% left, and one shows 5 hours 0% left
with 7 days 22% left. The All accounts strip read "5 hours 75% left", but
none of those three can spend its 5 hours until its week starts again.
The right figure is 0%.

mergeQuotas (quotaall.js) is the one place that sums windows across
accounts. It feeds the Usage page's strip, the tray panel's strip and the
Routing groups' line. The native menu-bar tray, the TUI, the CLI and
/v1/magpie/quotas show one account at a time and are unchanged. The GUI's
JSON doesn't carry Aside, Model or the matches, so the call is made in Go.
provider.WithHeldWindows marks a window heldBy another window of the same
account when that other window:
- stops the account for every model, by routing's rule: not aside, no
  model, no matches, used >= 100, reset not passed, and not Codex credits
  that go on; and
- starts again after this one (by reset times, else by span).
So 7 days used up holds 5 hours, but 5 hours used up doesn't hold a week
with 22% left. /api/usage/quotas and its refresh apply it. mergeQuotas
counts a held share window as 100 used and a held counted one as its
limit, and the strip's tooltip says how many were counted that way
(en/zh/zh-TW/ja/de). The account cards still show the vendor's own figure.

Run on mote (macOS) at this head's parent tree:
- go vet for darwin, linux (nogui) and windows: ok; gofmt -l: none.
- go test -count=1 ./internal/provider ./internal/gui, before the
  quota_span leftOut line and an i18n comment fix. The provider package's
  only red was TestQuotaSpanCarriesEveryWindowField, which wanted heldBy
  named, and it is now named. internal/gui's only red was
  TestMainWindowCorners/macOS_26_SDK, which is #3949.
- GUI, chromium and webkit, every language, 440px and 360px: quota-*,
  usage-* (all-accounts, merge, accounts, fold, refresh and more),
  panel-usage/quota/switch-accounts/balance-order, routing-quota-left,
  routing-group, tray-usage, i18n-keys, gui-de/ja/zh-tw, old-webkit:
  704 of 707. The reds were i18n-keys (a quoted "All accounts" in
  window_held.go's comment, fixed here) and usage-fold's "17
  subscriptions and 29 accounts" in both engines, which is #4790 and is
  red at origin/main too (see below).
At the pushed head, rebased on eb3b9376e, on mote: gofmt none, vet ok.
internal/provider ok. internal/gui is red only on TestMainWindowCorners
(#3949). GUI usage-merge, usage-all-accounts, i18n-keys and usage-fold,
both engines: 44 of 46. The 2 reds are usage-fold's 29 accounts, which
fail the same at origin/main eb3b9376e on mote (noted on #4790).

Broken by hand, each red, then restored (cmp):
- Go, no HeldBy set: both TestHeldWindows tests red (a, b, c not held).
- Go, outlasts always true: red on d and on "a week that starts again
  first".
- JS, held forced false: usage-merge plus all 5 languages of
  usage-all-accounts red in chromium, showing the reporter's
  "5 hours · 75% left".

Not tried: real accounts. The issue names no provider; Codex is assumed
from the cards' 5 hours / 7 days. Not done: marking a card as held by its
week, the reporter's optional second ask. Not written: a handler-level
test that /api/usage/quotas carries heldBy. Not run on Linux or Windows.
2026-11-02 03:46:01 +08:00
yetone 99d9016fd9 provider: Devin's mover min is 0.1.32, so a system notice mid-conversation keeps its place (plugins #599)
devin 0.1.32 (plugins 17525a7, leosocy) sends a role:"system" notice
that comes partway through a conversation as a user prompt, in its
place and with its cache mark. Before, the notice was lost. A notice
that arrives while tool calls are still waiting for results goes after
those results. keepMovedCurrent now updates every moved Devin user to it.

npm has 0.1.32: npm view --prefer-online @magpie-community/opencode-devin-auth version.
Run on mote at this tree: gofmt clean; go vet ./internal/provider on
darwin, linux (nogui) and windows; go test -count=1 ./internal/provider ok.
In the plugins repo, at 647039a merged with main: bun test packages/devin
182 pass, and 4 of the new tests fail on the old index.mjs.
Not tried: a real Devin account.
2026-11-02 03:44:34 +08:00
yetone eb3b9376ea plugin load: a model listed by another id gets its plugin's load (axelburks)
axelburks on Discord: a plugin reports a model's load through
input.magpie.load by its own model id. A model the user lists in magpie
under another id (Listed as, settings' ModelIDs) showed no load on the
Providers page, and with Busy models last on it was never judged busy;
models whose id wasn't changed worked. The reporter's reading was right:
plugin.ModelLoad keeps the load by the plugin's id and both callers asked
it by the listed one.

Both call sites of plugin.ModelLoad (grep: there are only two) now map the
listed id back through Provider.OwnModelID first:
- internal/gui/providers.go providerInfoWith (models[].load), which
  already computed OwnModelID for models[].vendor; it is now read once
  and used for both.
- internal/gateway/fallback.go busyOf (restLast's busy ordering and the
  trace's busy).
A listed id whose own id is a model@size (grok -> grok-4.7@256k) still
falls back to the model's load inside ModelLoad. The provider-plugins
subsystem page says the lookup is by the plugin's own id.

Tests:
- internal/gui TestModelLoadListedAsAnotherID: a plugin provider with
  fast -> big and grok -> grok-4.7@256k listed, loads noted for big,
  grok-4.7 and small; models[].load must be 87.4 / 60 / 12 for fast /
  grok / small and absent for quiet.
- internal/gateway TestBusyModelListedAsAnotherID: busyOf at 80 judges
  fast, grok and big busy, and an unreported model not.

Run at the pushed head on mote (mote-run):
- at base de7953e3b with this change: gofmt -l clean; go vet of
  internal/gui, gateway, plugin for darwin, GOOS=linux (-tags nogui) and
  GOOS=windows: ok. go test -count=1 -timeout 45m ./internal/gui
  ./internal/gateway ./internal/plugin: plugin ok; gui red only on
  TestMainWindowCorners/macOS_26_SDK (#3949, macOS 27 corners) and
  gateway red only on TestCodexPoolSaysTheClientsVersion (#4807, another
  test's Codex identity in a full package run); both filed, neither
  touches loads. internal/gui/tests/model-load.test.cjs (Chromium and
  WebKit, every language, narrow and wide): 82 of 82 pass.
- at the pushed head 7a804cf03 (rebased; the rebase changed none of the
  touched files): vet for the three OSes ok, and go test -run
  "Load|Busy|ListedAs" of internal/gui, gateway and plugin: ok.

Broken by hand: with both call sites put back to m.ID / c.model, both new
tests fail ("fast: no load, want 87.4", "grok: no load, want 60";
"fast: load 0 busy false", "grok: load 0 busy false"); restored, both pass.

Not tried: a real plugin reporting loads in the running app with a
renamed model (the reporter's in-house vendor plugin isn't available
here); model-load.test.cjs fakes the API, so it checks the badge's
drawing, not this lookup. No full go test ./... (another session's full
suite was running on mote).
2026-11-02 03:40:03 +08:00
yetone d2a83de612 gateway: a try billed before it failed and handed on keeps its usage row
A Claude subscription run that fails after Anthropic's message_start
(an overload, a dropped connection, a cut stream Claude Code gave up on)
is a 502 so another account can take over. That account is a new Claude
Code told the whole conversation, and writes it to its own cache again.
The first try's usage was dropped twice over: relay threw away the reply
start's usage on that path, and serve wrote a usage row only for the
request's last try (and for refusals). The Usage page counted the second
account's tokens alone, with "2 tries" on the row as the only sign that
the conversation went out twice (hhxk233 and Kayrainforest on X).

- relay keeps the usage of the head's KStart/KUsage events on a failure
  before content (streamed), and the collector's usage (not streamed).
- serve writes a handed_on row for any failed try that billed something
  and handed the request on, to another account or member or the same
  one again. The row is written when the next try begins. The refusal
  and turned-away paths keep their own row, and a failure that billed
  nothing still has none. Totals count a handed_on row's tokens, not a
  request, as for refusals. The Usage page already shows such a row as
  "<status> · handed on" with its tooltip in every language.

No same-account double send was found: a fake Claude Code breaking its
stream in nine ways (error before or after message_start, a 529 or 500
result, a cut then an error or an exit, text then an error or an exit),
streamed and not, starts one run per account at most. A failure before
content goes on to the spare once. A failure after text ends the
request with no other run.

Run, at this tree on origin/main de7953e3b:
- mote: go test ./internal/gateway -run 'TestClaudeSubscriptionFailedTryKeepsItsTokens|TestClaudeSubscriptionRefusal|TestClaudeSubscriptionBigRefusal' ok;
  -run 'Retried|SearchInstead|HandedOn|Refus|Loop' ok (25.5s); gofmt -l clean.
- The full suite (go test -tags nogui -timeout 45m ./..., Linux, wsl-run)
  was still running at push time. mote had other sessions' suites the
  whole hour. Its result goes in a follow-up if it shows a red.
Broken by hand: with the failedRow() call commented out, the new test is
red ("handed-on rows: []", both stream modes). With relay's change alone
missing, it was red the same way.
Not tried: real Claude Code against a mock Anthropic that cuts the
stream. Claude Code's own stream-to-non-stream fallback (strings in
2.1.316) resends inside one run. magpie's ledger can't see that, and it
happens the same without magpie.
2026-11-02 03:38:42 +08:00
yetone de7953e3b8 browser: browser_evaluate calls an async()=> function and awaits it
The check that tells a function from an expression wanted a space after
async, so `async()=>{…}` was evaluated as an expression: the function
itself came back, serialized as {}, and its body never ran. And a
parameter list could hold parentheses, so `(async()=>{…})()` counted as
a function and its promise was called ("is not a function"). async may
now touch its parameters, and a parameter list holds no parentheses.
The extension goes to 0.1.2.

Found driving X through magpie-browser from Claude Code.

Run on mote (Chrome for Testing 1234):
- MAGPIE_BROWSER_CHROME=… go test ./internal/gateway -run
  'TestBrowser.*InARealBrowser' -count=1: ok (46.5s). Five new evaluate
  cases: async()=>, async () =>, async function, an async IIFE and
  Promise.resolve, each answering "awaited".
- Broken by hand: with origin/main's background.js the test is red at
  the first case (async()=>… doesn't say "awaited").
- go test ./internal/browserext: ok. gofmt -l: clean.
Not run: the full suite; not tried in Edge or Firefox.
2026-11-02 02:15:47 +08:00
yetone ccd746e039 claude: /usage is read in the interactive mode, typed in it, not through -p
With the interactive mode on, the plan's allowance (the Claude account's
usage card) was still read by `claude -p /usage`, the one -p run left
beside a request. Claude Code 2.1.316's -p /usage also tells only the
session's cost, no window. Now claudeUsage, with claudeTUIOn, runs the
interactive mode's helper (claudeUsageTUI) and gives it a line
{"type":"command","command":"/usage"}. The helper types /usage, waits for
the panel to settle (a "N% used" and a second without change, or three
seconds of anything else, 20s at most), closes it with Esc, and tells
what was drawn as -p's lines say it (usageText: "Current session: 0% used
· resets 5am (Asia/Shanghai)"), so parseClaudeUsage reads it unchanged.
No model is asked. The helper types no other command. The machine
reasons a request is refused for (no shim, OS, missing, off) refuse the
read the same way. Turned off, -p runs it as before.

Run (mote, at this tree on origin/main a25d3d081):
- gofmt clean; go vet internal/gateway and internal/claudetui for darwin,
  windows, and linux with -tags nogui: ok.
- go test -run 'Usage|Claude|Command' ./internal/gateway
  ./internal/claudetui ./internal/provider: ok (59.9s, 4.1s, 25.2s).
- New tests: TestShimReadsUsage, which uses the bytes Claude Code 2.1.316
  drew for the panel (testdata/usage-2.1.316.bin), TestShimRunsNoOtherCommand,
  TestUsageText and TestClaudeUsageTUIOn.

Real run (this Mac, sandbox HOME, Claude Code 2.1.316, the test account):
the built helper with claudeTUIUsageArgs and the /usage line answered in
6.1s with local_command "usage" and "Current session: 0% used · resets
5am (Asia/Shanghai)" / "Current week (all models): 98% used · resets Nov
4 at 6am (Asia/Shanghai)". Exit 0.

Broken by hand: with claudeUsage's claudeTUIOn branch off,
TestClaudeUsageTUIOn read "Total cost: $0.0000" from -p and went red.
With usageText's reset dropped, TestShimReadsUsage and TestUsageText went
red.

Not tried: a plan with overages on, or a Team/Enterprise plan's panel;
both are read through the overages line and the "no window" fallback
only. Not run on Windows or in WSL. No GUI file changed. Not run: the
full gateway suite.
2026-11-02 00:39:54 +08:00
yetone a25d3d0815 claude: a JSON schema is answered in the interactive mode, through an answer tool
With the interactive mode on, a request with a JSON schema was refused
with a 400 since v0.1.2592: interactive Claude Code takes --json-schema and does nothing
with it, its StructuredOutput tool being -p's alone. It now runs in the
interactive mode like any other request.

- serveClaudeSubscription compiles the schema (santhosh-tekuri/jsonschema
  v6.0.3, draft-07 unless it says otherwise, as -p reads one; a $ref
  outside the schema is refused, never fetched) and adds an answer tool,
  StructuredOutput or a numbered name apart from the client's tools, with
  the schema as its input schema, through the bridge's MCP server. A
  schema that can't be compiled is a 400 before any run.
- mcpCall checks each call against the schema: one that doesn't fit is
  told why (isError) to be made again, as -p's is; one that fits is kept.
- At the turn's result the kept input is the reply's structured output.
  A turn that ended with no call is told once to call the tool, and
  fails "no answer fitting the schema" if it still doesn't. Neither the
  call nor the words around it reach the client.
- claudePrint no longer lists the schema. The two refusal tests
  (TestClaudeTUIOnRefusesPrint, TestClaudeTUIRefusalIsNoAccountsFault)
  now use the case that is still refused before any run: an image by
  its URL that can't be downloaded (127.0.0.1, which magpie never
  fetches).
- The provider editor's card no longer says -p takes "a JSON schema"
  the interactive mode can't (en, zh-CN, zh-TW, ja, de).
- docs/subsystems/claude-subscription-bridge.md: the refusal list, and
  how a schema is answered.

Run:
- A real run, haiku, the test account in a sandbox HOME, real Claude
  Code 2.1.316 through the helper with --json-schema and a stdio MCP
  server named magpie serving the answer tool and its description: the
  result's structured_output was null (the premise), and the model
  called mcp__magpie__StructuredOutput at once with
  {"color":"Sky blue","hex":"#87CEEB"}, which fits the schema's
  pattern. 7.2s, one turn. Not run: the whole gateway path with a real
  account (the unit tests drive it with Claude Code's real transcript
  rows).
- mote, at this tree (base 14e351378, origin/main just fetched): gofmt,
  go vet (darwin, windows, linux -tags nogui), go mod verify ok;
  go test ./internal/gateway ./internal/claudetui: claudetui ok, gateway
  red in TestCodexPoolSaysTheClientsVersion only, which is #4807 (red in
  a full package run on mote, another test's Codex identity reaches it);
  alone at this tree -count=3 ok. claude-mode 44/44 and i18n-keys 4/4 in
  chromium and webkit.
- Broken by hand: answer() taking every call without checking it made
  TestClaudeTUISchemaAnswer red ("a call that doesn't fit was told
  Answer received.").
2026-11-02 00:35:21 +08:00
yetone 14e3513780 claude: Claude Code in WSL runs interactively when Windows can't read its transcripts
With the interactive mode on, Claude Code in WSL was refused with a 502
in two cases: the distro user's own folder unreadable from Windows
(\\wsl$ needs the 9P redirector, which a session over ssh hasn't;
"wslread") and a distro whose home the probe didn't find ("wsl-home").
Both now run interactively: the helper reads the transcript inside the
distro.

- claudetui/wslread.go: before Claude Code starts, a shell run through
  wsl.exe notes how much of $HOME/.claude/projects/*/<sid>.jsonl is
  there (a resumed session's earlier turns), says "ready", then tail -F's
  the rest; the helper copies it to a file of its own and tails that as
  any transcript. When Claude Code ends it waits for the copy to stop
  growing (settle), then closes the shell's stdin, which ends it.
- claudetui.WSL gets Distro (Projects omitempty); the gateway's tuiWSL
  sets it when Windows can't read the folder or the home is unknown.
- the wslread and wsl-home refusals are gone (claudeTUI, claudeWhy,
  claudeNotTUIWhy); the GUI's "wsl-home" reason and its 4 strings too.
- docs/subsystems/claude-subscription-bridge.md says how it is read.

Run, at origin/main ff65ebd14 plus this change (the reader through real
wsl.exe and the break-by-hand at 546cdbde6):
- WSL (magpie-desktop, go1.26.8): go vet -tags nogui, GOOS=windows vet,
  GOOS=darwin CGO_ENABLED=0 vet of claudetui ok; go test ./internal/claudetui
  ok; go test -run 'Claude|WSL' ./internal/gateway ok (51s);
  claude-mode.test.cjs chromium + webkit 44/44; i18n-keys 4/4.
- Windows 11 (xiaomi-gpu): go vet ok; go test ./internal/claudetui ok
  but TestShimFirstMessageWaitsForTools, red the same at main 2739626c3
  (bee3ea675's test, #4810);
  go test -run 'Claude|WSL' ./internal/gateway ok with
  TestClaudeAsRootEnv skipped: it is red the same at main 546cdbde6 on
  Windows (#2425, a root test where magpie is never root), at 546cdbde6.
- the reader through the real wsl.exe into magpie-desktop (a temporary
  test, not committed): ready in 93ms, the line already in the file left
  out, two lines written after copied, stopped in 9ms, no tail left in
  the distro.

Broken by hand: tuiWSL not setting Distro: TestClaudeTUIWSL red ("its
own folder, unread": Distro empty).

Not tried: a real Claude Code turn in WSL over ssh (real runs stay on
this Mac); mote (its disk is full); the full go test ./... .
2026-11-02 00:12:40 +08:00
yetone 2739626c38 provider: the ZCode mover's min is 0.1.41, nothing to claim is asked again in half an hour (plugins#600)
zcode 0.1.41 (magpie-community/plugins#600) gives a daily claim that
found no gift plan an `until` half an hour out, so magpie asks again
through the day and a plan ZCode drops into its feed later (the weekend
plan from 19:00 Beijing) is still claimed. keepMovedCurrent now updates
every moved user's plugin to it.

npm view @magpie-community/opencode-zcode-auth version --prefer-online
--registry https://registry.npmjs.org: 0.1.41, checked when this landed.

Run on mote (mote-run) at base ff65ebd14 with this change: gofmt -l
internal/provider (clean); go vet ./... for darwin, GOOS=windows, and
GOOS=linux -tags nogui (all ok); go test ./internal/provider/ -timeout
45m (ok, 103.8s).

Not tried: a real ZCode account's move. No real account was moved.
2026-11-02 00:05:39 +08:00
yetone ff65ebd142 provider: Zed's plugin is 0.1.14 at least: a Gemini model's efforts are keyed lowercase and its thinking level goes to Zed uppercase (plugins#215)
Zed's /models now lists a Gemini model's supported_effort_levels
uppercase (LOW/MEDIUM/HIGH), so the plugin keyed its variants LOW and
magpie's pi profile, which maps efforts by key, marked every thinking
level unsupported for zed/gemini-* (Yezike-yyy on plugins#215). And a
thinking level reached Zed lowercase, which its serde enum refuses:
400 "unknown variant `low`, expected one of `MINIMAL`, `LOW`,
`MEDIUM`, `HIGH`" (iron-water, plugins#215). zed 0.1.14
(magpie-community/plugins 3618bf9, from ump45nose's #587) keys the
variants lowercase whatever case /models uses and uppercases the level
only on the wire. The mover's min is raised to it, so keepMovedCurrent
updates every moved user.

npm view @magpie-community/opencode-zed-auth version --prefer-online:
0.1.14 at landing.

Run on mote at 59fdab0af (origin/main after rebase) plus this change: go test ./internal/provider/
-timeout 45m ok (104s); go vet ./... on darwin and GOOS=windows ok;
GOOS=linux go vet -tags nogui ./... ok (without nogui, Wails' cgo
Linux files don't build from macOS); gofmt -l clean.
Broken by hand: nothing here (a one-value change); the plugin's own
tests were broken by hand in 3618bf9.
Not tried: a real Zed account (none here) and a real move to 0.1.14.
2026-11-01 23:55:43 +08:00
yetone 59fdab0af7 gateway: a caller's folder the user hasn't trusted runs in magpie's, not a 502 (lwjef on X)
lwjef (X, 2116867007799030000): a cwd Claude Code hasn't trusted hangs
the interactive-mode bridge (paseo chat).

Cause: in the user's own account the helper leaves the trust question
to the user (no MAGPIE_CLAUDE_TUI_TRUST) and ends at once saying so. Up
to 11-01 that run became -p; since e5f66f8a6 nothing runs as -p, so the
turn got a 502 (endedBefore, "Claude Code asks whether to trust the
folder"). A Claude Code client such as paseo's asks again with backoff
on a 5xx, so the chat looked hung. The real Claude Code 2.1.309 in an
untrusted folder (sandbox HOME, copied account) ends the helper in 1.3s
with that line.

Fix: startTrusted runs startRun, and when the helper ended over the
trust question (its stderr read to the end, saidOnEnd) in the caller's
folder under the user's own account, remembers that folder for 10
minutes (passedOver) and starts the run once more in magpie's own folder,
told the caller's (envElsewhere), as a caller on another computer is.
Only one retry: a second refusal is returned as before. The saved-session
retry in start goes through startTrusted too.

Run (mote, at this tree):
- go test -run 'Claude|MCP|Bridge' ./internal/gateway: ok
- TestClaudeTUIUntrustedFolderAnswered: ok

Broken by hand: saidOnEnd returning false made the new test red (502
"exited before it answered magpie's initialize request ... trust the
folder"); passedOver turned off made it red with the same 502 after one
retry. An earlier draft that retried through start itself looped forever
with passedOver off; the retry is bounded to one since.

Not tried: a real gateway turn from paseo; the real helper and Claude
Code were run on each side of the retry (untrusted folder ends at once;
a trusted magpie folder answers), not through a live gateway. A user who
trusts the folder within 10 minutes still runs in magpie's folder until
then.

At the pushed head's tree, on origin/main 79f83798f (which has 2b52302dc,
crosscn's 400KB fix), on mote: gofmt -l is clean, and go vet
./internal/... is ok for darwin, windows and linux. go test -timeout 45m
./internal/claudetui ./internal/claudebridge is ok. ./internal/gateway is
ok except TestCodexPoolSaysTheClientsVersion, which fails the same way in
a gateway run at origin/main 79f83798f itself and passes alone at both
(#4807, filed here). The conflict with main's tuiRefusal and replay change
in start() was resolved by keeping main's req.told and calling
startTrusted. Before the rebase, the three packages were ok on
magpie-desktop (Linux) too.
2026-11-01 23:47:47 +08:00
yetone bee3ea6753 claudetui: the first message waits for Claude Code to list magpie's tools (MinhuWang on X)
MinhuWang (X, 2116836405548916907): in the interactive mode the first
message can go before MCP has loaded, and then has none of pi's tools.

Cause: the helper's ready() took the drawn "❯ " prompt as ready. Claude
Code connects its MCP servers beside the prompt, so a message pasted at
once was answered with no mcp__magpie__ tools. Reproduced with the real
Claude Code 2.1.309 (sandbox HOME, a copy of the owner's account): an MCP
server held 8s before answering initialize got "NOTOOL" for "what is the
secret word, use your tool".

Fix: startRun gives claude-mcp-helper a third argument, a `listed` file in
the run's temp folder, which RunMCP writes after it has answered
tools/list. The helper finds that path in the run's --mcp-config
(mcpListed) and ready() waits for it as well as the prompt, inside the
same ReadyWait (45s); past it the run ends saying the tools weren't
listed. Runs without that server (warm-up, model test) don't wait.

Run (mote, at this tree):
- go test ./internal/claudetui ./internal/claudebridge: ok
- go test -run 'Claude|MCP|Bridge' ./internal/gateway: ok
- real Claude Code 2.1.309 here, a sandbox HOME with a copy of the
  account's credentials, the new helper and the real claude-mcp-helper
  behind an 8s sleep: initialize answered at 12.7s, the first turn called
  mcp__magpie__pi_secret and answered "The secret word is PELICAN".
  Without the sleep: answered at 2.1s, same answer. 2.1.309 sends
  server/discover before initialize; the helper's method-not-found answer
  is taken and initialize follows.

Broken by hand: toolsListed returning true made
TestShimFirstMessageWaitsForTools red ("echo: hello (without magpie's
tools)"); RunMCP not writing the file made TestToolsListedFileWritten
red.

Not tried: Claude Code in WSL (the path is the gateway's Windows temp
path, handed to magpie.exe as the callback path is); a Claude Code that
lists tools only on its first request (2.1.309 lists them at start),
which would now wait 45s and fail saying so instead of answering
without tools; the full gateway suite (run after the next commits).
2026-11-01 23:26:57 +08:00
yetone 79f83798fd kiro: the mover installs 0.1.25, which shows bonus credits on the Usage card (plugins#602)
kiro 0.1.25 is on registry.npmjs.org (npm view --registry
https://registry.npmjs.org: 0.1.25, shasum
00882472feb467e0ecb59da3c364bda423c5f12f). It is plugins#602
(GiantGKL), squash-merged as 6053811 in magpie-community/plugins:
bonus credits (a first upgrade's 500 trial credits, a promotion's)
show as aside windows of their own, with when they lapse, and a month
used up while a bonus has credits left is shown only too, since Kiro
spends the plan's credits first. keepMovedCurrent brings every moved
Kiro user to it.

Run on mote:
- at 276c806db + this change: gofmt -l, go vet ./..., GOOS=linux go
  vet -tags nogui ./..., GOOS=windows go vet ./..., go build ok;
  go test -tags nogui -timeout 45m ./...: 85 packages ok, and 3 reds,
  all on main already and filed: TestKeysAreWhatTheSaveWrites and
  TestSettingsCLISetsWhatTheWindowSaves (#4793, since da275848b's
  trayNoNumber), TestEveryRouteHasACommandOrIsNamed (#4794, since
  8826a15ea's /api/quit).
- rebased on 8569f39f6 (internal/provider changed: Zed's min), at
  this head: gofmt ok, go vet of internal/provider for darwin, linux
  and windows ok, go test -count=1 ./internal/provider ok (104s,
  TestKiroMoverHasTheTooLongFix holds with 0.1.25), internal/cli and
  internal/settingsapi the same three reds.

Not tried: a real Kiro account moved to 0.1.25 through magpie; the
plugin's own suite and its tests broken by hand are on plugins#602.
2026-11-01 23:11:28 +08:00
yetone 8569f39f6c agent: Claude Code's /model hides its own lineup while magpie's list is narrowed
yyhhyyyyyy on Discord picked only a routing group's models for Claude Code
on the Agents page, and Claude Code's /model still listed a model they had
not picked. Real Claude Code 2.1.316 in a sandbox HOME, with the settings
magpie writes, lists: Default, the group (as Custom Opus), Claude Code's
built-in "Fable 5.1" row, then the group as Sonnet and Haiku, then
magpie's modelPicker rows. The Fable row is Claude Code's own lineup.
magpie leaves ANTHROPIC_DEFAULT_FABLE_MODEL unset for a main model that
isn't a Fable (#2090), so Claude Code shows its own Fable there. The
gateway's /v1/models already follows the picks (CatalogFor), and Claude
Code's gateway discovery is off unless
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY is set. Neither of those is
where the row comes from.

Claude Code's documented modelPicker.replaceBuiltInOptions hides the
lineup and leaves Default and magpie's rows. In the same sandbox, the
same settings with the flag set list exactly those rows. magpie already
set the flag while "Show Claude Code's own models" is off (#4548). It now
also sets it while Claude Code's list leaves out some of magpie's
catalog: only the picked models, some taken out one by one, or a
visibility of families (claudeNarrowed, CatalogFor's hidden list). A
change to the picks already rewrites settings.json through
catalog.Touched and Sync.

The user's own values:
- A user's ANTHROPIC_CUSTOM_MODEL_OPTION, in the settings env or the
  shell, keeps the lineup. The flag would hide that row too.
- availableModels was not used. It also hid the Fable row in the
  sandbox, but it is the user's key, it blocks --model, and it is meant
  for enforcement.

Run at this head (rebased on origin/main 2503520f8), on mote:
- gofmt -l: clean.
- go vet ./..., GOOS=linux go vet -tags nogui ./... and
  GOOS=windows go vet ./...: ok.
- go test -tags nogui -timeout 45m ./...: internal/agent ok, along with
  84 packages. Three packages are red, all on main and filed:
  - internal/settingsapi TestKeysAreWhatTheSaveWrites and
    internal/cli TestSettingsCLISetsWhatTheWindowSaves (trayNoNumber,
    #4793);
  - internal/cli TestEveryRouteHasACommandOrIsNamed (/api/quit, #4794);
  - internal/gui TestRestartHandsTheGatewayOver (#4167, #4107).

Broken by hand:
- On the old claude.go, TestClaudePickerNarrowedListReplacesLineup fails:
  "glm-5 taken out: ... replaceBuiltInOptions=false".
- With the custom-option guard forced off, it fails on the user's
  ANTHROPIC_CUSTOM_MODEL_OPTION step.

Not tried:
- A real magpie writing settings.json for the real Claude Code. The
  sandbox used hand-written settings of the same shape, with the base URL
  on an unused port and no sign-in.
- Claude Code in WSL. claude@wsl takes the same writePicker path.

No GUI file is touched, so no GUI run.
2026-11-01 23:00:10 +08:00
yetone 2f4c088dce usage: Warm up on a Codex or Claude account's card whose 5 hours haven't started
01huadalang on Discord looked for a way to start one account's 5-hour
countdown on the Usage page, not in Settings. A Codex or Claude account
card whose 5-hour window isn't running now has a Warm up (预热) button on
its account line. It sends the request Settings › Warm-up's Warm up now
sends (POST /api/warm-now {agent, user}), to that account alone: for a
ChatGPT account the scheduled warm-up's one "hi" with the account's own
sign-in, on its cheapest model at low effort (warmModel); for a Claude
account Claude Code's own run on haiku (WarmClaudeVia), so magpie sends
nothing that imitates Claude Code. No new server code.

When it shows: the account is one magpie is signed in to (codexUsers /
claudeUsers), its read has no error, and its 5-hour window is idle as the
scheduled warm-up tells it (idle in codex_warmup.go): nothing used and the
reset a whole window away (within warmSlack), or the reset gone by. A
Claude account never used has no window read and shows it too, as
claudeWindowsExpected fills in; a Codex account with no 5-hour window
doesn't. While the request is out the button is disabled (busy), so a
second press sends nothing; once it went, the account's button stays away
for warmSlack (10 minutes), the time a just-started window still reads as
idle, and the quotas are read again (the server marks the account stale).
Refused, the vendor's reason goes in the status line and the button
comes back. Words in en, zh, zh-TW, ja, de (the tooltip is new; the
button and status lines reuse Warm up now's).

Run (at the head before the last rebase onto 09d5dfb87, which changed no GUI asset or internal/gui file, unless said):
- quota-warm.test.cjs (new), on mote: 20 of 20 pass, Chromium and
  WebKit, en/zh/zh-TW/ja/de, 1100px and 390px. On origin/main with only
  the test copied in, 10 of 10 Chromium cases are red (no button.acct-warm).
- Broken by hand: the 10-minute hold taken out (now - busy < 600e3 ->
  false): red 2 of 2 (the button comes back after the warm-up).
- go test ./internal/gui/... ./internal/provider on mote (before the last
  rebase onto df03aeb35, which touched none of these files): provider ok;
  gui red only in TestMainWindowCorners/macOS_26_SDK, #3949 (macOS 27).
- 25 GUI files near the change on WSL (account-mask, privacy-hides-accounts,
  quota-*, usage-fold/-pack/-accounts/-keys/-card-refresh, warm-now,
  codex-auto-reset, tray-cell-click, panel-usage, i18n-keys, gui-de/-ja/
  -zh-tw ...): i18n-keys caught a comment saying Library's "Not running",
  fixed. The other reds are the same on origin/main 85e37162e run the
  same way: usage-fold "most on one screen", tray-cell-click and
  codex-auto-reset webkit de (filed #4790), warm-now 440px (#4322).
- The whole GUI suite was started at this head on mote (concurrency 3,
  another session's suite beside it); it was not finished at push. One
  red by then, account-eye chromium zh-TW (opacity '' read before the
  styles), which passes 15 of 15 alone on WSL; its fixture's windows are
  used, so no Warm up is drawn there.

Not tried:
- A real account's warm-up from this button. The request is Warm up
  now's, whose own commit (1801c96bf) didn't try a real account either;
  a Codex sign-in copied into a sandbox can rotate the live refresh token,
  and a Claude one lives in the Keychain.
- The tray panel's Allowances, which draws the same account line.
2026-11-01 22:50:45 +08:00
yetone 09d5dfb87b gateway: aliased and magpieAliasAsked read one alias parser (#4667)
magpieAliasAsked copied aliased's four prefixes; a fifth form added to
one would leave the other behind. Both now read aliasDigits.

Run: targeted alias/member/desktop/science tests, gofmt, vet x3 (mote).
2026-11-01 22:44:23 +08:00
ggbdpq 3d64d6c52f gateway: a reply to one of magpie's own aliases keeps the vendor's model name (#4667)
leizh007: with Claude Code Desktop served through magpie, ccusage counted
the model as "magpie-2213244526.anthropic…" from the 11-01 release on;
before it said the subscription's own "opus-5-5".

The asked-name rule (9bb1efdde) names a reply after the model the agent
asked for whenever the request went out under another name. Claude
Desktop's effort-picker aliases (fb1575730) made Desktop's Code tab ask by
such a name: magpie-<n>.anthropic.claude-opus-5-5, mythos-magpie-<n>,
anthropic/magpie-<n>, Claude Science's claude-magpie-<n>. The vendor is
asked under the model's own name, the reply came back under it, and the
rule wrote the alias over it — into Claude Code's usage records, where
ccusage counts each model by the reply's name. An alias is magpie's
deployment name, not a model id any vendor knows.

Now a request that came in under one of those aliases is served the
vendor's own name, as every reply was before the asked-name rule. The
recognition is the alias shape alone (magpieAliasAsked), not a catalog
lookup: a session saved on an old alias is served all the same, and its
reply keeps the vendor's name too. MemberModel and X-Magpie-Response-Model:
member are untouched — an explicit ask for magpie's id still says it. The
usage ledger still records the catalog id asked for and the vendor's name
as served.

Run (this head on dfe868a1e, upstream/main):
- go test -tags nogui -count=1 ./internal/gateway: ok (573s). The new
  TestReplyToMagpieAliasKeepsVendorName (10 subtests: the four alias forms
  and [1m], streamed and not) was red before the fix — every subtest had
  the reply naming the alias — and TestReplyNamesAskedModel,
  TestReplyNamesMember, TestGeminiReplyNamesAskedModel, TestMemberLine,
  TestMemberLines stay green.
- Ablation (product files back at the parent, test kept): 11 failures,
  all "the reply names <alias>, want the vendor's opus-5-5".
- go test -tags nogui -race -count=1 on the member and alias tests: ok.
- gofmt -l clean; go vet -tags nogui ./internal/gateway clean;
  GOOS=linux and GOOS=windows vet clean.
- Builds: darwin arm64 (cgo warnings in internal/gui pre-existing),
  linux and windows with -tags nogui, the Makefile's own cross-compile
  form (Makefile line 105).

Sibling faces checked: the alias constants are constructed only in
desktop.go and science.go; aliased() serves resolution (unprefixed) and
GUI display, both of which need the catalog, unchanged; the memberWriter
is the one writer of reply names and this gate covers it; the Responses
WebSocket path never carries a Desktop alias (Codex-side ids).

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-01 22:44:23 +08:00
yetone 567b648bd8 gateway: test #4445 on the reporter's route, Codex's ChatGPT backend path
The reporter's turn came to magpie's /backend-api/codex/responses, with
the Model Map plugin naming remote-magpie/codex/gpt-6.1-sol; the patch's
test asked on /v1/responses only. TestRemoteMagpieCodexModelKeepsLiteOnCodexPath
asks the same Lite request on CodexPath.

Run (mote, at this tree, -tags nogui):
- go test -run TestRemoteMagpie ./internal/gateway: ok
- with additional_tools.go and gateway.go put back as on origin/main, the
  new test is red with the report's 400 ("Office:
  X-OpenAI-Internal-Codex-Responses-Lite requires `reasoning.context` to
  be `all_turns`."), as is the patch's own /v1 test.
2026-11-01 22:44:23 +08:00
ggbdpq 1ff928139d gateway: a remote magpie's codex model gets Codex's Responses Lite as it was sent (#4445)
What changed: a Codex Desktop turn on one of its own Lite models (gpt-6.1-sol)
routed through Model Map to a Remote Magpie provider answered 400 "Remote
magpie: Codex: X-OpenAI-Internal-Codex-Responses-Lite requires
`reasoning.context` to be `all_turns`". liteKept treats a Remote Magpie like
any plain Responses upstream, so passthrough ran fromLite (the additional_tools
item lifted into tools, reasoning.context taken off) and forwardOnce dropped
the Lite header. The remote serves codex/<model> through its ChatGPT account,
which passes on what it got, and the ChatGPT backend refuses a request for one
of its Lite models without reasoning context "all_turns" (#534): the request
arrived stripped of exactly what that model demands. Had it gone as Codex sent
it, the remote's account path keeps the Lite shape (liteKept true there) and
its answer is 200, as the reporter's codex=as-sent workaround showed.

liteKept now also keeps the shape, with the model it is asked for: a Remote
Magpie's codex model, named codex/<model> — the ChatGPT account's namespace in
every magpie's catalog, so the remote lists one only when that account is there
to serve it. Its other models still get what Codex sends a model that isn't
Lite (#350), header and reasoning context included in the lift (#350, TangForX).

Run: go test -tags nogui -run 'TestRemoteMagpieCodexModelKeepsLite|
TestRemoteMagpieOtherModelLeavesLite' ./internal/gateway/ — the first failed
with the 400 above before the change and passes after; the second keeps the
old behavior. go test -tags nogui ./internal/gateway/ passes.

Fixes #4445

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-01 22:44:23 +08:00
ggbdpq 6de04a26e2 gateway: a Codex memory call on its own bare name follows the session when a provider serves a model under that name too (#4765)
raphael-y7: with magpie as Codex's model provider, the conversation on
orbis/gpt-6.1-sol, Codex's memory consolidation — its own background
request on its own default consolidation model, asked by its bare name
gpt-5.6-terra — went to workbuddy-ai, the only provider of magpie's with
a model under that name, and the account it landed on refused it: 400
"model [gpt-5.6-terra] is not allowed for user type
[personal_free_user]", three tries, 8.5s, and the memory was never
written. The bare name resolved, so codexMemoryStandIn (#742) left the
call where it stood; a model of Codex's own asked by its bare name is
not a pick of whichever provider has one under that name.

Now a memory call whose bare name resolves still follows the
conversation's model, as it does on the ChatGPT backend's path
(codexFollowTo), when Codex's config names no model for its memories:
codexMemoryStandIn asks codexMemorySession first and only falls through
to the name's own resolution when there is none to follow. What keeps
going as the name resolves: any other call, a model Codex's config
names (the user's own pick, a full id or a bare name), a config magpie
can't read, and a conversation magpie has no model of (on Codex's own,
or nothing answered yet).

What this doesn't change: the three tries on a capability refusal, and
the model catalog's exposure of a model an account can't serve — the
reporter's other two suggestions, both a bigger cut; the auto-review's
codex-auto-review and the app's title, description and summary calls,
whose as-Codex-sent default is deliberate (codexTitlesTo, codexSideTo;
shruru counts a provider serving a luna-named model picking titles up
as a feature, #4590).

TestCodexMemoryOnACollidingBareNameFollowsTheSession: a provider with a
model under gpt-5.6-terra, the conversation on another provider's — the
memory call followed the conversation and the named provider got
nothing (red before: it got the memory); the config's pick and a plain
turn on the name still go to it. Run (darwin arm64, -tags nogui):

- go test -tags nogui -run 'TestCodexMemoryOnACollidingBareNameFollowsTheSession|TestCodexMemoryCallsGoWhereItsTurnsGo|TestCodexMemoryStandInFollowsTheSwitch|TestCodexMemoriesFollowTheSession|TestCodexSideCallsKeepTheConfigsModel|TestCodexSideCallsBeforeTheFirstTurnFollowTheSwitch|TestCodexOwnModelOnMagpieThreadGoesOnSignIn' ./internal/gateway: ok (the new test was red before the fix, with the report's routing)

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-01 22:44:23 +08:00
yetone 206efc90c8 gateway: a Codex side call with no setting still goes on Codex's sign-in (#4590 review)
e99e75dab took every side call on one of Codex's own models (title,
description, summary, prediction) off Codex's ChatGPT sign-in. With no
setting naming a model, codexTitlesTo and its siblings hand back the
bare model Codex asked for, which magpie serves nothing for: a user
signed in to ChatGPT whose titles worked through the sign-in got
"magpie knows no model \"gpt-6.1-sol\"" 404 for every title,
description, summary and prediction. A thread's summary has no setting
at all, so it always went that way.

Now only a side call whose setting names where it goes (CodexTitles,
CodexDescriptions, CodexPredictions: a model or "off") stays off the
sign-in (codexSideSet); without one it goes on the sign-in as before.

Run (mote, at this tree, -tags nogui):
- TestCodexSideCallOnOwnModelUnsetGoesOnSignIn (new: signed in, no
  setting, each of the four kinds): red on e99e75dab, the 404 above for
  all four; green now.
- go test -run 'TestCodexSideCallOnOwnModel|TestCodexOwnModelOnMagpieThread|
  TestCodexTitlesSetting|TestCodexTitleOnMagpieProvider|
  TestCodexDescriptionsSetting|TestCodexDescriptionFallbackOnMagpie|
  TestCodexPrediction|TestCodexSummar' ./internal/gateway: ok
- broken by hand: codexSideSet always false turns gua's
  TestCodexSideCallOnOwnModelNotPutOnSignIn red (the reporter's 404);
  always true turns the new test red.
2026-11-01 22:44:23 +08:00