Commit Graph
8700 Commits
Author SHA1 Message Date
yetone d2fa7d8d79 sessions: an Antigravity app conversation shows what was said, not only its title
@yansheng1003 on X: the Sessions page showed an Antigravity 2.0
conversation's title and preview only. HasTranscript left "antigravity"
out, since conversations/<id>.db's step text is encrypted at rest, so
the row had no Show conversation and /api/sessions/transcript said
"this agent's conversations can't be shown".

The app also writes every step in plain text beside the database:
brain/<id>/.system_generated/logs/transcript_full.jsonl in the same
store, in agy CLI's format (user input, planner responses with their
tool_calls, tool results). Antigravity 2.30's language server writes it
in the stable store and in Insiders' (both checked: run in a sandbox
HOME on Windows against a fake model that called read_file).

- transcript.go: antigravity has a transcript; readTranscriptOf reads
  it through agyTranscript (antigravityTranscriptOf), so the viewer,
  TranscriptAt, search, the said index and the Markdown export all get
  it. A conversation with no transcript file is ErrNoTranscript, as
  before.
- antigravity_app.go: antigravityTranscript derives the path from the
  database's (stable, Insiders, a WSL distro's); its size and time are
  folded into the session file's with the -wal's, so a step it adds
  reads the session and the said index again.
- search.go: linesFile is false for antigravity, so the encrypted .db is
  never pre-scanned for the words.
- testdata/antigravity-2.30-tools: that real conversation (db with the
  WAL checkpointed, summary row, brain/ logs).

Tests: TestAntigravityAppTranscript (stable, Insiders, WSL: parts, search
hit and miss, Markdown), TestAntigravityAppNoTranscript,
internal/gui TestSessionAntigravityConversation (/api/sessions marks it,
/api/sessions/transcript gives the five parts).

Run: on mica (mica-run) at base de5fc6700:
- gofmt -l internal/sessions internal/gui: clean.
- go vet ./internal/sessions ./internal/gui, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet on the same, go build .: ok.
- go test -count=1 -timeout 45m ./internal/sessions: ok but for
  TestWSLAgentsGoneListingDrops (load ~48; fixed at its cause in the
  commit before this one); go test ./internal/gui: ok (299s).
- After that fix: go test -run 'WSL|Antigravity|Agy|Gone'
  ./internal/sessions ok; GUI files sessions-talk, -talk-sheet,
  -talk-model, -export, -said, -subagents, -reads, -search, -convert:
  168 of 168 in Chromium and WebKit.
- Old code (de5fc6700 with only the new tests and testdata):
  TestAntigravityAppTranscript red in stable, insiders and wsl ("the
  session isn't marked readable"), TestSessionAntigravityConversation
  red ("listed with no conversation to show ... Transcript:false").
- Windows (win-run on xiaomi-gpu): TestAntigravityAppTranscript (3
  subtests) and TestAntigravityAppNoTranscript pass.
  TestAntigravityAppFolder is red there at the base as well (#5957).
Rebased onto bfddc9cfb, on mote (mote-run) at this tree: gofmt clean,
the three vets and go build ok, go test -count=1 ./internal/sessions
./internal/gui ok (56s, 157s).
Not tried: the real GUI window opening this conversation; the API and
page are covered by the tests above.
2026-11-18 18:55:46 +08:00
yetone 65c9a2e411 sessions: the WSL tests wait for the distro's first listing, however busy the machine
TestWSLAgentsGoneListingDrops went red in a run of internal/sessions on
mica at load ~48: "answered=true: want 7 sessions, got 0". The first
List waits at most wslFirstWait (3s) for the WSL walk, as the Sessions
page should, and on a busy machine the walk outlasts it, so the count
read nothing yet. Every test built on wslDistro counts that first
listing (TestWSLSessionsListed, the Antigravity and Kimi WSL tests), so
wslDistro now gives it a minute; TestWSLFirstWaitIsWaitedOnce still sets
its own 500ms after.

Broken by hand: a 3.5s stall in WSLHomes gave the same red, "got 0",
without this change and passed with it (mica-run, -run
TestWSLAgentsGoneListingDrops). Alone, unstalled, the test passed 5 of
5 on the old and new code.

Run: on mica (mica-run): go test -count=1 -run 'WSL|Antigravity|Agy|Gone'
./internal/sessions ok; gofmt clean. The full internal/sessions run
where it went red is in the next commit's record.
2026-11-18 18:55:46 +08:00
yetone d747549700 gateway: a system message between a call and its result goes after the result (wizcheu on X)
Claude Code puts {role: "system"} messages into messages[]: a turn's
effort (output_config), a steer the user sent while a tool ran, a
deferred tool's tool_addition. One can stand between an assistant's
tool_use and the user message holding its tool_result. DeepSeek counts
it as the next message and refuses the request, 400 "messages.N:
`tool_use` ids were found without `tool_result` blocks immediately
after", and every later request of the conversation carries the same
history (Claude Code: "400 due to tool use concurrency issues").

The relay's mend made it worse. pairedMessages (toolBlocksPaired) read
the system message as the turn after the call: it gave the call a
synthetic result inside the system message, and the real result in the
user message after it became text. A system message can't hold a
tool_result, and withSystemOnTop or withoutTurnEffort then dropped it,
so the call stayed unanswered. pairToolMessages (Chat relays and
builds) did the same: synthetic tool results, then the real ones as
user text.

Now a system or developer message that stands between a call and its
results is held and goes after the results (after the synthetic ones
when none came). The real result stays a result. A body that already
pairs comes back byte for byte. The translated routes were already
safe: responseInstructions turns a mid-conversation system message into
user text, and mergeTurns joins it with the results' message.

Checked against api.deepseek.com/anthropic with a real key on
2026-11-18: a system message (text, empty effort, or string) between
the call and its result gives 400. Magpie's old output gives 400 too.
The same system message after the result gives 200.

Tests: TestSystemMessageBetweenCallAndResult sends the reporter's turn
(thinking, text, tool_use call_00_jdrDF4PKrnFwMUMBRQlr4516) with each
of five system-message shapes between the call and its result. It goes
through /v1/messages to a fake DeepSeek that enforces the same rule.
TestSystemMessageFollowsTheResults covers pairedMessages directly,
including byte for byte when already paired.
TestChatSystemMessageBetweenCallAndResult covers pairToolMessages and
toolPairsOut. All three fail on the old code (all 11 subtests red at
534b85bf9) and pass with the fix.

Run on mote:
- go test ./... -timeout 45m at 1d7f0b3a2 (this change on 534b85bf9):
  103 ok, no FAIL.
- GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...: ok.
- gofmt -l: clean.
- After rebasing onto bfddc9cfb (which touched internal/gateway),
  go test ./internal/gateway again: ok (964s) at 516f40c43.

Not changed: pairToolItems (Responses). DeepSeek serves no Responses
API.
2026-11-18 18:40:49 +08:00
yetone 8634c4ad08 library: a repository's card counts the skills its sheet lists once the repository is read
bdefdc319's repository card counted the skills skills.sh lists, while
its sheet, once Find skills' probe had read the repository, listed what
the repository holds: mattpocock/skills read 55 on the card and 39 in
the sheet, a number that changed on click.

A repository's read is now kept for the session (repoRead). Once it is
read, the card behind the sheet says the sheet's count at once, keeps
it when drawn again, and takes its Added from the read too; reopened,
the sheet lists the read repository straight away, the skills just
installed greyed, while it is read again. A later read that fails keeps
the one before; one with no SKILL.md drops it.

Run (mote, at origin/main e199eb9c7 + this):
- market-repo.test.cjs: 20 of 20, chromium and WebKit, five languages,
  420px. It now checks the card's count after the read, after the
  install's redraw, and the reopened sheet. With the card counting
  skills.sh's list again by hand, all 5 chromium first cases red.
- Every market-* file and i18n-keys: 132 of 132.
The whole GUI suite runs after the push, with bdefdc319's.
2026-11-18 18:33:34 +08:00
yetone e199eb9c79 codex: the Codex app's picker puts a ChatGPT model its list lacks where the order put it (Wangalan167673 on X)
Wangalan167673's Order tab (Codex's list on the Agents page) had GPT-6.2
Sol and Astra third and fourth, and the Codex app's picker had them last,
"GPT-6.2 Astra · Codex", after every other provider's models.

The app's list (model_catalog_json, gateway.CodexDesktopCatalog) is the
ChatGPT backend's list asked for the app, then magpie's models. A model
of the account's own that the app's list lacks yet (GPT-6.2 beside a list
asked before it came, CodexListedBeside) is handed by magpie's id,
codex/<slug>, which is where the "· Codex" comes from. provider.CodexOrder
mapped an own model of the order only to its bare slug, as the backend
lists it, so the codex/ entry matched nothing in the order and went after
every model the order names. It now maps both the bare slug and the
entry id. Groups and other providers' models were already matched by id.

The Codex app reads the file at its start, so an order changed while it
runs reaches its picker after it is restarted.

TestCodexDesktopCatalogInUsersOrder (gateway) builds the reporter's list:
GPT-6.1 Terra and Sol in the backend's list for the app, GPT-6.2 Sol and
Astra only in the account's own list, three routing groups and four
models of an agy-cli provider, in the reporter's order. Red on the old
code: "got [gpt-6.1-terra gpt-6.1-sol group/code-daily ... agy-cli/
claude-sonnet-5.5 gpt-6.2-sol gpt-6.2-astra]"; green with the fix.

Run on mica at 230feb5b2 (base 1bfa8d5a1): go vet of provider and
gateway for darwin, GOOS=linux -tags nogui and GOOS=windows; go test
-count=1 -timeout 45m ./internal/provider ./internal/gateway
./internal/codexcat, ok. After the rebase onto bfddc9cfb (71b8ab46c
changed gateway): go test -count=1 -run Codex of the three packages, ok;
gofmt -l clean.
Not run before the push: the full suite. mote and mica each had another
session's full suite running; it is queued on mote behind that one and
its result is reported with the release.
Not tried: a real Codex app with this build. No GUI change.
2026-11-18 18:23:25 +08:00
yetone bfddc9cfba routing: DimCode's requests read as DimCode, with its mark, by key too
Yayoi_no_yume on X, a Docker magpie (v0.1.4350): DimCode (dimcode.dev)
on another computer, calling with a gateway key named "Magpie", drew
the Routing page's client node as the cube and "Magpie", and the
request's story said "DimAgent asked for the routing group Step 5
Preview".

Two causes:
- DimCode was no client magpie knew, so usage.AgentOf named it by its
  product name: npm's dimagent 0.5.29 sends "DimAgent/<version>" to a
  provider set to send its identity (resolveDimOAuthIdentityHeaders)
  and "DimCode/<version>" otherwise (read from the published binary).
  A client "dimcode" (DimCode, UA dimagent/dimcode) now names it,
  apart from the Dim alpha magpie starts ("dima"/"dimcode-alpha" stay
  Dim's, by name first). Its icon is dim-color: dimcode.dev's favicon
  (dimagent-favicon.svg, "Official DimAgent mark") is the same artwork.
  Routes and ledger records kept before are named again through
  AgentOf (Route.routedAgain), so old "DimAgent" rows read as DimCode.
- A keyed request's node read the key's name alone (eadc6cdb9, for a
  script's key behind "Python-urllib"). An agent magpie knows now
  reads "agent · key", as Usage's ledger rows already do; a script's
  key keeps the key's name alone. The tooltip names the agent once.
  The tray panel's stage and rows share callerName and read the same.

The icon comes from the embedded assets, which the web (Docker) build
serves the same way; the GUI test checks the image loads.

Run on mote:
- go vet ./internal/agent, GOOS=linux -tags nogui and GOOS=windows:
  ok. go test -count=1 ./internal/agent ./internal/usage: ok (agent 463s, usage 124s)
- TestDimCodeByUserAgent is red with the dimcode entry taken out
  (AgentOf("DimAgent/0.5.29") = "DimAgent").
- GUI, chromium and webkit, every language, 1100 and 420:
  routing-agent-with-key.test.cjs (new), i18n-keys, i18n-en-no-cjk:
  30 of 30 pass. Earlier, on mica, with the same client.js: the 28 other
  files that read callerKey, .rt-src, .ps-name/.ps-ag or .pr-who pass
  but api-key-usage (#7083) and usage-ledger's return-to-live case
  (#5048), both red on origin/main 2416beed6 too.
  routing-agent-with-key is red on the old client.js ('Magpie' for
  'DimCode · Magpie').

Not tried: a real DimCode against a real Docker magpie; the
User-Agents come from the published binary and the reporter's log.
2026-11-18 18:03:16 +08:00
yetone bdefdc3191 library: a repository's skills on skills.sh are one card, opened to install all or a few (Ethereal499 on X)
skills.sh lists a repository's skills one by one, so mattpocock/skills
showed as 55 cards side by side in Library > Skills > Discover. Two or
more listed from one repository are now one card, the repository, where
its first skill comes in the list: its name, how many skills the list
has, their names and their installs summed. magpie's own featured skills
and a repository with one skill listed keep their own cards. Only a
skill's own card asks for its about.

Opened (the card or its Choose...), the sheet shows the list's skills at
once, ticked, and reads the whole repository through Find skills' probe
(library/skills/probe): once it answers, every skill the repository holds
is listed, the list's still ticked, the ones the library has greyed, with
Select all and a filter past 8. Install takes the picked paths in one
skills/install. A repository too big to read whole (#2794) keeps the
list's skills, with the reason, and installs each as its card's Add does
(market/skill). The "in the library" list already groups skills by
repository (skillGroups), so it is unchanged.

Strings in zh, zh-TW, ja and de. No backend change.

Run (mote, at base 54117164c, which has the library plugin and GUI
tests as origin/main 2416beed6 has them):
- market-repo.test.cjs (new): 20 of 20, chromium and WebKit, five
  languages, 420px. With entriesOf's grouping turned off by hand, all
  10 chromium cases red.
- Every market-*, library-*, skill-* and i18n-* file (--test-concurrency=4,
  mote at load 40 to 67 with another session's GUI suite): 2434 of 2494.
  The reds' files, run again at base without this change: library-open-
  again (#6751), skill-fold-all (#6667), skill-group-shared (#6687) and
  skill-manual (#6668) red the same there. skill-where's "the switch
  scrolls nothing" (#5859) was red at base too, 2 of 4 runs interleaved
  with this change's. library-bili-settings (webkit zh-TW timeout) and
  market-have (chromium zh mcp mark, #4620) passed run again with it.
- go test -count=1 -timeout 45m ./internal/gui: ok.
- Real use: library.MarketSkills("mattpocock") in a sandbox HOME lists
  55 from mattpocock/skills and 39 from devcxl/mattpocock-skills-zh, and
  ProbeSkills("mattpocock/skills") reads 39 skills.

Not run: the whole GUI suite (mote had another session's running, mica
at load 63 on 12 cores); it runs after the push. Not tried in the real
app window or on Linux WebKitGTK; no motion was added.
2026-11-18 18:01:37 +08:00
yetone 71b8ab46c1 gateway: Codex's compaction on Open Design goes without empty tools, and its upstream_error is asked again (Mugenrikka on X)
Codex compacting on any Open Design model got 400 "[code=upstream_error]
Provider returned error" from amr-link, while other providers compacted.
Codex's compaction is its one request with "tools": [], and the summary
ask adds tool_choice and parallel_tool_calls beside them (#292). Since
plugins 0.1.13 / 48f976402 the Responses body is relayed to amr-link as
written, and an OpenAI-style validator refuses empty tools and a lone
tool_choice.

- passthrough: a Responses request to Open Design (its plugin, or a
  provider at amr-link.open-design.ai) goes without an empty tools list
  and the tool_choice/parallel_tool_calls beside it (withoutEmptyTools).
  A body that declares a tool is unchanged; every other upstream is sent
  Codex's shape as before.
- codexCompact: amr-link's "[code=upstream_error]" counts as
  upstreamFailed, so a summary still refused is asked as sent, then as
  text, then made locally, never handed to Codex as the 400.
  upstreamFailed is only used by the compaction ladder.

Run (mote; the suite at 54117164c, then rebased on 1bfa8d5a1 and
-run 'OpenDesign|Compact' ./internal/gateway run again there: ok):
- TestOpenDesignCompactionSendsNoEmptyTools and
  TestOpenDesignCompactionRefusedAsksAsText, built from Codex Desktop
  26.1007's real compaction (testdata/codex-26.1007-compaction.json)
  through the fake plugin as opendesign: both red on the old
  gateway.go/codex_backend.go with the reporter's 400, green with them.
- go test -run 'OpenDesign|Compact|LoneToolChoice|ToolsOff' ./internal/gateway ok.
- go test -timeout 45m ./...: every package ok.
- go vet (darwin), GOOS=linux -tags nogui and GOOS=windows vet of
  internal/gateway ok; gofmt -l clean.

Not tried: a real Open Design account (none here). Which of the empty
tools, the lone choices or the history's calls amr-link refuses is not
confirmed; the second change covers whichever it is.
2026-11-18 17:58:02 +08:00
yetone 1bfa8d5a18 gateway: the Codex app's list is asked again when the account lists a model it lacks (ANAGABRIELRLki on X)
OpenAI released GPT-6.2 Astra on 11-17. Beside a ChatGPT sign-in, the
Codex app's picker reads magpie-desktop-models.json
(model_catalog_json). That file is the ChatGPT backend's list,
which magpie keeps in memory (codexDesk) and asked for again only on a
sync, once it was an hour old. ANAGABRIELRLki's app had no GPT-6.2 until
they took the line out. The owner's machine shows the same class: the
account's own list (KeepAccountsListed, fetched 14:36) has gpt-6.1-terra
and gpt-6.1-sol, while the desk file and the gateway's
/backend-api/codex/models, asked as 0.165.0, have neither.

The list is now due (codexDeskDue) when any of these holds:
- it is an hour old (as before);
- it was asked for an older Codex version than magpie asks as now
  (provider.CodexVersionBehind; the backend lists a model only to a
  client new enough for it);
- the sign-in's own list magpie keeps (provider.CodexSignInListed) is
  newer and has a model the kept list doesn't.

A loop on the serving magpie (KeepCodexDeskFresh, every minute, only once
Codex has asked for the list) asks when it is due, and the rewrite reaches
the file through CodexDesktopChanged, as before. A failed ask is still
tried again after codexDeskRetry. Users with the old file get it rewritten
on the first answer after start (no list kept, as before) and from then
on while magpie runs. The Codex app reads the file at its start, so the
app-server restart magpie already offers is still needed to see it.
Inputs are read before codexDesk is held.

Run (mica, at 16e6bee32 on origin/main 48fffb60c): go test ./... -count=1
-timeout 45m: every package ok (gateway 1040s, provider 210s, agent 332s)
but three reds that are red alone on a clean 48fffb60c too:
- internal/dirent's watch tests (#7031);
- internal/gui TestGatewayModeListsNoOwnSessions (#7064: 1 of 6 red on
  main, 3 of 6 here);
- internal/sessions TestCodexPackedDelete, filed as #7082.
Also run: -race on the new and existing TestCodexDesktop* and the
provider's Codex version tests; gofmt -l; go vet (darwin) of gateway and
provider; GOOS=windows go vet ./...; GOOS=linux go vet -tags nogui ./...
After the rebase onto 2416beed6 (which changed gateway and provider): go vet of
both, -race TestCodex* in gateway and Codex* in provider, ok.
TestCodexDesktopCatalogAskedAgainForANewModel and
TestKeepCodexDeskFreshAsksWhenDue are new.
Broken by hand: with codexDeskDue back to the hour alone, the first goes
red ("the sign-in's newer list didn't bring the model: asks 1").
Seen on the owner's machine (read only): the live v0.1.4273 asked as
0.165.0, its desk file and models_cache.json lack gpt-6.1-*, which the
account's saved list has; some of its asks failed (EOF, deadline), which
left the frozen models_cache stand-in until the next sync.
Not tried: a real Codex app beside a ChatGPT sign-in with this build
(the backend refused TLS from this Mac's curl and Python today); the
fallback when the backend can't be reached still uses Codex's frozen
models_cache.json, which can lack a new model.
2026-11-18 17:43:17 +08:00
yetone 2416beed69 sessions: a tab's count is the rows it lists, and a Pi subagent's calls are no row delete can't find (lurx98 on X)
lurx98 on X (tweet 2122972281534402597): on the Sessions page the tabs
said Codex 6 and Pi 8. Codex, opened, said 0 and "no sessions yet"; Pi
said 6 from any other tab. Deleting a row titled "Task: 只读事实核对…"
toasted "no such session".

Two causes, both about one count path and the list disagreeing:

- Codex: agentCounts counted every rollout, while the list drops a
  subagent thread whose parent thread is gone (keptSubagents, 82f09e324:
  Codex App leaves them behind when a thread is deleted). Both now ask
  orphanSubagents; agentCounts reads the identities from the parses kept
  (codexIdentitySnapshot), so a rollout never parsed yet still counts
  until something reads it (Usage, the Codex tab).
- Pi: a pi-subagents scout runs as a Pi of its own and names its own
  session id to the gateway. The lead's row covers it (NativeIDs, its
  subIDs), and a tab not shown skips it, but the shown tab deduplicated
  gateway sessions only by its rows' own ids, so the scout's calls were
  a row of their own, titled by its "Task: …" prompt. Its count (rows)
  went up by those. Delete sent that id to the lead's files (the delete
  handler's NativeIDs path), where no session has it: "no such session".
  The shown tab now skips the same native ids as the counts and delete.

Test: TestSessionTabCountsAreTheirRows (internal/gui), built on the real
pi-subagents fixture (Pi 1.4.0, pi-subagents 0.88.1) with the scout's
calls through the gateway, and Codex App rollouts whose parent thread is
gone. It checks each tab lists the rows it counts, from every tab, and
that each listed Pi row deletes.

Run:
- Old code red: with both files reverted, 5 failures (scout listed as a
  row, codex 4 vs 2, pi 3 vs 2, delete "no such session"). Reverting
  only internal/sessions/manage.go: codex 4 vs 2. Reverting only
  internal/gui/sessions_manage.go: the Pi failures and "no such session".
- At 41b4edf87 (on origin/main 03314b25a), through mote-run: gofmt -l
  clean, go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows
  go vet ./..., go build, then go test ./... -count=1 -timeout 45m: 103
  packages ok, no FAIL (gui 203s, sessions 163s, gateway 1045s).
- Rebased onto 54117164c (gateway files only, none of these): go test
  ./internal/gui ./internal/sessions -count=1 ok again at the pushed head.
- No GUI script changed (client.js untouched), so no GUI suite run.

Not tried: the reporter's own files. The Codex fix needs the rollouts
parsed once (as above); and agents whose rows can be hidden
(GatewayHidden, uninstalled agents' Forget) still count hidden rows on
another tab, which the reporter's agents don't have.
2026-11-18 17:30:43 +08:00
yetone 54117164cd gateway: a Claude account Anthropic turned off moves on and rests as restricted
When Anthropic turns a Claude subscription account off, the request now
goes on to the routing group's next member and the provider's other
accounts, and the account rests as restricted (2h) instead of a short
failure rest. Before, a disabled organization's 400 ended the group at
that account and its next members were never asked (Ramon317317 on X),
and Claude Code's "account is on hold" came back from the bridge as a
502 that rested the account a minute and asked it again.

The words (claudeOffWords, routing.go): "This organization has been
disabled." (400 invalid_request_error or 403), "account is on hold and
can't use Claude Code" (the bridge now answers it as a 403),
"organization has disabled Claude subscription access", "OAuth
authentication is currently not allowed for this organization", and
"account can't receive replies from Claude" (either apostrophe, or
"cannot"). claudeAccountOff scopes them to a Claude subscription account
or a key on api.anthropic.com. A relay's same words are about the
relay's own account behind it, so they stay ordinary failures there, as
on Codex. The extra-usage and Usage Policy refusals are not account
faults and are unchanged. riskRefused keeps the provider's other
accounts in, as for Google's suspension.

Docs: claude-subscription-bridge.md and gateway-routing.md updated.

Run at f357a5e25 (this commit on origin/main f7e0f68ca), on mote:
- new tests (TestClaudeAccountOffMovesToNextAccount,
  TestClaudeOrgDisabledGroupMovesOn, TestClaudeAccountOffScoped):
  51 PASS lines, 0 FAIL.
- Broken by hand: routing.go, fallback.go and claude_subscription.go put
  back to the parent's, with a claudeAccountOff stub returning false so
  the test compiles: all 3 tests fail, 35 FAIL lines (32 subtests), 16
  pass.
- gofmt -l: nothing. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok.
- go test ./... -timeout 45m: every package ok (103 ok lines), rc 0.

Then rebased on origin/main a2d402afe (six commits, internal/gui, site/
and docs/ only) and run again at the pushed head, on mote: gofmt -l
nothing; go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows
go vet ./... ok; go test -count=1 ./internal/gateway ./internal/gui ok.
Rebased again on 1318864d1 (internal/agent, internal/provider,
internal/sessions; none touched here) and run at this head: gofmt and
the three vets as above ok; go test -count=1 ./internal/gateway
./internal/provider ok.
main moved once more (3e66d25d8, 03314b25a: internal/agent, catalog,
gui import links, provider's CC Switch import; none touched here), and
this pushed head was run with gofmt, the three vets ok and the new tests
(51 PASS, 0 FAIL); the gateway package as a whole last ran at 1318864d1.

Not counted: an earlier full run on mica at an older base was voided
because mica's disk filled mid-run (253 "no space left on device"
failures). Its three internal/dirent reds (TestWatchesFromOneMarkProbeOnce,
TestWatchedFolderReadOnlyWhenChanged, TestFileHeldOpenStillSeen) did not
come back in the mote run above. mote's 1-minute load was ~39 on 18 cores
during the run, with no other full suite there.

Not tried: a real disabled or on-hold Claude account; the bodies are
from Claude Code's errors page and users' reports.
2026-11-18 17:09:18 +08:00
yetone 03314b25a4 import: magpie no longer registers CC Switch's ccswitch:// scheme (asombrado_a on X)
889758605 (v0.1.3981, coder_shaun on X asking for one-click import from
relays' CC Switch links) made magpie claim ccswitch:// on every system:
Info.plist on macOS, HKCU\Software\Classes\ccswitch on Windows, and
magpie-ccswitch.desktop on Linux. That scheme is CC Switch's, and magpie
claiming another app's links is not something it should do (asombrado_a
on X: "Magpie为啥要注册 ccswitch://协议的深链").

From this version magpie registers magpie:// only: the ccswitch entry is
out of Info.plist, and the Windows and Linux registration is back to what
it was before 889758605. A start doesn't touch what an older version wrote
(the owner's call); uninstall still takes it out while it is magpie's, as
before. The ccswitch:// parser (importccswitch.go, its test and CC
Switch's example links) goes with it: with nothing registered, no link
reaches it, and ParseImport, ImportLink and `magpie import` take magpie://
links only. The docs' "CC Switch links" paragraph is out in en, zh and ja,
and llms-full.txt and the search indexes are regenerated.

TestRegisterScheme now holds that registration never asks about or claims
x-scheme-handler/ccswitch, and TestImportLink that a ccswitch:// argument
is not taken as an import link.

Run at this commit's tree (rebased on 1318864d1), on mica (mote's load was
38): gofmt clean; go vet darwin, GOOS=windows
(gui, uninstall, provider), GOOS=linux nogui (provider, uninstall);
go test provider, gui, uninstall, cli ok; node --test site/*.test.mjs
135 pass. Linux (wsl-run, magpie-desktop, -tags gtk3), at the tree before the rebase
(the scheme files are the same at this one): provider, uninstall ok; gui ok
except TestClipboardReadBack/copies_after_a_read_back,
which fails the same on origin/main 3ec89c522 (probe segfault, #7073); at this tree TestRegisterScheme*, TestImportLink
and TestImportIsReadOnce ok.
Pushed on 3e66d25d8, which landed after the run and changes internal/agent
only; not run again with it.
Not tried: a real Windows or Linux desktop with an older magpie's
ccswitch registration, which this leaves in place; macOS Launch Services
dropping the scheme once the updated bundle replaces the old one.
2026-11-18 16:52:58 +08:00
yetone 3e66d25d84 agent: OpenCode's limit keeps models.dev's context and input apart
Nepsama1337 on X: magpie 0.1.4414 wrote gpt-6.2-sol into OpenCode's
config as limit {context: 922000, output: 128000}. models.dev gives
{context: 1050000, input: 922000, output: 128000}. magpie's
catalog.Model.Context is the prompt window, so it prefers models.dev's
input, and the opencode shape wrote that number as context and
dropped input.

What OpenCode reads, checked in anomalyco/opencode on dev:
packages/schema/src/config/provider.ts and
packages/core/src/v1/config/provider.ts take limit {context, input,
output}. session/compaction.ts uses min(input, context) when both are
there. OpenCode 1's models.ts (8df09abb1) has input too, and its
compaction uses limit.input || context - output.

catalog keeps the whole window that models.dev pairs with each input
cap (WholeOf, voted the same way as the windows and looked up through
the same renames). The opencode shape now writes {context: whole,
input: prompt window, output} when the catalog gives a wider whole
window, and {context, output} as before otherwise. A user's own
context for a model (Contexts) has no pair, so it stays a plain
context. This shape serves OpenCode 1 and 2, MiMo Code, DevEco, Air
and OpenChamber. OpenCode 2's converter copies limit whole, so input
reaches it too.

Agents with one window field (Crush's context_window, droid, Cline and
the rest) get the prompt window, which is right for them. ZCode and
MiniMax Code also write {context, output}, but their schemas can't be
checked: #7060.

Run:
- TestOpenCodeLimitKeepsContextAndInput is red on the old agents.go
  (relay/gpt-6.2-sol: limit {"context":922000,"output":128000}) and
  green with the fix. It covers the paired model, a model with no
  input cap, a user's own context, and openCodeNative.
- go test -run 'TestOpenCode' ./internal/agent on mote: ok.
- Real OpenCode 1.19.5 on mote, sandbox HOME: `opencode models magpie
  --verbose` lists gpt-6.2-sol with limit {context 1050000, input
  922000, output 128000}.
- Full suite, go test -timeout 45m ./... on Linux (magpie-desktop, at
  48fffb60c plus this change; mote and mica were over their cores):
  every package ok except internal/usage's
  TestRequestStateKeptAcrossACatalogFetchedAgain, red on the old code
  too (#6572). The three GUI-linked packages need -tags gtk3 there:
  . and internal/cli ok; internal/gui's TestClipboardReadBack
  segfaults under WSLg (#7074), the rest ok.
- go vet ./... on Linux (-tags gtk3) and on Windows: ok. gofmt -l:
  clean.

After rebasing onto 1318864d1: internal/agent and internal/catalog ok on Linux.

Not tried: a real OpenCode 2 run (its schema was read from source),
ZCode and MiniMax Code (#7060), and the macOS full suite.
2026-11-18 16:51:14 +08:00
yetone 1318864d1b provider: Factory's mover takes opencode-factory-auth 0.1.48
The factory plugin used one x-session-id for every request of its
process. 0.1.48 gives each conversation its own, and each subagent in
it, as droid opens them. With one shared session, Factory now and then
answered Gemini 4 Argon, Hydrogen and Carbon with 400 "Invalid model ID
in request body" (marovole on X; magpie-community/plugins 63c2ff93).
keepMovedCurrent updates every moved user to it.

npm view @magpie-community/opencode-factory-auth version --prefer-online
gives 0.1.48.

Run (mica): gofmt -l internal/provider is clean; go vet ./internal/provider;
go test -timeout 45m ./internal/provider is ok (148s, at this head after the rebase). The plugin's own
run is in its commit: the plugins suite has 9055 pass and 0 fail, and
the new session test is red on 0.1.47.

Not tried: a real Factory account. None is here, so the refusal was not
reproduced against Factory itself.
2026-11-18 16:41:37 +08:00
yetone 3ec89c5224 codex: the takeover's end waits for the chats on magpie the Codex app has open (milianxinqi on X)
milianxinqi on X, the Codex app: "Model provider mismatch. This chat uses
magpie, but your current provider is OpenAI. Switch to magpie to
continue." ("用的好好的,codex 突然就弹这个了"), with nothing disconnected.

Cause. With the ChatGPT account Codex is signed in to held (out of its
allowance and credits), magpie is Codex's provider (the codex.out
takeover, #540) and new chats start on magpie. When the account has room
again (its window's reset, a switch to another account, or the account
the user keeps Codex on, a5e3972a7), Sync ended the takeover at once:
model_provider out of config.toml, Codex back on OpenAI. The Codex app
keeps the app-server the takeover started (codexAppStep leaves it
running unless Restart the Codex app to follow is on, off by default,
#4550), with its chats loaded and each one's writer lock held, so
bringBack could move none of them and codexRetagOpenThreads never ran
(it runs only before magpie ends the app-server). Every send in an open
chat then met the mismatch, with no step of the user's.

Fix. outStays (agent/codex.go): the takeover's end in Sync, both the
out_own way back and #540's, waits while a Codex holds a chat on magpie
open or wrote to one in the last minute (codexHeldOnMagpie:
sessions.CodexThreadsBusyOnBut, T3 Code's own threads left out, as
codexRetagOpenThreads leaves them), and codexThreadsLater asks for the
Sync that ends it once they are let go; bringBack then moves them onto
OpenAI. Meanwhile magpie serves them on the account, which has room, and
the app on the takeover's app-server shows no account either way. Nothing
waits when the app-server is restarted for the change (Restart the Codex
app to follow on, provider.CodexRestartsApp) or the user turned the
takeover off (Always ChatGPT): that restart moves the open chats first.
The [model_providers.magpie] table already stays after a Disconnect, so
an old thread still opens; a deliberate Disconnect restarts the
app-server (byHand) and retags its chats.

Other paths looked at and left: Disconnect, Unwire, Join and Codex's
account switch go through the same bringBack/retag; RestoreOnQuit (off by
default) runs at quit only; the update restart hands the gateway over on
macOS and Linux and skips it. On Windows a restart runs RestoreOnQuit
when it is on: filed separately.

Tests:
- TestCodexTakeoverWaitsForTheOpenChat (new): takeover, a chat on magpie
  quiet but its lock held, account back: still magpie's provider, the
  chat on magpie, no Sync asked; lock let go: a Sync asked, which ends
  the takeover and moves the chat to openai.
- TestCodexTakeoverEndsAtOnceWhenTheAppFollows (new): with the app
  restarted for the change, nothing waits.
- TestCodexTakeoverThreadComesBackOnceQuiet (nb5p): now the takeover
  stays while the thread is written to, and ends at the later Sync.
Broken by hand: outStays' gate taken out of Sync: the new test and nb5p's
red ("Codex was put on OpenAI under it"), green with it.

Run (mica, mote over its load, at this tree on origin/main 48fffb60c):
- go test -count=1 -timeout 45m ./internal/agent ./internal/sessions
  ./internal/provider: ok (426s, 1917s, 237s).
- go vet of those on darwin, GOOS=windows, GOOS=linux: ok. gofmt -l clean.
- Rebased onto origin/main a2d402afe (provider and sessions changes
  elsewhere): go build ./..., go vet of the three, and the takeover,
  thread-move and retag tests of internal/agent and internal/sessions
  again: ok.

Not tried: the real Codex app through a real reset (needs an account
held then given room); a full ./... run (mica had another session's full
suite and GUI suite running).
2026-11-18 16:33:04 +08:00
yetone a2d402afe0 gui: the Mac's tray panel sits at a menu bar extra's level, so a screenshot tool draws over it (zyh6036 on X)
zyh6036 on X: the menu bar panel stays so far in front that even
WeChat's screenshot can't cover it, so it's hard to take a picture of.

The panel asked for AlwaysOnTop (NSFloatingWindowLevel, 3), but Wails'
SystemTray.PositionWindow sets the window it places to
NSPopUpMenuWindowLevel (101) every time (systemtray_darwin.m), and magpie
places the panel with it on each open and each resize. The live app's
panel read layer 101 in CGWindowList. Nothing in magpie's history chose
101 (git log -S finds only AlwaysOnTop, from the first commit).

placeByIcon now does PositionWindow and then sets NSStatusWindowLevel
(25), the level of the status bar itself: still over normal windows,
floating ones, the Dock (20) and the menu bar (24), and still on every
Space and over full-screen apps (the collection behavior is unchanged,
#2141), but under pop-up menus and anything a screenshot tool puts up at
25 or above. Both PositionWindow calls (togglePanelNow, sizeOpenPanel)
go through it. Other systems: setPanelLevel is a no-op.

What was run (mica, macOS 27, at 48fffb60c + this change; the panel tests again at the rebased head):
- TestPanelJoinsFullScreenSpaces now has a real SystemTray, places the
  panel through placeByIcon and checks the level is
  NSStatusWindowLevel. Broken by hand (setPanelLevel call removed): red,
  "the panel is at level 101". Restored: green.
- A real build in a sandbox HOME (MAGPIE_ADDR 127.0.0.1:3536),
  `magpie panel`, with a tiny AppKit helper: CGWindowList front to back
  read the panel (439x521) at layer 25 over a normal titled window
  (layer 0); a full-screen borderless overlay at NSScreenSaverWindowLevel
  (1000) shown after it was in front of the panel, and so was one at
  NSStatusWindowLevel (25) shown after it, as a screenshot overlay is.
  Before the change the panel was at 101, over the one at 25.
- go test -count=1 -timeout 45m ./internal/gui: ok (714s). An earlier
  run of it had two source guards (panelside_test.go) reading the old
  PositionWindow call, updated here, and TestGatewayModeListsNoOwnSessions
  red under load ("listing":true, the search asked before the list was
  read), green alone: filed as #7064.
- go vet ./internal/gui on darwin, GOOS=windows, and Linux in WSL
  (magpie-desktop, -tags gtk3): ok. gofmt -l: clean.

Not tried: the panel over a real full-screen app. mica's and mote's
screens are locked, and a window there doesn't enter full screen; the
full-screen guarantee is the unchanged collection behavior, which the
same test still checks. WeChat itself: not installed on any test Mac,
so its overlay's level isn't known; if it is below 25 this doesn't
reach it, and the reply asks the reporter to say.
2026-11-18 16:30:23 +08:00
yetone 534b85bf99 gui: an unset Claude Code tier's effort reads "follows session"; a set one says it wins
lightwlh on X: Claude Code's Details shows an effort beside each tier
(Opus, Sonnet, Haiku, Fable) and another under New sessions, and asked
which one wins when they differ. A tier's effort is written into its
model id as <model>:<level> (tierWith in internal/agent/claude.go), and
the gateway asks that model at that level whatever Claude Code asked
(askedAt); the New sessions effort is Claude Code's own (effortLevel /
CLAUDE_CODE_EFFORT_LEVEL), which /effort changes, and reaches only the
tiers with none of their own. The page didn't say so: an unset tier's
effort read "default", like a level of its own.

- An unset tier's effort button reads "follows session" (跟随会话,
  跟隨會話, セッションに従う, wie Sitzung) instead of "default"; its
  title still names the effort Claude Code asks for.
- A set tier's title adds "Used whatever the session's effort or
  /effort is".
- New sessions' effort, while any tier has its own, adds "A tier with an
  effort of its own runs at that one" to its title; both follow a pick
  in the slider at once (the slider's field is a copy, so the check
  reads the picked value).
- No layout change: the same buttons and lines; the subagents' effort
  and the tray panel's tiers' square are unchanged.
- app.js +485 and the core +843 bytes of code, budgets raised with the
  reason: connectPanel and the effort slider draw every agent's Details,
  so there is no page to move it to; the words share one ownSaid.

Run (mote, at this tree rebased on de5fc6700):
- node --test tier-effort, claude-subagent-effort-row, wsl-claude-tiers,
  claude-effort, subagent-effort, panel-effort, agent-tweak-fold,
  i18n-keys, gui-ja, gui-zh-tw, i18n-en-no-cjk: 124 pass 0 fail
  (Chromium and WebKit; tier-effort's narrow 560px case now in all five
  languages, each tier's effort on its model's line, no sideways scroll).
- Broken by hand: tier-effort against origin/main's app.js, 4 of 4 of
  the pick tests red (no "follows session", no wins line).
- go test ./internal/gui: ok (TestCoreScriptBudget red before the raise).
Not run yet: the whole GUI suite (mote and mica each had another
session's full suite running); it runs after the push.
2026-11-18 16:24:12 +08:00
yetone de5fc6700e docs: Claude Code's Code Mode needs a direct Anthropic connection (#7025)
lst016 (#7025) and DylanH_L on X asked for Code Mode through magpie.
Claude Code 2.1.327 decides it in its own start-up check, read in its
bundle: Code Mode is refused with "provider" unless the provider is
firstParty and ANTHROPIC_BASE_URL is unset or its host is exactly
api.anthropic.com (nc()/fd()); then with "credentials" for an
apiKeyHelper or a custom Authorization/X-Api-Key header, "no_flags"
when DISABLE_TELEMETRY, DO_NOT_TRACK or
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC stops the feature-flag
download, and "gate" unless Anthropic's tengu_rustling_blossom flag is
on for the account. Nothing magpie sends or answers can change it: the
base-URL check runs before any request.

So every routed Claude Code (any upstream, a Claude subscription's or an
Anthropic key's model included) starts without it. The subscription
bridge's own runs can't have it either: --tools leaves REPL out, it reads
no user settings, and Code Mode needs an interactive opt-in and restart.
Faking a first-party address would misrepresent the client to Anthropic,
so it isn't done. The docs page says so in en, zh and ja, with the way to
use it: Claude Code on its own model, straight to Anthropic, with
Claude Code's telemetry left on (magpie's switch sets DISABLE_TELEMETRY).

Run:
- real Claude Code 2.1.327 in tmux, sandbox HOME and CLAUDE_CONFIG_DIR,
  ANTHROPIC_BASE_URL=http://127.0.0.1:59998,
  CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1: "Code Mode (experimental) isn't
  available: for now it only works directly with the Anthropic API".
- node docs-index.mjs (search indexes, llms-full.txt, docs-index.sums).
- on mica: node --test site/search.test.mjs site/worker.test.mjs
  site/docker-tags.test.mjs, 50 pass 0 fail; go test ./internal/testenv ok.
Not tried: a direct Code Mode session on a real account (it needs
Anthropic's account gate; nothing in magpie is on that path).
2026-11-18 16:15:36 +08:00
yetone 67f24d7422 usage: every cache hit rate to two decimals, its exact share on hover; a speed's dash says why
shangyuan0818 on X: in Usage › Requests the ranking's model hit rates
had no decimals or one ("98%" beside "99.6%"), the request table mixed
them too, and hovering showed no exact value.

- hitPct gives every hit rate two decimals (98.00%, 99.60%), the same
  in the ranking, the request table and its details, the Cache hit
  rate card, the cache-read tiles, the model and agent rows, Sessions,
  the tray panel, Routing's rows, figures and group averages, and the
  context window's Prompt cache. It still never says 100.00% or 0.00%
  of a prompt not all or none cached (99.99%, 0.01%).
- Each of them has the exact share on hover, in its title (hitTip):
  "9,800 of 10,000 prompt tokens read from the cache: 98%", the share
  to six places with no trailing zeros. One new string, translated in
  zh, zh-TW, ja and de.

ohblue on X: 速度 shows "—" for many 200 requests (491 in, 93 out,
first token 6.3s, total 6.4s), "≥133 token/秒" for others.

- That speed can't honestly be counted: 93 tokens in the 120ms after a
  6.3s wait would read ~775 tok/s, which is a reply written during the
  wait and let go at once (ledHeldShort_). The dash already had its
  reason as a title, but nothing showed it was there. It now has the
  help cursor (the cache column's dash too), the Speed column's head
  says what a speed is on hover, and a request's details say "— " and
  the reason in words, for a reader who can't hover.

Budget: app.js and the core grew by my hitTip, cacheHitTip and the
titles. To stay inside both budgets with no raise, setQuotaRange moved
to plugins/usage/page.js and PLACEHOLDER to plugins/redact/page.js (each
read by that page alone), cacheHitOf and cacheHitTip share cachePrompt,
and hitPct is one expression. Core 1,272,578 of 1,272,581; app.js
1,087,887 of 1,088,248.

Run on mote/mica, this change on origin/main, both engines, every
language, at the widths each file covers:
- usage-hit-exact.test.cjs (new): green. Red with the old hitPct
  ('hit rate 98%') and red with the help cursor and the details' line
  taken out ('pointer' !== 'help').
- 85 GUI files (every test that reads a hit rate, quota range or
  masking, Usage, Routing, i18n-keys, gui-ja/de/zh-tw): 1318 pass, 30
  fail. All 30 are red alike without this change, and all are filed:
  agent-menu-label webkit panel (#6371), zcode-models webkit de
  (#6566), quota-credits (#6807), quota-curve (#6789), usage-fold's
  17 subscriptions (#3415, #6003), usage-ledger (#4078, #3104, #4626),
  usage-ledger-chart (#6790). usage-fold's 'several accounts' went red
  only under the 85-file run and passes alone on this tree (#3415,
  commented).
- go test ./internal/gui on mica: ok (TestCoreScriptBudget included).
- Red alike on a HEAD checkout without this change, already filed:
  usage-ledger "newest live route needs no return-to-live button"
  (#4078, #3104, #4626), usage-ledger-chart "the metric is remembered"
  (#6790).

Not run before the push: the whole GUI suite and go test ./... (both
machines had other sessions' full suites running); they run after it
and their result goes on record. Not tried: Windows WebView2, the
reporters' own ledgers, the real app.
2026-11-18 16:14:52 +08:00
yetone c5cb1c0588 gui: the tray's logo is 16pt, as large as other apps' menu bar icons
qingnianxiaozhe on X: magpie's A\ in the menu bar looked a size smaller
than another app's A\ beside it. magpie fitted each logo to a 14pt box,
so the A\ (about 1.37:1) drew 14x10pt. Claude.app's menu bar template
(TrayIconTemplate@2x.png, 48x48 px) has 32x32 px of ink, a 16pt glyph,
and in the reporter's screenshot the other A\ is 32x22 px against
magpie's 28x20 px at 2x. mpLogo is now 16; the letter in a ring (a logo
that can't be read) grows with it. The two 10pt rows of percentages are
unchanged and still fit the 22pt bar.

Tests: the logo boxes in the tray tests follow the 16pt box (offsets 28
-> 32, 34 -> 38 px at 2x); TestTrayImageLogoSizes now wants 27-33 px of
a 32 px box.

Run on mote (macOS 27.2):
- go test ./internal/gui -run Tray -count=1 -v: ok.
- Broken by hand (mpLogo back to 14): TestTrayImageLogoSizes FAILs
  ("alma spans 24 px of a 32 px box", codex/zcode/workbuddy 26 px) and
  TestTrayImagePlain FAILs ("238 px with logos, 182 without").
- Rendered by the real drawing code (trayImagePNG, 22pt bar at 2x)
  next to Claude.app's own template icon: the A\ is 28 px wide before
  and 32x24 px of ink after, as wide as Claude's 32 px spark; the
  percentages are the same text at the same size. The before/after
  strips are kept outside the repo (tray-toolbar-scratch/before and
  after/strip-{light,dark}.png).
Suite and checks, on mote at aa31e737c8d271455865615fafdf512e09073663 (this commit and its pair, the
tray logo size / the toolbar menu):
- go test -count=1 -timeout 45m ./... in a sandbox HOME, caches pinned:
  exit 0, 103 packages ok, none FAIL (internal/gateway 1633s,
  internal/agent 949s, internal/provider 470s, internal/gui 295s).
- gofmt -l internal/gui: nothing. go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go build
  -tags nogui, GOOS=windows go build: all ok.
- No GUI asset changed, so the Playwright suite wasn't run.
After a rebase onto 42c43c002 (Antigravity sessions, internal/gui
sessions reads; no file in common), at the pushed head:
go vet, GOOS=windows and GOOS=linux -tags nogui go vet of ./internal/gui/...
and go test -count=1 ./internal/gui/...: ok.
Then rebased onto f7e0f68ca (Codex instructions, internal/provider
only), not run again.

Not tried: a screen screenshot of the real menu bar (no Screen
Recording permission over ssh on mote; the image is the one the app
hands NSStatusItem); the reporter's notch Mac, where the bar is 24pt.
2026-11-18 16:08:15 +08:00
yetone add1e75ee3 gui: no Icon and Text menu on a right-click by the traffic lights
AlanWang1027713 on X: a right-click on the main window's title bar, by
the lights, offered "Icon and Text / Icon Only / Text Only". It comes
from the empty NSToolbar that MacTitleBarHiddenInset puts there to
inset the lights; NSThemeFrame's menuForEvent: lists its display modes.
insetLights takes the toolbar away only in the macOS 26 design, so on
macOS 27, with an older SDK and in a right-to-left layout the toolbar,
and its menu, stayed.

quietToolbar turns the menu off where the toolbar stays:
allowsDisplayModeCustomization = NO (macOS 15+), and AppKit's own
_setWantsToolbarContextMenu: NO for macOS 12-14, each looked up with
respondsToSelector, since the SDK that builds magpie may be older than
the system it runs on. Nothing about the title bar's shape changes.

windowshape.Of now reads the menu a right-click 20pt below the top,
120pt in, gets from the window frame (TitlebarMenu), and
TestMainWindowCorners and TestMainWindowRightToLeft fail when the main
window gets one, or when the reference toolbar window doesn't (so the
probe is proven to see it).

Run on mote (macOS 27.2), real makeMain window:
- go test ./internal/gui -run 'TestMainWindowCorners|TestMainWindowRightToLeft'
  -count=1 -v: ok. Each stage logs "title bar menu []" next to the
  reference toolbar window's ["Icon and Text" "Icon Only" "Text Only" "-"]
  (macOS 26 SDK) and ["-"] (macOS 15 SDK). Lights [[26 26] [49 26] [72 26]],
  66pt title bar and 16pt corners with the 26 SDK, [[19 19] [39 19]
  [59 19]] and 38pt with the 15 SDK: the same as without the change.
- Broken by hand (quietToolbar call taken out): both FAIL, "a right-click
  on the title bar gets a menu: ["Icon and Text" "Icon Only" "Text Only"
  "-"]" (26 SDK) and ["-"] (15 SDK).
- A probe app on mote: either switch alone empties the frame's menu.
Suite and checks, on mote at aa31e737c8d271455865615fafdf512e09073663 (this commit and its pair, the
tray logo size / the toolbar menu):
- go test -count=1 -timeout 45m ./... in a sandbox HOME, caches pinned:
  exit 0, 103 packages ok, none FAIL (internal/gateway 1633s,
  internal/agent 949s, internal/provider 470s, internal/gui 295s).
- gofmt -l internal/gui: nothing. go vet ./..., GOOS=linux go vet -tags
  nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go build
  -tags nogui, GOOS=windows go build: all ok.
- No GUI asset changed, so the Playwright suite wasn't run.
After a rebase onto 42c43c002 (Antigravity sessions, internal/gui
sessions reads; no file in common), at the pushed head:
go vet, GOOS=windows and GOOS=linux -tags nogui go vet of ./internal/gui/...
and go test -count=1 ./internal/gui/...: ok.
Then rebased onto f7e0f68ca (Codex instructions, internal/provider
only), not run again.

Not tried: a screen screenshot (screencapture over ssh has no Screen
Recording permission on mote; the menu is read from AppKit instead);
macOS 12-14, where only the private selector applies.
2026-11-18 16:08:15 +08:00
yetone f7e0f68ca2 codex: GPT-6.2's instructions go first in the input, where its cache keeps them
From GPT-6.2 on, OpenAI reads a Responses request's top-level
instructions after its input, not before it (prompt caching guide:
"instructions ... appended to the end of the input" for gpt-6.2 and
later), so they sit past the cached prefix and are billed uncached on
every turn. Codex itself sends no top-level instructions: client.rs puts
its base instructions first in the input as a developer message
(BaseInstructionsFragment, codex-rs/core/src/client.rs).

magpie sent Codex's instructions on top for every ChatGPT-account
request that is not Responses Lite: Claude Code, OpenCode, Pi and other
translated agents through a codex account, and Codex CLIs older than
Lite. Measured on a real ChatGPT account, third turn of a growing
conversation: gpt-6.2-sol cached 1,920 of 8,271 input tokens with the
instructions on top, 6,016 with them first in the input; gpt-6-sol
cached 5,632 of 6,843 with them on top (the old order still works
there). Reported on X by Anotiaww (Codex hit rate looked low).

- codexBody: for a GPT-6.2+ model Codex's instructions, and a client's
  own, go first in the input as developer messages, and the request
  carries no instructions field. Older models are unchanged, and Lite
  turns (no instructions at all) are unchanged.
- siwcBody (Sign in with ChatGPT API path): the client's instructions
  go first in the input for GPT-6.2+.
- buildResponses (Chat/Anthropic translated to Responses, any host):
  the system prompt goes first in the input for GPT-6.2+.
- InstructionsAfterInput names the models: gpt-N.M with N.M >= 6.2,
  gpt-7 and later, after a provider prefix; gpt-6, gpt-6.1, gpt-5.x,
  o-series and other vendors' models keep top-level instructions.

The instruction text itself is unchanged; only where it sits moves.

Run (mote, at this tree on origin/main 48fffb60c):
- go test -count=1 -timeout 45m ./...: all 103 packages ok
  (internal/gateway 1602s, internal/provider 463s).
- go vet ./internal/provider ./internal/gateway on darwin, linux and
  windows: ok. gofmt -l: clean.

Broken by hand, then put back: InstructionsAfterInput returning false
turns TestInstructionsAfterInput, TestCodexBodyInstructionsFirstIn-
InputOnGPT62, TestSiwcBodyInstructionsFirstInInputOnGPT62 and
TestResponsesSystemFirstInInputOnGPT62 red.

Not tried: a real Claude Code or OpenCode session through magpie on
gpt-6.2 (the live app lists no gpt-6.2 model here); the cache numbers
above are from direct requests to the ChatGPT backend in both orders.
2026-11-18 16:04:56 +08:00
yetone 42c43c0020 sessions: an agent found after Allow selected is asked about once (Antigravity 2.0)
baysonfox on X: Antigravity 2.0 desktop sessions showed on the Sessions
page only while the app was connected to magpie; agy CLI's always showed.

Cause: not the file reader. Real Antigravity 2.30 (signed out, no model,
sandbox HOME on the Windows box) writes ~/.gemini/antigravity/
conversations/<id>.db, conversation_summaries.db and brain/, and
internal/sessions parses them. The gate is settings.SessionReads:
"Allow selected" (and the Usage readsNote's "Count …") saves all:false,
so an agent installed after that choice is never read and never asked
about again. Gateway-recorded sessions skip the gate, hence "only when
connected".

Fix: /api/sessions/reads marks a found agent `new` when the choice was
made, it isn't read, isn't named in Agents and is on disk (Found(), which
checks every OS's path). The Sessions page shows one quiet card for those
(laterCard): "Show their sessions" names each on, "Keep off" names each
off, so it isn't asked again. No new endpoint; the card posts the
existing sessions/reads.

Tests: TestSessionReadsNewAgent copies the real 2.30 files
(internal/sessions/testdata/antigravity-2.30, sandbox paths only, no
tokens) beside agy-sessions, with agy allowed by name: antigravity is
off and new, nothing listed; after the answer it is not new, settings
keep all:false/agy:true, and its one session is listed only when shown.
TestSessionReadsNewOnlyWhenNamed: not asked, allow all, all with agy off
mark nothing new. sessions-reads.test.cjs: the card, both answers, posts
and no card after reload, Chromium and WebKit, 5 languages, 900/390px.

Run at d7d62d889, on mote, then rebased onto 48fffb60c (app.js and
settings-groups only, no file in common):
- gofmt -l, node --check client.js/i18n.js: clean
- go vet ./internal/gui ./internal/sessions; GOOS=linux -tags nogui and
  GOOS=windows go vet of the same: ok; go build .: ok
- go test -count=1 ./internal/sessions: ok (282s)
- go test -run 'TestSessionReads|TestCoreScript|TestI18n|TestCSS'
  ./internal/gui: ok
- GUI: sessions*.test.cjs (45 files), usage-reads-note,
  gateway-mode-sessions, i18n-keys, window-back-once: 711/711 pass
Broken by hand: New forced false, TestSessionReadsNewAgent red in both
subtests ("want off and new"). An earlier "Allow" button label was red
in i18n-keys (core word, internal/agent/reach.go), hence the label.
Not run: the whole GUI suite and the full go test ./... (mote and mica
were overloaded, mica's disk full). Not tried: a real Antigravity 2.0
on macOS/Linux; Found() paths for those come from the existing reader.
Not changed: the Usage page's readsNote still shows only before the
choice; Found() doesn't look into WSL distros.
2026-11-18 16:04:10 +08:00
yetone 48fffb60c5 gui: the provider editor waits for its Advanced headings before it draws (#7051)
31575f71a grouped the editor's Advanced rows from advgroups.js, imported
as Providers first draws. An editor opened before the import landed drew
its rows ungrouped and moved them under headings a moment later, so a
reader saw the rows jump and settings-groups read either order (red 6 of
14 on origin/main 61c714ed0, both engines, en and zh).

renderProviders now waits for the import (a local file, a few ms) before
it draws an open editor, and groupAdvanced groups in the same draw. A
failed import draws the editor ungrouped rather than not at all.
settings-groups lists Claude's rows in the grouped order.

Run (mote, at this tree):
- settings-groups 3 runs, advanced-headings, provider-prefs,
  settings-search, provider-unsaved-paths, Chromium and WebKit: all pass
  (14, 10, 20, 18, 4).
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand, then put back:
- the wait removed and the import held 400ms: settings-groups 6 of 14 red.
- the wait kept and the import held 400ms: settings-groups and
  advanced-headings green.

Not tried: the real app window, the full GUI suite.
2026-11-18 14:56:22 +08:00
yetone 42181fdd27 gui: the Claude provider's run field is named Claude requests, not Claude Code
The Claude provider's editor had a field under Advanced named "Claude
Code", the same name as the agent's own sheet on the Agents page, so
two different places read as one. The field says how magpie sends
requests to Claude (its run row), so it is now "Claude requests": zh
Claude 请求, zh-TW Claude 請求, ja Claude リクエスト, de
Claude-Anfragen. The name was also the only field label left
untranslated. The Agents page's Claude Code is unchanged.

claude-extra-usage-setting checks the field's name in each language.

Run (mica):
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS':
  ok, at this change rebased on 31575f71a.
- claude-extra-usage-setting, provider-prefs, i18n-keys there: 46 of 46.
  settings-groups: 6 of 14 red, the same as origin/main 61c714ed0, where
  31575f71a's Advanced headings land before or after the first draw and
  Claude's rows change order (#7051). Before 31575f71a, at 433814799,
  settings-groups was 14 of 14 with this change, alongside
  claude-lean-prompt-setting, settings-search, gui-de and nav-timeout.
- Rebased again onto 61c714ed0 for the push; not run again there.

Broken by hand, then put back: the old untranslated "Claude Code"
label, claude-extra-usage-setting 20 of 20 red.

Not tried: the real app window, the full GUI suite.
2026-11-18 14:41:21 +08:00
yetone 61c714ed01 sessions: By tokens selects the small sessions, to delete them at once
A user asked for a way to delete every session under 10K or 20K tokens
(yansheng1003 on X). Selecting sessions on the Sessions page now has a
"By tokens" button beside Delete. It opens the app menu (openProtoMenu,
no native select) with 10K, 20K, 50K and 100K, each showing how many of
the sessions on screen it would select. A pick replaces the selection
with the deletable rows on screen (search and filters apply) that used
fewer tokens than that. Tokens are counted with sessTokens, the number
each row shows.

A session that is streaming now (speedOf().live) or was written in the
last minute is never picked. The server already refuses one written in
the last minute (sessions.Delete's ErrActive). Delete is the existing
path: each agent's own delete, gateway-only and forgotten sessions
handled as before, files moved to magpie's trash. The existing
confirmation names how many sessions go and that Trash puts them back.
When the selection is still the By tokens pick, it adds "Each used
fewer than 20K tokens". A selection changed by hand drops that line.

Only the Sessions plugin changes (client.js, i18n.js in en, zh, zh-TW,
ja and de, sessions.css). No server change.

New test: sessions-small-delete.test.cjs, in Chromium and WebKit, every
language, against a faked API. It covers the menu's head and counts,
the pick (running, live, read-only and larger sessions left out, cache
counted as the row counts it), a smaller size replacing the pick, a
search narrowing it, the dialog's size line, Cancel posting nothing,
Delete posting the 4 ids, a 420px bar, and no native select.

Run:
- At the pushed tree (on origin/main 31575f71a), mote: i18n-*, nav-timeout
  and sessions-small-delete: 19 of 19 pass.
- At this tree (c3e0a6bb5, on origin/main 31575f71a), mote, load ~40:
  - sessions-*, i18n-*, proto-menu-overflow, checkbox-look and
    library-sessions-mcp: 661 of 661 pass.
  - go test ./internal/gui -run
    'TestCoreScriptBudget|TestI18n|TestCSS|TestPlugin|TestAsset|TestBudget':
    ok.
- Before the rebase (on 7707ba9ad), mica: the new file 10 of 10, and
  the touched set 670 of 670.
- Whole GUI suite before the rebase (mote, --test-concurrency=4):
  the ssh session dropped about two-thirds through. 934 of 1586 files ran
  (to r*), 11193 ok and 397 not ok in 78 files, and no Sessions file was
  among them. Each red file ran again alone, at this change and at
  origin/main 32a181868, and the same tests failed on both:
  - 5 files: 68 of 82 red on both trees (#6709).
  - The 9 files not in #6709: 16 of 224 red on both trees, flaky WebKit
    subtests (#6807, #4784, #4071, #6038, #4210, #3951, #5109).
    provider-base-as-typed and provider-env-paste are #6038's class and
    were added to it.

Broken by hand, then put back: with the running and live exclusion
removed from smallOf, the chromium en case went red.

Not tried: the remaining 652 GUI files after the drop (both machines
were over their cores with other sessions' suites), and the real app
window with real sessions.
2026-11-18 14:36:31 +08:00
yetone 31575f71a1 gui: the provider editor's Advanced rows sit under four small headings
The provider editor's Advanced held some thirty rows in one run (item
19). They now sit under four small headings, Routing, Models, Limits and
cost, and Connection, each row keeping its order inside its group; a row
the list doesn't name stays with the one before it, and the headings
show only when two groups are used. No page, row or fold moves
elsewhere. advgroups.js is imported when Providers first draws, so it
weighs nothing on the core script, and the editor opens with the
headings already in place.

Not done from item 19: a routing group's strategy stays under the
group's Advanced. The owner folded it there on purpose (9edc6506e,
11-09, "the Add group form was too long"; and for providers on 11-12,
"这些也要折叠在高级里"), and routing-advanced holds the provider side.

New test: advanced-headings, for an account and a key, both engines,
every language: the headings in order, Routing/Stays under Routing,
Context window under Models, Requests at once under Limits and cost,
Proxy under Connection, the heading across the whole row.

Broken by hand: both groupAdvanced(advIn) calls removed,
advanced-headings 10 of 10 red; put back, 10 of 10 green.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

The Codex client row 07d19510f added to the Codex provider's Advanced
sits under Connection, beside User-Agent: which client the requests say
they come from. advanced-headings has a Codex account for it; with the
row left out of the list, 10 of 10 red.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 75cc9f6e26 gui: a plugin's JSON options point to its provider's editor for the switches it declares
A provider plugin's options had two editors: the switches it declares
in its provider's editor, and the raw JSON on the Plugins page. The
provider editor owns the switches; the JSON editor now says so and links
to it ("Its switches are in {name}'s editor"), closing itself as it
goes. Shown only for a signed-in subscription with declared switches.

Own test: plugin-provider-options clicks the link, lands on Providers,
and checks the JSON editor is gone. Its first run was red 12 of 12: the
link cleared the editing state without a redraw, so the editor stayed
in the page; it now redraws like Cancel does.

Broken by hand: the link's click handler removed,
plugin-provider-options 12 of 12 red; put back, 12 of 12 green.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone d13151998c gui: Profiles says what a profile holds, and that providers and routing stay as they are
The Profiles tip didn't say what a profile is. It now says what one
holds, and that switching one leaves providers and routing alone.

Own test: panel-profiles (asserts the tip in every language).

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 6396719517 gui: the provider editor's row is Masking, the word Plugins › Built-in uses
The provider editor said Redaction where the built-in and its page say
Masking (item 18, one word per concept). Privacy stays the Settings
tab's name.

Own test: provider-unmasked.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone d90780c5d4 gateway, gui: a built-in is turned on in Plugins › Built-in, not a Settings › Plugins that isn't there
Errors and notices sent people to "Settings › Plugins" or called a
built-in "the … plugin", where no such page is and the thing is a
built-in (item 18, "Plugin" qualified where it's ambiguous). They now
name Plugins › Built-in and say built-in.

Own tests: builtins, websearch-places; Go: the gateway tests whose
strings changed (TestKeyLimitsOnAndOff, TestSearchOnAndOff,
TestToolsMCP*, TestHubMCPHeldToKeyLimit, TestVisionMCPHeldToKeyLimit),
internal/gui's plugins_own_* tests, davsync, gwbudget, gwmw, provider.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 87af7281e2 gui: Connected means an agent goes through magpie; the Library's list says Using the library
"Connected" meant two things: an agent routed through magpie, and an
agent that uses the Library's servers and skills (item 18). The second
is now "Using the library"; Connected keeps the first.

Own tests: agent-app-restart, library-mcp-hub.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 6facdb2461 gui: a provider's limit is Requests at once, as on gateway keys and accounts
The provider editor called it Concurrency while gateway keys and
accounts said Requests at once (item 18). One name now, in every
language; the old key is gone from i18n.js.

Own tests: provider-concurrency, provider-rpm, lane-limit,
gateway-key-concurrency; Go: internal/access.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 28430c9b90 gui: magpie's own paths are written with ›
A path through magpie's own screens was written with › in some places
and → in others (11-17 scan, item 18). Every one the user reads is now
›: Settings › Network and sharing, Settings › Privacy, Library › MCP
servers, Providers › … › Use it anyway, Settings › Usage, in the GUI and
in the Go errors and notices that reach it, in every language. The GUI
matches errNotAsked by its prefix, so it still finds it.

Left as they are: gateway errors written for agents, AiHubMix's and
Claude Desktop's own menu paths (their apps' words), the image MCP tool
description (it goes to agents), and comments.

Own tests: chatgpt-usage-why, websearch-places, library-mcp-hub,
i18n-keys; Go: internal/library (TestPrivateRepoInstallsWithToken, red
on the first try because skills.go still had →), internal/plugin
(notplugin_test), internal/pii, internal/provider.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
2026-11-18 14:32:44 +08:00
yetone 3b74aaf12c agent: Claude's auto-compact window is held to the 1000000 Claude Code takes
ZeroX2017 on X (0.1.4404): a compaction threshold of 1048576 typed for
Ollama Cloud's 1M DeepSeek went into ~/.claude/settings.json as it was.
Claude Code 2.1.316's settings schema (and Claude Desktop 2.7032's copy
of it in app.asar) takes autoCompactWindow as an int of 100000 to
1000000 and reads a larger one as none, so a new Claude App session ran
that model at the top-level 272K for every model.

Every auto-compact window magpie writes for Claude Code is now held to
1000000 (claudeCompactCap): the per-model modelSettings entries
(claudePlan), the top-level autoCompactWindow, and
CLAUDE_CODE_AUTO_COMPACT_WINDOW. An entry the hold makes equal to what
the model runs at anyway is left out. The threshold in magpie stays as
typed; Codex and Grok Build get it unheld; tune's card still reads the
top-level value back as Long conversations at the typed value
(claudeLongWindow compares against the held value). agent-wiring.md
says so.

Tests: TestClaudeCompactHeldToClaudeMax (Desktop entry, a second sync
rewrites nothing, magpie's threshold unchanged, the variable when
Claude Code is alone, Codex unheld), TestClaudePlanHeldToClaudeMax,
TestClaudeTopCompactHeldToClaudeMax (top-level + tune read-back).

Run:
- Full suite, go test ./... -timeout 45m -count=1 on mote at base
  afabb7f90: exit 0, 103 packages ok, no FAIL/panic/timeout in the
  kept log.
- Rebased on origin/main 07d19510f (11 commits, GUI and
  internal/library only, nothing in internal/agent): go test
  ./internal/agent ./internal/library -count=1 ok on mote;
  GOOS=linux and GOOS=windows go vet ./internal/agent ok; gofmt -l
  clean.
- Broken by hand: claudeCompactCap made a no-op, all three new tests
  red (entry 1048576, top-level 1048576).

Not tried: a real Claude App session with a 1048576 threshold; the
schema bounds were read from Claude Code 2.1.316 and Desktop 2.7032's
bundled source.
2026-11-18 14:32:09 +08:00
yetone 4338147993 gui tests: settings-groups expects Claude's Spend extra usage row (#6597)
d0fb3c008 (11-13) put "Spend extra usage" in Claude's provider editor,
beside the short system prompt, and settings-groups' list of Claude's
rows wasn't brought up to it: 6 of 14 red on main since, both engines,
en and zh. The row is meant to be there, so the test now lists it.

Run (mica, at this tree, origin/main 07d19510f): settings-groups 14 of
14 pass; 6 of 14 red before this change.
2026-11-18 14:30:12 +08:00
yetone 07d19510f6 gui: the Codex client is picked in the Codex provider's Advanced too, which gateway mode reaches
The Codex client (CLI or desktop app, which Codex requests to the
ChatGPT accounts say they come from) could be set only in Agents ›
Codex, which gateway mode doesn't have, so a gateway user couldn't
reach it at all. The Codex provider's editor now has it under Advanced:
the same app menu (codexMenuBtn, split out of codexMenuPick), posted at
once to settings/codex-client like the Agents row, and the button
redraws after a pick. The Agents row is unchanged.

New test: codex-client-editor.test.cjs, the editor's pick in the app
and in gateway mode, every language, Chromium and WebKit.

Run (mica, at this tree, rebased on origin/main 39c5040d7):
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS':
  ok.
- codex-client-editor, codex-client, i18n-keys: 44 of 44 pass.
- nav-timeout (the guard over every GUI file): 1 of 1.
- The 19 GUI files that open these editors and the Agents rows ran
  before the rebase; the seven red files there (account-arrange,
  account-cap, account-refresh-holds, accounts-own-signin,
  agent-details-ready, agent-expand-steady, agent-menu-label) were run
  again at this change and at origin/main 039719491: 44 and 46 red, the
  same tests. Filed: #6010, #6003, #6038, #6369, #6373, #6371, #2935,
  and account-cap's page error as #7046.

Broken by hand, each red, then put back:
- app.js from before this change: codex-client-editor 8 of 8 red (en,
  zh).
- the redraw after a pick removed: 4 of 4 red.

Not tried: the real app window, the full GUI suite.
2026-11-18 14:20:00 +08:00
yetone 39c5040d72 lessons: 11-18 three new GUI files skipped the guard that reads them all 2026-11-18 14:11:59 +08:00
yetone 2acc2660e4 gui tests: three new files give navigation its 60s next to a 5s default
disabled-model-chips (265217bf4), vertex-two-keys (a10ac7bb0) and
provider-unsaved-paths (e5c0c23de) set page.setDefaultTimeout(5000)
without page.setDefaultNavigationTimeout(60000), so nav-timeout.test.cjs
(#4787's guard) failed the cli (linux/amd64, nogui) job: main's Test run
was red at cf20df721 and fefab53d2. Each now sets it, as every other
file does.

Run (mote, at this tree, load ~31):
- node --test internal/gui/tests/nav-timeout.test.cjs: ok. Broken by
  hand, then put back: with vertex-two-keys' old line it fails 1 of 1,
  naming that file.
- node --test on the three files: 38 of 38 pass.
2026-11-18 14:11:25 +08:00
yetone 039719491c gui: Sessions' Settings › names the session terminal too, beside history
The Sessions page's head had one Settings › link, and it went to
Privacy's Agents' session history. The other setting the page uses, the
terminal a session opens in (General's Session terminal), had no way
there from Sessions. Where that row exists (a Mac, or a terminal found
on Windows or Linux), Settings › now opens the app's menu with both,
each noting its tab (Settings › Privacy, Settings › General), and each
opens Settings at its row, lit, with Back to Sessions. Without a
terminal row it goes straight to Privacy as before; gateway mode still
has no link. When the row shows is one rule now
(window.sessionTerminalShows in sessions/settings.js), asked by both.
No new strings; the core is unchanged.

Run (mote, at this tree):
- sessions-to-settings (now also on a Mac: the menu, both items, each
  reaching its row, nothing moved, the menu inside the window at 420),
  sessions-reads, gateway-mode-sessions, settings-search, i18n-keys,
  Chromium and WebKit, every language: 104 of 104 pass.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand, each red, then put back:
- Settings › going straight to Privacy always: sessions-to-settings 20
  of 20 red.
- the terminal item aimed at the history rows: 20 of 20 red.

Not tried: the real app window.
2026-11-18 14:07:19 +08:00
yetone 2957d16e5e gui: every alert row says when notifications won't show, in sight; Bark says it gets them all
The scan's item 9. When the system blocks magpie's notifications, or
can't show them, Settings › Usage's four alerts said so after their
description, but the Masking alert in Settings › Privacy didn't. Both
take the line from one helper now (notifyWarn in app.js), and the
Masking alert appends it as the others do.

On a computer with a pointer that warning was never in sight anyway:
Settings holds a row's explaining line out of sight for the hover card
(app.css, 11-02), and the warning sat inside that line. The comment
there says a warning stays; the rule didn't. A line holding a .warn now
stays in place, so the warning is read without hovering.

Bark gets every notification magpie shows (sendAs → barkPush), even
while the system's are turned off. Its row now says so, in every
language, rather than following a separate set of choices.

New test notify-warn-places.test.cjs: denied and unavailable, the
Masking alert's and the usage alert's warning on screen (wider than the
1px a held line gets, no clip-path), none when nothing is wrong, Bark's
line, nothing past the edge; every language, 900 and 380, both engines.

Run (mote, at this tree; mote at load ~50 and mica at ~160, mote the
lighter):
- notify-warn-places, mask-alert, builtin-places, i18n-keys, bark,
  settings-hints, usage-alert, reset-reminder, turn-done, settings-search,
  settings-search-reach, settings-groups, gui-de, editor-hints,
  privacy-hides-accounts, Chromium and WebKit: reds only these, each red
  on an origin/main 888d4eba5 copy too and filed: bark's "Bark is set…"
  at 900px, the click moves the page 2px (#6543), editor-hints WebKit
  (#6156), settings-groups "warm-ups and check-in" (#6597).
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS':
  ok, no budget raised.

Broken by hand, each red, then put back:
- the :has(> .warn) exemption removed: notify-warn-places 30 of 30 red.
- the Masking alert's warning not appended: 30 of 30 red.
- Bark's line removed from index.html: 30 of 30 red.

Not tried: the real app with notifications turned off in System
Settings, and a real Bark push.
2026-11-18 13:53:15 +08:00
yetone 00d6c8dbfc library: the Plugins page's Give to agents and Hide from agents follow the Library's switch for the plugin's tools
PluginServers called a plugin's tools server on when any agent was
ticked for it, but the Library row's switch is !Hidden. With the server
on in the Library and no agent ticked, the two pages disagreed. The
Library's switch said on, and an app at the MCP router's address had
the tools. The Plugins page said "Tools, hidden from agents" and offered
Give to agents. Now `on` is !Hidden on both pages.

Test: TestPluginToolsHidden checks that with the server on in the
Library and no agent ticked, an app at the router's address lists it and
PluginServers says on. docs/subsystems/plugin-tools.md says what `on` is.

Run (mica, at this tree on 32a181868):
- go test ./internal/library -run 'TestPluginTools|TestPluginServer':
  ok.
- plugin-tools.test.cjs, both engines, in the same 61-pass run as the
  two commits before.

Broken by hand: `On: len(s.Agents) > 0` put back made
TestPluginToolsHidden red ("on in the Library, given to no agent: the
Plugins page says hidden"). Put back.

Not tried: the real app window with a real tools plugin.

Run again after a rebase on 888d4eba5 (mica): the go test guards and ./internal/library ok; library-plugin-parts, library-plugins, agent-disconnect, agent-bulk-visibility, agent-visibility-saving, plugin-tools, i18n-keys, gui-de, gui-ja and gui-zh-tw, both engines: 155 pass, 0 fail.

At the pushed head, on cb1fe6d5d (mica): the go test guards, ./internal/library -run TestPlugin, i18n-keys and agent-disconnect ok.
2026-11-18 13:52:12 +08:00
yetone ab42898d91 gui: Manage agents says that hiding an agent takes it out of the Library's lists too
The note in Manage agents said "Hiding only changes this list". But the
Library leaves a hidden agent out of its chips too (shownAgents in
plugins/library/client.js, #71), and PluginServerOn skips it when giving
a plugin's tools to every agent. What it was already given stays, and
nothing new goes to it. That is the intended behaviour, so the text now
says it: its connection and settings stay as they are, the Library stops
listing it, what it was given stays, and nothing new goes to it. The
note is in en, zh, zh-TW, ja and de, and so is agentsmanager.js' head
comment.

Test: agent-bulk-visibility.test.cjs checks the note's text in each
language, Chromium and WebKit.

Run (mica, at this tree on 32a181868): the same run as the Disconnect
commit before this one. go test ./internal/gui -run
'TestCoreScriptBudget|TestI18n|TestCSS' ok; the eight GUI files, both
engines, 61 pass, 0 fail.

Broken by hand: the old note put back made agent-bulk-visibility red 10
of 10 (both engines, every language). Put back.

Not tried: the real app window.

Run again after a rebase on 888d4eba5 (mica): the go test guards and ./internal/library ok; library-plugin-parts, library-plugins, agent-disconnect, agent-bulk-visibility, agent-visibility-saving, plugin-tools, i18n-keys, gui-de, gui-ja and gui-zh-tw, both engines: 155 pass, 0 fail.

At the pushed head, on cb1fe6d5d (mica): the go test guards, ./internal/library -run TestPlugin, i18n-keys and agent-disconnect ok.
2026-11-18 13:52:12 +08:00
yetone 932987c50c gui: Disconnect from magpie says it takes out magpie's endpoint, key and models, and that the Library's items stay
The row menu's tip said Disconnect takes out "everything magpie wrote
into {agent}'s config". Agent.Disconnect (internal/agent/applied.go)
takes out only the routing: endpoint, key, models and effort. MCP
servers, skills and hooks the Library gave the agent stay, which is
right, since they are the Library's and are taken out there. The text
is what was wrong, so the text changes, not the action:
- the tip, and the dialog's fallback line (shown when no dry run can be
  had), name what is taken out;
- the dialog always says "The Library's MCP servers, skills and hooks
  stay".
All of it in en, zh, zh-TW, ja and de. No budget raise: app.js is 4
bytes smaller than before, because the strings are shorter.

Test: agent-disconnect.test.cjs checks the new note's text in en and zh,
and that every new string has its Chinese.

Run (mica, at this tree on 32a181868):
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.
- agent-disconnect, agent-bulk-visibility, agent-visibility-saving,
  plugin-tools, i18n-keys, gui-de, gui-ja and gui-zh-tw, Chromium and
  WebKit: 61 pass, 0 fail.

Broken by hand: the note taken out of the dialog made agent-disconnect
red 4 of 4 (both engines, en and zh). Put back.

Not tried: the real app window, or a real agent disconnected.

Run again after a rebase on 888d4eba5 (mica): the go test guards and ./internal/library ok; library-plugin-parts, library-plugins, agent-disconnect, agent-bulk-visibility, agent-visibility-saving, plugin-tools, i18n-keys, gui-de, gui-ja and gui-zh-tw, both engines: 155 pass, 0 fail.

At the pushed head, on cb1fe6d5d (mica): the go test guards, ./internal/library -run TestPlugin, i18n-keys and agent-disconnect ok.
2026-11-18 13:52:12 +08:00
yetone 93fa1d661c library: a Claude plugin's parts keep their own agents through sync, and each says which plugin it came with
givePlugin gives every part of a Claude plugin (skills, MCP servers,
hooks, subagents) the plugin's agents. putPlugins' settle ran it on every
sync put, even when the plugin's own agents and switch hadn't changed.
So an agent ticked or unticked on a part's own row was put back on the
next sync without a word. Now settle gives the parts the plugin's agents
only when those agents or the switch change. A part's own edit stays
until then.

The Library never showed `bundle`, so nothing on a part's row said it
belonged to a plugin. Each such row (Skills, MCP, Hooks, Subagents) now
carries an "In {plugin}" tag. Its tooltip says that changing the
plugin's agents, or turning the plugin off and on, gives the part to the
plugin's agents again. The tag is in en, zh, zh-TW, ja and de.

Tests:
- TestPluginPartOwnAgentsKeptBySync: tdd set to claude alone survives a
  sync of the same plugin, and changing the plugin's agents gives tdd
  the plugin's agents again.
- library-plugin-parts.test.cjs (new): one bundled part and one own part
  on every tab. Each bundled part has the tag, with its text and tooltip
  in each language, and the own part has none. Nothing is wider than the
  window at 1100 and 420. Chromium and WebKit.

Run (mica, at this tree on 32a181868):
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.
- go test ./internal/library: ok.
- every library-*.test.cjs plus i18n-keys, both engines: 1900 pass,
  10 red.
  - library-open-again's 1100px cases are red on origin/main 98355866f
    too, run alone (#6751).
  - library-commands' WebKit de case (#7035) and library-pi-market's
    Chromium case (#7036) were red under load 110. Run again alone,
    they pass on this tree and on origin/main.

Broken by hand, each red, then put back:
- settle giving the parts on every put (`if moved || true`):
  TestPluginPartOwnAgentsKeptBySync red ("tdd's agents: claude,codex,
  want its own claude").
- withPlugin never tagging (`if (false && x.bundle)`):
  library-plugin-parts 82 red of 82.

Not tried: the real app window, or a real Claude plugin's sync between
two computers.

Run again after a rebase on 888d4eba5 (mica): the go test guards and ./internal/library ok; library-plugin-parts, library-plugins, agent-disconnect, agent-bulk-visibility, agent-visibility-saving, plugin-tools, i18n-keys, gui-de, gui-ja and gui-zh-tw, both engines: 155 pass, 0 fail.

At the pushed head, on cb1fe6d5d (mica): the go test guards, ./internal/library -run TestPlugin, i18n-keys and agent-disconnect ok.
2026-11-18 13:52:12 +08:00
yetone cb1fe6d5d9 gui: Get started put away comes back from Settings › General
Once the Agents page's Get started card was hidden (POST
/api/settings/guide {hidden:true}) nothing in the app brought it back.
Hiding it now says where it comes back ("Get started hidden; Settings ›
General brings it back"), and General has a Get started row with Show,
only while the card is hidden and would otherwise show (setup not done,
not gateway mode). Show posts {hidden:false}, redraws the Agents page and
says so; the row goes. The row lives in guideback.js, imported by
navpages.js beside the sidebar's pages, so the core grows by one status
line. Settings' search finds it by its name.

Run (mote, at this tree):
- getting-started, nav-pages-hidden, nav-pages-order, settings-general,
  settings-search, i18n-keys, gui-de, Chromium and WebKit, every
  language: 117 tests, all pass after the fake server answered
  /api/settings with the guide flag as the real one does.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand, each red, then put back:
- renderNavPages not calling guideBack: getting-started 20 of 60 red
  (the row never shows).
- the hide's status line removed: getting-started 30 of 60 red.

Not tried: the real app window.
2026-11-18 13:46:51 +08:00
yetone 36d784da4b gui: the check-in time reads as the one time for every vendor
settings.checkinAt is one time that every daily check-in waits for. Its
row is drawn under each vendor's check-in, in WorkBuddy's, Trae's,
MiniMax's, Qoder's and each plugin's editor, and its picks said Off and
On. Under one vendor that read as turning that vendor's check-in off,
while it set every vendor's time. The row is now "Check-in time for every
vendor", with "Day start" and "Set time". The backend keeps one time, so
the row stays one shared setting rather than one per vendor. Same
settings, same saves. Translated in zh, zh-TW, ja and de.

Run (mote, at this tree):
- checkin-at.test.cjs (Chromium and WebKit, 1100 and 420, en zh zh-TW ja
  de) and i18n-keys.test.cjs: 44 pass.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand: checkin-at against the old checkinnow.js, 20 of 40 red
(the name and the Off/On picks), every engine, width and language.

Not tried: the real app window.
2026-11-18 13:44:53 +08:00
yetone afabb7f90f library: a skill the router lists stays a /name of Claude Code's
RoyShen on X (yuushabu_buyinn): with the skill router on, / in the agent
no longer picks a skill. A listed skill has no link of its own in the
skills folder, so Claude Code had no /name for it.

For each skill the router lists for Claude Code (any profile; not a
plugin agent or WSL), routerCommands writes <claude dir>/commands/
<name>.md: the skill's description, disable-model-invocation: true, and
a body that has the agent read the skill's SKILL.md at the router's path
and follow it, with $ARGUMENTS. The flag keeps the description out of
the model's prompt, so the router still saves what it saved. The stubs
go in the commands folder, not the skills folder, because Crush, DevEco
Code and Kimi Code read ~/.claude/skills too and ignore the flag.

Applied.RouterCommands records the files with their hash (syncOwnFiles):
one the user changed is theirs. A user's own command file by that name,
or a Library command of that name given to Claude Code, means no stub;
syncCommands takes a stub's file over when such a command is added. The
command import leaves the stubs out. Router off, or the skill kept
direct: the stub goes.

Run:
- mica-run go test -tags nogui ./internal/library -count=1 -timeout 45m: ok
  (277s); GOOS=linux and GOOS=windows go vet ./internal/library: ok;
  gofmt -l clean. Base 18fe1e2dc (fetch failed at commit time).
- Broken by hand: routerCommandsDir returning "" (the old behaviour)
  turns TestSkillRouterKeepsSlashCommands red.
- Real Claude Code 2.1.316 in a sandbox HOME, magpie built from this
  tree placing two skills (okapi, zebu) with the router on, through a
  recording proxy to the gateway (auto/claude-haiku-5-5): the / menu
  lists /okapi and /zebu with their descriptions; "/okapi" answered the
  codeword from okapi's SKILL.md; "Use my zebu skill." went through
  magpie-skills and answered zebu's; every run's first request has each
  description once, in the router's own line, none from a stub. Router
  off: both stubs gone, links back, settings.json's rules gone.

Not tried: Windows and Linux Claude Code (the path is the same
filepath.Join; Windows rules use claudePath already). The Library's
"keep direct" tooltip still says "to type it as /name", which stays
true for the other agents.
2026-11-18 13:43:49 +08:00
yetone 888d4eba52 library: the MCP market puts the most used servers first, counted from the day's report
gugediyige666 and freedomf26 on X asked for an MCP list ranked by
downloads, searchable and installable. Search and install from the list
were already there; skills were already ranked by skills.sh's install
counts. What was missing was a count of who uses each MCP server.

- internal/library/market_public.go: PublicServers names the Library's
  servers that an agent is given and that the market lists from what
  ships with magpie (featured, or the registry snapshot), by market id
  only, matched by serverKey. A bare command names no package and is
  never matched; a server of the user's own, one found only by a
  search, and its address, command or keys never go.
- internal/stats/plugins.go: the day's plugin report carries them as
  "servers" (at most 50), and goes when either list has something.
  PluginCounts returns a Board with plugins and servers.
- site/pluginstats.js: servers are kept as mcp:<id> beside the plugins,
  pruned apart (D1 binds at most 100 values a statement; the test's
  stand-in now enforces that), never liked, and /api/plugins/stats
  returns them under servers.
- GUI: with nothing searched, a server with 20 or more users comes
  first, most used first, with a person chip of its count; the rest
  keep the curated order. Counts are waited for at most a second, so a
  drawn list never reorders; a search keeps the registry's ranking; a
  failed ask is tried again after a minute, not with every search.
- Privacy text: READMEs (en, zh), site privacy and start pages (en, zh,
  ja), reference.md, the Settings privacy row (zh, zh-TW, ja, de),
  llms-full.txt and search indexes rebuilt; docs/subsystems/library.md.

Run (mote, rebased on 18fe1e2dc; budget, TestI18n*, i18n-keys, market-used and privacy-usage-stats again at b53e23ba3, ok):
- go test ./internal/library ./internal/stats ./internal/gui (TestPublicServers,
  TestPublicServerIDsAreCatalogIDs, TestSendPlugins, TestPluginCounts,
  TestCoreScriptBudget, TestI18n*): ok. gofmt -l clean; go vet darwin ok,
  GOOS=linux/windows CGO_ENABLED=0 vet of library and stats ok.
- node --test site/pluginstats.test.mjs: 8 of 8.
- GUI, chromium and webkit, en/zh/zh-TW/ja/de: market-used (new, 30 of
  30), i18n-keys, i18n-en-no-cjk, market-*, plugin-market, privacy-*,
  library-pi-market: 284 of 284.
- Broken by hand: matching a bare command made TestPublicServers name
  "bare-one"; turning byUse off made market-used red. The old single
  DELETE of 100+ bound values made the new site test red.

Not run before the push: the full Go suite and the whole GUI suite.
mote and mica were both running other sessions' full and GUI suites
(load 45 to 270); they run after, on mote. Not tried: a real day's
report reaching usemagpie.ai from a live install (the worker is
checked with curl after deploy).
2026-11-18 13:39:27 +08:00
yetone b53e23ba3e gui: a provider's editor says Close while nothing waits for its Save
The provider editor mixes two kinds of control. An account's auto-switch,
a key's concurrency and spend pills and the Claude Code rows act at once
and say so in the status pill, while the rest waits for Save. Its Cancel
said Cancel either way, so after a switch that had already been made, it
read as if Cancel would take it back. The button now says Close while
the draft matches what is saved (providerDirty, the same check Cancel's
discard question asks), and Cancel once a field waits for Save. It is
read again after each input, change and click in the editor. A new
provider's editor keeps Cancel. Escape and the backdrop are unchanged.

Tests: six files that pressed the editor's Cancel on a clean editor press
its .ed-cancel now. lane-limit's draft-pill test brings the pill into
sight before opening its menu: under four files at once a scroll landing
after the click closed it (Chromium, 2 of 4).

Run (mote, at this tree):
- lane-limit.test.cjs: 24 pass.
- the 29 GUI files that press an editor's Cancel, Chromium and WebKit, four
  at a time: 491 pass, 13 red. 12 are red on 68dd531c6 the same way
  ("Working only unpicks", "Try again takes the models unticked", #4392,
  #4410). The other is login-import, Chromium en, once per run under the
  four-way run, at a different line each time. It passed 3 of 3 alone, and
  at 6x and 12x CPU throttling, here and on 68dd531c6. Already filed under
  load: #5035, #5597.
- go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS': ok.

Broken by hand: lane-limit against the old app.js, 8 of 24 red (no
Close, in the Relay and the Codex editor, both engines, en and zh).

Not tried: the real app window, and the whole GUI suite.
2026-11-18 13:35:20 +08:00