Commit Graph
2236 Commits
Author SHA1 Message Date
yetone 47128ffa59 gateway: a remote client's effort reaches Claude Code from every route (amhcwushuang on X)
amhcwushuang on X runs Claude Code -> new-api -> magpie on a server ->
the Claude subscription, and says the thinking level is lost.

Read from new-api (QuantumNous/new-api main): a Claude channel keeps
thinking and output_config as written (relayconvert shared/claude
ApplyReasoning passes a native request through), including the
{role: system} turn's output_config; an OpenAI channel turns the request
into Chat with reasoning_effort (reasoning.ApplyToOpenAIChat), and an
OpenRouter-dialect channel into a `reasoning` object. Claude Code's own
fixture (claude-code-2.1.296.json) carries top-level output_config.effort,
thinking adaptive, and the same effort on a system turn.

magpie already passed, to the spawned Claude Code's --effort: Messages with
a thinking budget or a top-level output_config, Chat reasoning_effort,
Responses reasoning.effort (checked by the new test on the old code).
It did not take the level from:
- a Messages request whose only effort is the last turn's output_config;
- a Chat request with reasoning.effort (an object), output_config.effort
  or a thinking budget in place of reasoning_effort.
Those now set the request's effort. reasoning_effort, when present, stays
the client's word; no setting of the user is read or overridden.

Run: TestClaudeBridgeTakesTheEffortOfEveryRoute red on the old chat.go and
decide.go (4 of 9 cases), green now; gofmt; go vet darwin, linux nogui,
windows on internal/gateway; internal/gateway full package on mote.
Not tried: a real Claude subscription behind new-api; Claude Code's
interactive mode with a message-only effort (the -p stand-in was used).
2026-11-12 08:30:48 +08:00
yetone 3af8fe9cf7 gateway: a Claude account's Fable week used up rests Fable on it, not the account (kaitokiku on X)
Claude Code's refusal for a used-up window is "You've hit your limit" and
names no window, and its rate_limit_info may carry no rateLimitType (the
transcript's rejected row). restAfter read the account's windows as they
were cached before the Fable week filled (Fable 60%, nothing full), so
Pooled said no and the whole account rested for the refusal's time:
Opus, Sonnet and Haiku with it, though the other weekly quota was left.

A quota refusal on an account whose reading holds a window of some models
only that counts the model, none known full, now asks for the reading
again and narrows the rest to the model when it shows that pool full
(narrowWhenRead, as for an unread account, #2036). Every route rests
through restAfter, so Messages, Chat Completions, Responses and the group
fallback share it; Claude is not a plugin.

Run at this tree (mote): TestClaudeFableWeekRestsFableOnly red on the old
routing.go (rests the account), green with the fix; internal/provider,
gofmt, vet on darwin, linux and windows. Full internal/gateway follows.
Not tried: a real Fable-limited account; a usage reading that keeps
failing leaves the account resting whole, as before.
2026-11-12 08:27:46 +08:00
yetone 7b5c069c3a gateway: Vertex AI gets a tool's image in a user turn of its own, no "Requests ending with a model turn" after view_image (Voo_Ler on X)
What the user saw: Codex on Google Vertex AI stopped right after "Viewed an
image" with "Requests ending with a model turn are not supported".

Why: Codex's view_image answers with a function_call_output whose output is
[input_text, input_image] (as ~/.codex/sessions rollouts record it). The
Gemini build kept a tool's images in the same user turn as its
functionResponse. Vertex AI answers a response turn mixing in anything else
with that 400 although the last role is user (#1533 showed it for text, and
ce11b1801 split the text out but left images with the response).

What changed: buildCodeAssistSent, for Vertex AI, puts a tool's images in a
user turn after the responses (with what the user said, if anything). The
image and the words are kept. AI Studio, Code Assist (Gemini CLI,
Antigravity) are unchanged: Gemini CLI itself sends a read image beside the
response, and no refusal is known there. Chat and Messages clients reach the
same builder, so they are covered; the image-under-assistant and trailing
model turn cases already end with a user turn (continueText).

Tests: gemini_view_image_test.go posts Codex's real view_image shape (array
output, image-only output, image in a following user message, image in a
model-role message) to /v1/responses against a fake Vertex that refuses as
the real one does; vertexTurnsAway now also refuses an image beside a
response. Reverting codeassist.go makes it fail with the reporter's exact
message, and TestGeminiToolResponseTurnHoldsNoText fails too.

Run: go test ./internal/gateway ./internal/provider on mote, gofmt -l, go vet
-tags nogui for darwin, linux and windows.
Not tried against real Vertex AI: no Vertex credentials on this machine.
2026-11-12 07:50:22 +08:00
yetone 5d5d57cbbb library: Variables are carried in backups and sync, keys only with keys (onducoder on X)
A skill's key set once as a Library variable (ANYSEARCH_API_KEY and the
like) now goes with the library: Bundle.Env carries name, value and agents
(nil from an older magpie, and Put then keeps this computer's). It follows
how servers' tokens are carried: a backup or sync without keys keeps the
names and empties every value (whatever the name, since a variable's name
says nothing of its value), WithSecrets fills them from this computer's, and
one with keys is sealed under its passphrase. A variable with no value is
not written into an agent (syncEnv), and a value the user set in the agent's
file is still never overridden. Not built: showing the variables a skill
needs on its sheet; nothing in a SKILL.md says them reliably.

Run (mote): go test ./internal/library ./internal/backup ./internal/davsync
ok; gofmt clean; go vet darwin, windows, linux -tags nogui clean.
Broken by hand: WithoutSecrets leaving the value turns TestEnvIsCarried red.
Not tried: real Claude Code / Codex reading the carried key; a real WebDAV
or S3 round trip; the full suite; GUI tests (no GUI file touched).
2026-11-12 02:59:41 +08:00
yetone a1a3b6fadb library: DeepSeek Harness folds its context with billion-context through its /bili/ prefix (VantH_off on X)
VantH_off asked for DeepSeek Harness in billion-context's support.
Library's billion-context tab offered Pi, omp, OpenCode, Claude Code, Hermes
and Zed. bili's dsh route is `dsh plugin add billion-context` (billion-context
0.1.213 README), which loads in dsh's process and takes traffic by proxy
settings; magpie's dsh route is baseURL http://127.0.0.1:3425/v1, plain http
on loopback, so that never sees it and the plugin would add tools and fold
nothing (the Hermes case, 00e8242e8). dsh's route baseURL is editable, so it
takes the route Zed and Hermes take, bili's documented /bili/ prefix.

Turned on, magpie runs `bili start --port 8787` and writes magpie's route
baseURL in every dsh profile and the home layer as
http://127.0.0.1:8787/bili/<gateway>/v1 (Anthropic route: no /v1)
(agent.DshThrough: dshSyncFresh with the prefixed gateway). dshReach reads the
prefix back from the profiles' routes (loopback path before the gateway's
address) and Check, Sync, a pick and the serving round (dshWiredWith, which
read gateway.URL() directly) keep it; an address that isn't a local proxy's
goes back to the gateway. Off writes the gateway back. Empty-list string (en,
zh, zh-TW, ja, de), docs (en, zh, ja), llms-full.txt and
docs/subsystems/library.md name dsh. bili's dsh plugin installer is never run
for it. The remaining agents are #5915.

Run (mica, at the pushed head unless said):
- TestDshThroughBili, TestBiliDshThroughPrefix: ok
- see below for the packages and GUI files
Broken by hand:
- dshReach returning gw: TestDshThroughBili red (a sync drops the prefix)
- no "dsh" URL lane: TestBiliDshThroughPrefix red (dsh not offered)
Not tried:
- a real dsh and a real `bili start`; tests fake bili and the probe, so
  whether dsh's SDK sends to the prefixed address is by analogy with Hermes
- Windows run (vet only)
2026-11-12 02:24:10 +08:00
yetone e6bf4adf1f usage: Claude Code's helper requests are labelled, the largest cache write is one click away (recih on X, #6199)
Claude Code's AgentSummary and its auto mode classifier name themselves
nowhere in the request, so there is no client marker to read. The gateway
tells them by their content (inferredKind: a claude-cli/ request on the
Messages API; the classifier by autoModeClassifierAsk, the summary by its
last user text "Describe your ... in 3-5 words") and records them as
agent_summary_inferred and auto_mode_check_inferred. The purpose catalog
names them "Progress summary (inferred)" and "Auto mode check (inferred)"
and puts each with its plain kind's purpose, so the existing Purpose filter
lists both; nothing known and nothing inferred share a name. A tool that
printed the same words, a chat, and another agent's request stay unmarked.

A requests page now also holds BigWrite, the gateway-served row that wrote
the most to the cache (cells, page-v1.json and pageFromLedger all carry it;
rows from session files have no request to open). The Requests line shows
it as "109K largest write", a button that opens that request through
openUsageRoute. settledCountVersion is raised to 3, which keys the cached
pages.

Not done: the per-request branch recovery result asked for in #6199. No
structured field holds it.

Run on mote (load 21-24 of 18 cores, mica was higher): go test ./internal/usage
./internal/usageapi, the gateway and gui purpose tests, go vet for darwin,
linux (nogui) and windows, gofmt; the GUI files usage-big-write (new),
purpose-filter, routing-kind, i18n-keys and usage-ledger in chromium and
webkit. Broken by hand: inferredKind returning "" turns
TestClaudeHelperRequestsAreLabelled red; the larger-than test of BigWrite.add
turned round turns TestRequestPageBigWrite red on both paths; the jump off
turns usage-big-write red. Not tried: a real Claude Code session against a
live subscription, Linux WebKitGTK.
2026-11-12 02:01:31 +08:00
yetone e174b55150 library: a Variables tab gives environment variables to Claude Code and Codex (paopao_baobao on X)
An environment variable is kept once in the Library and written into each
agent picked: Claude Code's settings.json "env", Codex's config.toml
[shell_environment_policy.set] (a sub-table or inline set is edited; a
dotted spelling is refused). It follows Hooks: Applied.Env records what
magpie wrote, so turning it off or removing it takes out only that, and a
value the user set or changed in the file is never overridden (a conflict
is a problem on the row). An unreadable file is an error, nothing is
written. The tab has name, value and agent chips, an edit sheet and a
row Remove with a confirm; its sidebar entry is in "Every agent". Not
carried in backups, as hooks first were. docs/subsystems/library.md updated.

Run (mica, sandbox HOME): internal/library and internal/gui go tests ok;
gofmt clean; go vet darwin, linux -tags nogui, windows clean; GUI
library-*, i18n-* in chromium and webkit (en, zh, zh-TW, ja, de, 440px):
all green except "the Library while it loads", red on the merge base too
(not from this change). Existing tab-list assertions in library-hooks,
-subagents, -groups, -loading now include Variables.
Broken by hand: syncEnv overwriting the user's value turns
TestEnvNeverOverridesTheUsers red.
Not tried: real Claude Code / Codex reading the written env; other agents
(Gemini .env, Qwen, Droid); WSL; env in backup carry.
2026-11-12 02:00:19 +08:00
yetone a5e805f574 Codex: Ultrafast beside Fast in a group member, and a Fast/Ultrafast setting per model (kdajenks on X)
kdajenks (magpie 0.1.3739, Codex on ChatGPT Pro) could set Fast only from a
routing group's member row and had no Ultrafast there, and no way to set the
speed in the model's own settings. Ultrafast exists: Codex's catalog lists
the `ultrafast` service tier, the code already sent it for agent picks and
Codex's service-tier row, and the live account's service_tiers hold it.

- Group member: the button steps Standard speed, Fast, Ultrafast (where an
  account offers it, `ultraOK`), back to Standard. `Group.Ultra` is a subset of
  `Fast`, kept through rename, fold, share, gone-filter and the CLI
  (`magpie group ... ultra=`). The gateway marks the candidate `ultra`.
- Per model: `settings.ModelTiers` ("<provider>/<model>" to priority or
  ultrafast), `provider.SetModelTier` (refused where CanFast/CanUltra say no),
  `ModelPref.Tier` in Model settings (Standard speed / Fast / Ultrafast, in
  modellimits.js), and `magpie model tier <provider/model> [fast|ultrafast|usual]`.
  The gateway sends it on a direct pick for an agent with no fast pick of its
  own, through fastPick, so an account without Ultrafast gets priority. A group
  member goes as the group says.
- Docs: gateway-routing, providers-accounts, reference.

Run (mica, at the rebased head over a6d84e13a):
- gofmt -l clean; go vet darwin, linux nogui, windows clean.
- go test internal/provider, internal/settings ok; internal/gui and
  internal/cli ran: the one red of mine (TestSettingsSaveKeepsWhatItDoesNotSend
  wanting ModelTiers) is fixed in this commit; the others are not mine and
  red on a clean origin/main: TestEveryRouteHasACommandOrIsNamed (#6202),
  TestPanelHiddenByWailsMarksPageOutOfSight (#6203, not checked on main).
- internal/gateway ok (984s).
- GUI, chromium and webkit: new model-speed.test.cjs (30, five languages, 1200
  and 420px), plus model-*, group-*, fast-*, i18n-*, text-size,
  codex-service-tier, panel-*, routing-group*, routing-save* files. Red and not
  mine, same on a clean origin/main worktree: fast-pick and fast-ultra (#6201),
  group-editor-selected (#5049).
- New tests TestModelTierSentToEveryAgent, TestGroupMemberUltrafast,
  TestCleanModelTier, TestSaveGroupUltra.

Broken by hand: removing the gateway's model-tier branch and the candidate
`ultra` copies turned both gateway tests red; turning off the Ultrafast choice
in Model settings turned 20 of 30 GUI tests red; reverting the member button to
two states turned 10 of 30 red.

Not tried: a real ChatGPT account sending Ultrafast through the new setting;
the agent picker's bolt does not show a model-level default; Windows and Linux
GUI runs.
2026-11-12 01:56:26 +08:00
yetone a6d84e13a9 agent: Claude Desktop can use this computer's LAN HTTPS address for SSH remote sessions (zyc-bit on X, #4546)
Desktop's built-in SSH remote sessions hand the profile's gateway address
and key to the remote host. magpie wrote 127.0.0.1 and this computer's own
key there, so the host refused it (provider_loopback; a non-loopback address
must be https), the gateway turned the key away from another machine, and
3p mode's sshHostAllowlist (empty) allowed no host.

Desktop's row gets a "gateway" picker, drawn only while LAN sharing is on
and an address of this computer is https (gateway.LANURLs: HTTPS on, or
MAGPIE_PUBLIC_URL): "This computer" (default, loopback) or that address.
The pick is settings.DesktopGateway (carried by the settings save, kept by
KeepOwn). desktopOn / desktopCheck / desktopKeyApplied write and compare
desktopGateway() and the key at it (agentKeyAt: the sharing key). On a
non-loopback address sshHostAllowlist is seeded once with ["*"]
(desktopSeedOnce; the user may narrow it, never rewritten). The pick holds
only while it is still one of the https addresses; Agent.Gateway is
desktopGateway, so Rekey (after the sharing toggle, and now after the HTTPS
toggle) sets Desktop again, back to loopback when sharing goes off.
desktopIsOurGateway takes this computer's LAN addresses; realReachProbe no
longer verifies the certificate (magpie's CA is not trusted on this
computer), which read a LAN https address as unreachable.

Run (mica, sandbox HOME): go test ./internal/agent ./internal/settings
./internal/settingsapi ok; ./internal/gui ok except
TestPanelHiddenByWailsMarksPageOutOfSight, flaky the same on origin/main
fc615339f (#5322); go vet darwin, linux (nogui) and windows on the three
packages; gofmt clean. TestDesktopPointedAtLANHTTPS is red when desktopOn
writes loopback and when the key is not the sharing key. GUI
desktop-gateway-address.test.cjs 20/20 (chromium + webkit, en zh zh-TW ja
de, 1100 and 420px), red 20/20 with the field left in the "nothing to pick"
filter's absence; i18n-keys, desktop-*, click-scroll files.

Not tried: a real Desktop SSH session to a remote host, the remote host
trusting magpie's CA (it must, or use an imported certificate), the real
Claude Desktop app. Windows and Linux runs only vetted.
2026-11-12 01:28:03 +08:00
yetone fc615339f0 provider: Alibaba Cloud Token Plan quota read with the account's AccessKey; intl Token Plan preset (pppMathew on X, #2940)
Cause: a Token Plan sk-sp- key only authorizes inference. The plan's
usage sits on the Bailian console gateway, which wants a console token
(the key gets BailianGateway.Login.NotLogined) that Alibaba's own `bl` CLI
makes from the account's AccessKey through GenerateCLIAccessToken (ACS3
signed). magpie had no such path, so the usage card showed no quota.

Change:
- alibaba_usage.go: ACS3-HMAC-SHA256 signing, the console token (kept 20
  minutes per AccessKey and region, made again once on NotLogined), the
  personal plan's usage API, and per<N><Unit>Percentage/ResetTime read as
  5 hours / Weekly / Month windows. Hooked in as AccessKeyVendor "alibaba"
  (editor asks AccessKey ID and Secret, a keyless card says so),
  accountPlanOf (routing), PlanQuotas and the key card tag.
- Hosts: token-plan.cn-beijing.maas.aliyuncs.com (bailian-token-plan) and
  the new token-plan.ap-southeast-1.maas.aliyuncs.com preset
  alibaba-token-plan (Alibaba Cloud international Token Plan, #2940), also
  an OpenCode import target.
- Editor hint in zh, zh-TW, ja, de; docs (providers-accounts, reference).

Not covered: qwen-token-plan (Qwen AI platform) and qwencloud-token-plan
have no AccessKey route (browser-session console, #5829); team plans.

Run on mica at this tree: go test ./internal/gui ./internal/provider ok;
go vet darwin, linux nogui, windows on provider/gui clean; GUI files
i18n-keys, i18n-en-no-cjk, tencent-access-key, volc-access-key,
usage-access-key-card, tencent-cloud in chromium and webkit: 60 of 64 pass,
the 4 reds are tencent-cloud's "region clicked right after the strip
scrolled", red the same at origin/main 319753d89 (filed: #4321, #4399,
#4625). Broke it by hand: dropping the *100 on the percentage turns
TestAliReadWindows and TestAliPlanQuotas red.
Tests never reach the network (httptest behind a rewriting transport).

Not tried: no real Alibaba Cloud account, so neither the mint nor the
usage reply was seen live; the field names and the envelope come from the
official client's source. The international gateway host
(bailian-singapore-cs.alibabacloud.com) and the RAM-user case are the least
certain. The full suite was not run before the tag.
2026-11-12 01:20:52 +08:00
yetone 319753d892 gateway: a key can follow, force on or force off masking (y0ngb1n on X)
A gateway key now carries Redact: "" follows the global setting, "on"
masks that key's requests even when masking is off, "off" sends them as
written. Trusted devices turn it off, external ones are forced on.

- access: Key.Redact, CleanRedact and the redact-key action; an issued key
  inherits "on" from its issuer and can't turn it off; the default key
  takes the same values.
- gateway: maskingFor(ctx) decides per request; every route that masked
  (chat, native, text hits, the Masked-As header) asks it. A local request
  with no key keeps the global setting. masking.WithForced carries "on"
  into the masker; the redact plugin's InUse counts keys set on.
- CLI: magpie gateway keys redact <key> follow|on|off.
- GUI: key-row badge and an app menu; 7 strings in zh, zh-TW, ja, de.
- docs/subsystems/gateway-routing.md: the Redact paragraph.

Note: "on" with global masking off masks secrets and personal data by the
defaults. An off key is still masked on a Remote magpie hop, which sends no
Masked-As header.

Run (mote-run): go test for access, masking, redact, cli, gui and
plugins/redact packages and the new gateway key_redact tests; gofmt -l and
go vet on darwin, windows and linux nogui, all clean; the new GUI test.
Broken by hand: maskingFor returning the global value goes red in
key_redact_test.go.
Not tried: a real remote-to-remote hop with two keys; the full suite runs
after the tag.
2026-11-12 01:01:32 +08:00
yetone db58a88a83 gateway: a request masked by another build with the same settings is not masked again (Luxzinw on X)
Cause: X-Magpie-Masked-As carried this build's version and the other
magpie skipped its pass only on an exact match, so 0.1.3771 into 0.1.3638
(or any two builds) masked twice. Now the settings fingerprint must match
and the sender's build must be >= maskerSince (3584, the last masker
change), whichever build is newer; the header is passed on as it came
(it named the passing magpie's build, which never masked). Old-format
headers (v0.1.N/fp) parse the same.

Stand-ins: a user name's made-up name, public-ip- names and {{}}
placeholders are left alone by a process that has none of them in memory
(TestSecondProcessLeavesStandInsAlone). A made-up key looks like a key and
is masked again by such a process; the header skip covers that between
magpies with the same settings, not different ones.

Run (mote): go test -run 'MaskedBefore|RemoteMagpie' ./internal/gateway ok;
internal/redact SecondProcess ok. Broken by hand: maskerSince=999999 turns
the new tests red. Not tried: a real two-machine hop; full suite after tag.
2026-11-12 01:01:32 +08:00
yetone 60fde6fb1a library: an MCP server holds several accounts, one in use, switched in place (Elorynth on X)
A remote server can hold several OAuth sign-ins or several sets of
headers (Authorization keys), one in use, which every agent given the
server follows.

- mcpauth: a server's sign-ins are kept with the one in use at m[name]
  and the others in Spare (Use, RemoveAccount, StartAccount); the gateway
  sends the one in use from its next request on.
- library: Server.Accounts and Server.Account; `live` lays the account's
  headers over the server's own in through, remoteHeaders and hubKey, so a
  switch rewrites each agent's file. A save from the editor keeps them,
  and a backup or sync carries no account's key (carry.go). Add, use and
  remove calls, POST /api/library/mcp-account, and mcp-signin takes add
  and label.
- GUI: a server with one set of headers or one sign-in looks as before,
  with a quiet "+ Add account"; with several, a list with the one in use
  marked, a click to switch, an x to remove. Four languages.
- mcp_rename tests compare mcpauth.Record with reflect.DeepEqual now, as
  Spare makes it not comparable (the windows one too).

Run (mote, at this tree): go test ./internal/library ./internal/mcpauth/...
./internal/gui; go vet darwin, linux nogui, windows; mcp-accounts.test.cjs
in chromium and webkit, five languages, plus the existing mcp-* and
library-mcp-* and i18n GUI files. Broken by hand: live() returning the
server unchanged turns TestServerAccountsSwitchEveryAgent red; the use
click removed turns mcp-accounts red.
Not tried: a real OAuth server with two real accounts; an agent's upstream
Mcp-Session-Id is not reset by a switch.
2026-11-12 00:57:23 +08:00
yetone 4b1f3eca4a usage: a ZCode call magpie routed is not counted again as a local session's (nori_tsukiji on X)
With ZCode on the same computer as magpie, the Usage page's local session
calls came out equal to the calls magpie had routed: each was counted twice.

Cause: a ZCode request names its session without the sess_ prefix ZCode's
database gives it (zcodeBareID; GatewayKeys, Titles and the Sessions list
already knew). The Usage page pairs a gateway record with a session file's
call by session, tokens and end time (matchedBlocks), and the calls read
from ZCode's database kept sess_<id> / sess_subagent_agent_<id>, so they
never shared a session with the gateway's records and were never paired.
Leaving out calls whose providerID is "magpie" (ocGatewayProvider) only
helps when ZCode writes that id beside a reply; with any other id the call
was listed twice.

Fix: readZCodeCalls gives each call the bare session id; zcode's call parse
version is 3, so cached shards are read again. Claude Code, Codex, Pi,
OpenCode, Kimi, dsh, grok, minimax, agy and WorkBuddy name their sessions as
their requests do (raft.go's requestIDs has ZCode alone); not changed.

Run on mote: go test ./internal/usage ./internal/sessions (ok; the zcode
fork test's expected session ids are now the bare ones), gui and cli with
-run 'ZCode|Zcode|Usage|Session' (ok), go vet darwin/linux/windows (clean),
gofmt -l clean. TestZCodeCallsPairWithTheGatewaysRecords (a session, a
provider id of ZCode's own, a subagent) was red on the old code: 4 rows for
2 routed calls, the local ones Session sess_7c1f against the gateway's 7c1f.
Not tried: a real ZCode database (this computer has none, only the app's
tasks index) and the full suite.
2026-11-12 00:42:50 +08:00
yetone 7e3e0fec4f gui: put agents back as they were when magpie quits, connect them again at start (tudjam17795 on X)
New Settings > General switch, "Put agents back when quitting" (zh: 退出时还原 Agent 配置),
default off. With it on, quitting the GUI app runs the same restore Disconnect does
for every agent magpie has connected (*.before-magpie files back byte for byte), and the
next start connects those agents again. Off keeps today's behaviour: a connected agent
keeps magpie as it quits.

- agent.RestoreOnQuit disconnects each wired agent that the user did not disconnect, then
  forgets the <id>.disconnected mark, so the quit leaves no mark; it stashes the list of ids.
  agent.RewireOnStart takes that list once and connects those still unwired and not
  disconnected since. An agent the user disconnected stays disconnected.
- gui: OnShutdown restores only when the setting is on and this process served the
  gateway; start re-wires in the background (not while the gateway is paused). A restore
  on quit also quits at once without the ask.
- settings.RestoreOnQuit, settingsapi key kept unless sent, row in index.html, i18n for
  zh, zh-TW, ja, de, docs in gui-shell.md and agent-wiring.md.
- app.js: the repeated Off/On settings rows go through one helper (segsOO), 422 bytes
  smaller overall, so TestCoreScriptBudget passes without raising the budget.

Run (sandbox HOME, mica because mote was loaded):
- go test internal/agent, internal/gui, internal/settings, internal/settingsapi, internal/cli
  at the rebased head: the new tests and the budget test pass.
- GUI, chromium and webkit, five languages, widths 1100 and 420: restore-on-quit (new),
  quit-ask-setting, quit-ask, settings-general, settings-sections, settings-places,
  i18n-keys, i18n-en-no-cjk, gui-de, gui-ja, gui-zh-tw, and for the rows moved to
  segsOO: reduce-motion, skeleton-bird, lightweight, keep-login, checkin-at,
  update-auto, update-hide, update-restart, update-download, tray-bird, tray-logos,
  tray-cost, wsl-agents-setting, login-allow. All 0 fail.
- gofmt -l clean; go vet darwin, windows, linux -tags nogui clean.

Broken by hand: not forgetting the disconnected mark turns
TestRestoreOnQuitAndRewireOnStart and TestRestoreOnQuitLeavesUserDisconnected red;
dropping the Disconnected() checks turns TestRestoreOnQuitLeavesUserDisconnected red;
dropping the setting gate turns TestRestoreAgentsOnQuit red.

Known reds, not from this change (same on the base 60559ee73): 20 GUI failures in
settings-hints, settings-lines-wrap and settings-search (#6133, #6107, #6156, #6073);
internal/gui TestPanelHiddenByWailsMarksPageOutOfSight killed under load (#6063);
internal/agent TestPiGroupEntryKeepsItsMembers on mica.

Not tried: real agent configs (sandbox HOME only), a real Wails quit on a Mac with real
accounts, Windows via win-run, the Linux WebKitGTK app.
2026-11-12 00:19:34 +08:00
yetone fe20e4dbd8 sessions: an uninstalled agent's sessions can be deleted and are not offered Resume (_SekiBetu_ on X)
OpenCode (and Cline, Grok, Kimi, Hermes) keep sessions in their own
database, so magpie never deletes them and they stay listed after the
agent is uninstalled, with only Resume. When the agent's command is gone
from PATH, its rows now get Delete (Forget: hidden through the gateway
hidden list, a trash note marked forgot, the agent's files untouched,
Restore unhides) and no resume command. Installed agents are unchanged.

Run on mote: go test -count=1 ./internal/sessions ./internal/gui ok;
go vet darwin, windows, linux -tags nogui ok; gofmt clean; GUI files
sessions-forget (new, 5 languages x chromium+webkit), sessions-gateway-delete,
sessions-manage, sessions-folder-delete, sessions-purge, sessions-row-narrow,
i18n-keys, i18n-en-no-cjk all pass.
Broken by hand: removing the hidden-row filter turned the gui Go test red;
the old client.js turned sessions-forget red (5 of 5 chromium).
Not tried: a real uninstalled OpenCode on a user's machine; the Usage
page's /api/sessions list still shows a forgotten row (manage page only);
the whole GUI suite and full go suite run after the tag.
2026-11-12 00:09:56 +08:00
yetone d3aecfe958 test models: a plugin model its vendor queued answers OK, saying the queue (Mr7Faith on X)
Qoder personal_standard: qmodel_latest (shown as Qwen4-Max-Preview) and
dfmodel were queued (503 "queued the request for qmodel_latest (this
plan's queue: p4, 1 ahead); try again in 60s"). The test sends
X-Magpie-Fallback so the plugin says the queue at once, and the probe
counted that 503 a failure: red all day, and Working only unpicked the
models. The id in the error is the model's own id (the listing's display
name changed), not a mapping bug. A queued model is served and an agent's
turn waits it out, so the probe now sets OK with Result.Queued, which the
chip's title shows.

Run on mote: go test -run TestPluginModelTest ./internal/provider ok
(TestPluginModelTestSaysQueued now wants OK + Queued; build-red on the old
test.go); go vet darwin/linux/windows ./internal/provider; GUI
models-queued, model-test-one, i18n-keys in chromium and webkit ok;
models-queued red without the app.js line. models-works-only is red on
origin/main c43314792 too (#4391). Not run: full suite, real Qoder account.
2026-11-11 23:54:16 +08:00
yetone b52c711142 Restore what 85e6ec540 reverted: it was committed on a stale index and took out b587eb306's and earlier work (webview2, library skills, opencode endpoints, quotas); this puts the tree at b587eb306 plus the Paseo agent only 2026-11-11 23:09:15 +08:00
yetone 85e6ec5406 agent: Paseo's Claude model picker lists magpie's models (@TheMist016 on X)
Paseo (getpaseo/paseo) starts the same Claude Code, but builds its own model
list: first-party models plus settings.json's `model` and a few
ANTHROPIC_*_MODEL variables (providers/claude/models.ts). It never reads
Claude Code's modelPicker, where magpie writes every model, so the rest were
not selectable in Paseo. Paseo's own ~/.paseo/config.json takes
agents.providers.claude.additionalModels ([{id,label,description}], checked
against protocol/src/provider-config.ts) and passes each id to Claude Code as
written.

New agent "Paseo" (detected by ~/.paseo or PASEO_HOME): its switch writes the
models Claude Code's /model lists (same ids, [1m] marks, names; only the ones
picked for it) there, marked "via magpie" in the description; the user's own
entries and keys stay, off takes out only magpie's, a sync refreshes when on.
Claude Code must be connected to magpie as well.

Run (mote-run, sandbox HOME in tests): TestPaseoAdditionalModels,
TestStateListsPaseo, internal/agentenv, internal/gui full package ok;
internal/agent full run red only on TestPiGroupEntryKeepsItsMembers, which is
red the same on origin/main 12cd456f2 (passes alone; filed). gofmt clean,
vet darwin, windows and linux nogui on internal/agent. Broken by hand: Set
writing no models goes red.
Not tried: a real Paseo daemon reading the file (checked against its schema
source only); GUI browser suites.
2026-11-11 23:08:39 +08:00
yetone 12cd456f2c library: Skills > New skill makes a skill of the user's own (josephBenchap on X)
josephBenchap asked to create a skill in the Library; it could only
install or bring one in. Skills now has a New skill button beside Find
skills. A dialog takes a name, a description and the agents (the app's
chips, no select); Create writes skills/<name>/SKILL.md in the library's
folder with name and description front matter (YAML-marshalled, one line,
at most 1024 characters), lists it with no source, gives it to the agents
picked like any imported skill, and opens it in the reader, whose path
link opens the file in the user's editor. The name is checkName's, and
refused when the library or an agent already has one by that name
(compared without case) or a folder is in the way. The follow-the-server
note already sits above the Skills tab, so it covers this too. en, zh,
zh-TW, ja, de. docs/subsystems/library.md says so.

Run on mote at this head:
- gofmt -l clean; go vet ./internal/library ./internal/gui on darwin,
  GOOS=linux -tags nogui and GOOS=windows: ok.
- go test ./internal/library ./internal/gui: ok. TestCreateSkill is new.
- GUI node --test in chromium and webkit: library-new-skill (new; en and
  zh, 1100 and 420px: refusal stays in the dialog, agent untick posted,
  reader opens, no select, no sideways scroll), library-items,
  library-follow-server, library-all, library-discover-jump,
  library-groups, library-intro-width, library-linked-set,
  library-pick-remove, library-row-open-scroll, library-ime-scroll,
  library-desktop-skills, library-gone-agents, library-bar-more,
  library-chip-fan, i18n-keys, i18n-en-no-cjk, gui-de, gui-ja, gui-zh-tw:
  all pass.
- library-loading is red (2 of 6) on this tree and on origin/main
  e6fe481b3 alike: the tab list gained Claude plugins. Already #5997.

Broken by hand: the agents' own-skill name check removed:
TestCreateSkill red ("theirs" was taken).

Not tried: the real app; Windows run of the tests (vet only); the full
suite starts after the tag.
2026-11-11 23:01:12 +08:00
yetone 5a475f90c3 opencode go: each API goes to the endpoint Go's docs name, Gemini at /inference/go/google/v1beta (@jd04063221 on X)
Go's docs (opencode.ai/docs/console/go, Endpoints) give one URL per API
under /inference/go: /openai/v1, /anthropic, /google/v1beta. The preset
and the filled-in defaults still used /zen/go and Gemini's
/inference/go/v1.

The preset now gives the three; a preset provider saved with the older
URLs is moved on load; openCodeRoot reads the per-API forms; a Go URL in
the per-API form gets its siblings in that form. A URL the user gave stays.

Run (mote): go test -run 'OpenCode|Preset|PlanQuota|Balance|Go|Gemini'
./internal/provider ./internal/gateway ok; vet darwin/linux/windows ok.
Broken by hand: old opencode_endpoints.go/presets.go with the new
TestOpenCodeEndpointsFilledIn goes red on 6 cases.
Not tried: a real Go key (none here); old /zen/go routes still answer
(400 MissingSessionID unauthenticated), so URLs the user set keep working.
Full suite and GUI files not run before the tag.
2026-11-11 22:55:43 +08:00
yetone 93b855d90e remote quotas: a card is wanted by its whole provider path, not its first part (748975219 on X)
With only relay/strata/model enabled on a Remote, the cards of relay/kiro and
relay/codex still passed, since remoteCardWanted compared the first part of
the card's id alone. A card is now wanted when its id is the provider path of
an enabled model (its id less the last part) or a parent of it, whole parts
only (relay/kir never matches relay/kiro). A model listed with no provider
still leaves it unknown, so all shown. cardWantedFor holds the rule.

Run (mote): TestRemoteCardWantedByWholePath (two levels, three levels,
non-boundary prefixes, several models, one level, no provider) is red with
the first-part rule put back by hand, green with the fix; -run Remote in
internal/provider ok; go vet darwin/linux/windows ok; gofmt clean. Full
internal/provider: TestQuotaSpanCarriesEveryWindowField and
TestKeptQuotaReportAsksNobody are red, and red the same on origin/main
bbfa8501f without this change (open issues 4457/4190 and 3487).
Siblings: remoteOf and ThroughSelf take one leading part on purpose (a
remote's own id), unchanged. Not tried: a real multi-level chain of magpies.
2026-11-11 22:53:50 +08:00
yetone 0706d7a35a usage: a ChatGPT card has an image row: used up until the refusal's reset, else unknown (#6160, hqqqqqqqh on X)
ChatGPT's image generation has a quota apart from the 5-hour and weekly
windows. Neither /wham/usage (additional_rate_limits is null) nor the reply
headers (x-codex-primary-*, x-codex-secondary-*) tell it, so no remaining
count exists to show. Each Codex account's card (Usage page, magpie quota
--json, /v1/magpie/quotas, /v1/magpie/quotas/cards) now has an "Image
generation" row (provider.WithImageLane, Lane "images", Text and Aside so
routing, holds, history, tray and statusline never see it): "Used up" with
the reset time while the image model rests on that account after a refusal
(the #2244 drawing-lane rest, whose time is the refusal's resets_at), and
"Unknown" otherwise. Never a share or a count. Shown in en, zh, zh-TW, ja, de.

app.js: a Text row's display now goes through t(), a same-length change, as
the core script budget has 1 byte of room.

Run (on mote): go test -count=1 -run 'TestWithImageLane|TestCodexImageRow'
./internal/provider ./internal/gateway ok; codex-image-row.test.cjs in
chromium and webkit at 900 and 390px in all five languages ok;
TestCoreScriptBudget ok; go vet darwin, windows, linux nogui on provider and
gateway ok; gofmt clean; 158 GUI files matching i18n/quota/usage/balance
names in both engines (result in the follow-up).
Broken by hand: the GUI test is red with app.js's display line put back to
the old form; the Go row tests are red with imageRestOf returning false.
Not tried: a real ChatGPT account hitting its image quota (the row is
driven by a faked refusal's rest); the generated-image count the issue also
asks for is not built.
2026-11-11 21:59:36 +08:00
yetone da169135a0 usage: an empty page says session files aren't read yet, and allows them (simonzyzy on X)
Claude Code's and Codex's sessions, and each call's tokens and time, need no provider: with the consent given, a sandbox HOME with no providers lists both agents' sessions and /api/usage/requests returns their calls (source log, ms, tokens). The only gate is sessions/reads asked=false, which the Sessions page asks but the Usage Overview and Requests pages did not mention; they said to point an agent at a catalog model. Now they say the files aren't read yet and offer one button that allows the agents found. The Sessions page says live output speed is measured only on gateway requests and where the files' own figures are.
2026-11-11 21:49:11 +08:00
yetone f5124ea179 library: a computer that follows the server says its changes are replaced (JiuLiaowkvn on X)
With Settings > Sync > This computer set to Follows the server, a skill
or MCP server added in the Library is replaced by the next sync, and the
reporter read that as the update deleting their skills. The Library now
says it in one line above Instructions, MCP, Skills, Hooks, Subagents and
Plugins (Memory too while memory is synced), with a link that opens the
This computer row. Nothing is said when sync is off, the part isn't
synced, or the computer syncs both ways. en, zh, zh-TW, ja, de.

Run on mote: library-follow-server.test.cjs (new, 48 cases x en/zh, 1100
and 420px) in chromium and webkit; broken by hand (note not appended) it
goes 29 red. Also green in both engines: i18n-keys, i18n-en-no-cjk,
sync-follow-server, library-items, library-intro-width, library-hooks,
library-all (chromium).
Not tried: the full suite, the real app, a real sync server.
2026-11-11 21:46:26 +08:00
yetone 8016205e3f provider: trust a self-signed server's certificate by fingerprint, for Remote magpie and any https address of your own (Zhangzhangi on X)
Zhangzhangi on X couldn't add a Remote magpie at a domain with a
self-signed certificate ("x509: "api.magpie.local" certificate is not
standards compliant") and asked for a skip-verification option. A
follow-up asked for the same on other self-signed hosts.

This adds a pin (trust on first use), not a blind skip. It is off by
default and kept per provider:
- Advanced → Server certificate → "Trust its certificate…" fetches the
  certificate the server shows (provider/peekcert) and lists its SHA-256,
  subject, issuer and expiry. "Trust this certificate" keeps the
  fingerprint as the provider's serverPin.
- From then on only that certificate is accepted (netproxy pinTLS:
  InsecureSkipVerify plus VerifyConnection comparing the leaf's DER
  SHA-256). Another one fails with PinMismatchError, saying the server
  showed a certificate other than the one trusted.
- The editor shows a red "Certificate not verified: only this one is
  accepted" with the fingerprint, and "Verify it again" drops the pin.
- The pin is set only on the provider's own hosts (provider.PinHosts):
  - every address of Remote magpie and of a provider added by URL;
  - for a preset (Ollama, LM Studio, OpenAI at your own box), only https
    addresses whose host is not one of the preset's or its regions' own
    hosts. A vendor's host never takes a pin.
  - Never for an account, Vertex or a subscription. Save refuses one
    elsewhere.
- The client certificate and Server CA still go only to the providers
  that took them before (TakesClientCert). A preset gets the pin alone.
- The editor's certificate rows (Client certificate and the new Server
  certificate) are drawn by a lazily imported tlscerts.js. The Client
  certificate row moved out of app.js with it, so the core scripts stay
  under TestCoreScriptBudget without a raise.

Run (Go 1.26.8):
- WSL magpie-desktop, before the rebase:
  - go test -tags nogui -count=1 ./internal/netproxy ./internal/provider
    ./internal/gui all ok;
  - GOOS=darwin -tags nogui vet of gui fails on traywindows_darwin_test.go's
    undefined trayImagePNG, the same at the base (a cgo-only helper).
- mote and mica, after the rebase on ab5824aee:
  - gofmt -l clean; node --check app.js;
  - go vet darwin (cgo), GOOS=linux -tags nogui, GOOS=windows: ok;
  - go test ./internal/netproxy ./internal/provider: ok.
- mote, at the final tree: node --check app.js and tlscerts.js; go test
  ./internal/gui -run 'Budget|ServerPin|InsecureTLS|ClientCert|OnDemand|Lazy'
  ok (TestCoreScriptBudget under 1,533,802) at the base ab5824aee.
  Rebased on fe5a0cf6d, TestCoreScriptBudget is red, as it is on that
  main alone: main's core is 1,534,708 (16ed1a952 took it to 1,535,318);
  this change takes it to 1,534,484, 224 bytes less (#5918, commented).
  The rest of the run above passes at the pushed head.
- mica, GUI files at the final tree, both engines inside each file:
  - green: provider-server-pin (54), mtls-settings (16),
    provider-insecure-tls (60), provider-socket (60), provider-http1 (60),
    i18n-keys, i18n-en-no-cjk, editor-advanced-align, provider-advanced-fold
    (50);
  - old-webkit: headerpresets.js not loaded (#6030) and Safari 15's :has()
    (#5919), both on main too;
  - menu-scroll: 24 of 24 red on /api/update/using, the same alone at
    origin/main fe5a0cf6d (#5982, commented).
  - Earlier flakes of provider-http1 beside another session's suite:
    #6159.
- Broken by hand, each red:
  - presets never take a pin: TestServerPinSaveChecks,
    TestServerPinPresetAtOwnServer, TestServerPinNoVendorHost;
  - vendor hosts pinned (the own-host check dropped):
    TestServerPinNoVendorHost;
  - client cert and CA sent to presets: TestServerPinPresetAtOwnServer;
  - the pin never compared: TestPinOnlyThatCertificate,
    TestServerPinRemoteMagpie.
  Restored: both packages ok.

Not tried:
- a real self-signed domain from the macOS app (httptest servers with
  their own certificates only);
- the Responses WebSocket dial (read only: it takes the same netproxy
  transport);
- go test ./internal/cli and the whole GUI suite before the tag (the
  full Go suite runs after it, under suite.lock).
2026-11-11 21:13:43 +08:00
yetone 466cd4809f gui: a plugin page's Copy picture works where navigator.clipboard is missing (nivekxft on X)
The day card's copy button showed "Cannot read properties of undefined
(reading 'write')" in magpie web opened over plain http (a LAN address) or in
a webview with no async Clipboard API: pageshare.js called
navigator.clipboard.write unguarded. It now tries the API when it exists,
else copies the picture as a selected <img> with the copy command, else
throws a message that says to save it instead (translated in zh, zh-TW, ja,
de). The desktop window was not affected: it already hands the PNG to
/api/plugin-pages/image. app.js's text copy already falls back (/api/copy,
writeText, execCommand), so no sibling is left on the raw API.

Run on mote: page-image-no-clipboard.test.cjs (new, chromium and webkit, en
and zh, navigator.clipboard removed), 4 of 4 red on the old pageshare.js and
green after; plugin-page.test.cjs and i18n-keys.test.cjs green.
go test ./internal/gui: only TestCoreScriptBudget red, on main already
(#5918); pageshare.js and i18n.js are not counted in it.
Not tried: a real http LAN page pasting the image into another app; the
execCommand path was observed selecting the PNG, not read back from the OS
clipboard.
2026-11-11 21:03:00 +08:00
yetone f3cdb03c8a agents: a Claude Code kept in another config folder is a row of its own (BieJian21872 on X)
Only the folder CLAUDE_CONFIG_DIR (else ~/.claude) names was found. Every
other ~/.claude… folder holding Claude Code's files (settings.json,
.credentials.json or projects/) is now claude#<name>, "Claude Code · <name>",
made by claudeIn at that folder (place.dir, as claude#launch is): connected,
model picked and checked in its own settings.json. With the variable
elsewhere, ~/.claude is claude#default. ~/.claude.json, another tool's
.claude-… folder and the launch file's folder are not rows. A folder
outside the home folder is not found (documented in agent-wiring.md).

Run at the pushed head's parent 16ed1a952 plus this change, on mote:
go test ./internal/agent (ok), ./internal/library (ok), ./internal/cli
(one red, TestEveryRouteHasACommandOrIsNamed on POST
/api/plugin-pages/arrange, not this change; #6162). gofmt clean; go vet
darwin, linux nogui and windows on internal/agent. Broken by hand:
dropping claudeDirAgents from onMachineAll turns
TestClaudeCodeInMoreThanOneFolder red.
Not tried: a real Claude Code against a second folder; GUI suite (no GUI
file changed); internal/gateway and internal/sessions were still running.
2026-11-11 21:02:21 +08:00
yetone 19782923c5 codex: the compaction magpie makes can go on a model of its own (0neB1aze on X)
Codex's memories had a model of their own, its compaction did not. Codex's row has a compaction model square (compact_model, settings.CodexCompactModel), read by the gateway on each compaction (codexCompactTo, before codexCompact). Only a compaction magpie makes is moved: it asks for a plain-text summary any model reads back. One a ChatGPT account seals, or a pick that compacts natively, is left, since only the writing account reads it (#1099); a disabled, unserved or key-barred pick is left with a log line. The text sent to the model is unchanged.

Run on mote: TestCodexCompactOnItsOwnModel (red with the move taken out) and TestCodexCompactToLeavesNative; go test for gui, settings, settingsapi, agent, provider, gateway; darwin, linux and windows vet; the GUI files in both engines. Not tried: a real Codex session compacting on the chosen model.
2026-11-11 20:57:11 +08:00
yetone a3f4aab12e routing: a Claude Code request's row says whether it ran in the TUI or as claude -p (Anotiaww on X)
startRun notes the entry on the request's context (noteEntry); serve copies it to Try.Entry and Try.EntryWhy (the claudePrint code). The Routing row shows a TUI or -p chip, with the reason in its title, in en/zh/zh-TW/ja/de. The bridge page also records the answer to Tossipe on X: a local Claude Code on a remote magpie sends its history each turn, and the remote resumes its session and types only the new turn, so the history isn't sent to Anthropic twice.

Run on mote: TestEntryNoted; routing-entry.test.cjs in both engines, five languages, 1000 and 480 wide; i18n-keys (a key repeating a Go string is reworded). Not tried: a real Claude Code run on each path.
2026-11-11 20:57:10 +08:00
yetone ab5824aeea gateway keys: a limit in total never resets by the period, only by Reset usage (Cyrus_4433 on X)
The Limit window menu gains "in total" (period "total", CLI: gateway-key limit <id> total). It counts from when it is set or last reset and ends a century off (access.Limit.Window), so only Reset usage starts it again; its 429 says it stays refused until reset or raised, the row reads "$0.00 / $300 · 总额" with no reset time, and a remote key's window is "Tokens/Spend in total" with no reset. Old settings files read the same (new period only). i18n in zh, zh-TW, ja, de; reference.md and gateway-routing.md say it.

Run: TestLimitTotal and TestTotalLimitNeverResetsByThePeriod, red on the old code (Valid refuses "total"); gateway-key-total.test.cjs red without the keys.js change (5 of 5). Not tried: a real key through a live gateway; full suite follows after the tag.

Run (before this push):
- gofmt -l clean; go vet darwin, linux (nogui), windows clean.
- go test: internal/access, internal/budget, internal/cli, internal/provider ok.
- Go tests for the total period are red on the old code (Valid refuses "total"); the GUI test is 0 of 5 languages passing without the keys.js change.
- gateway-key-total.test.cjs and i18n-keys: 9 pass in chromium and in webkit (zh, zh-TW, ja, de, en; 500px width; no native select).
- Full GUI suite on mica, chromium: 46 reds in files this change does not touch (accounts, Pi/OpenCode Go, panel sheet, check-in, Aside provider, API key theme, allowed addresses); none is a key-limit test. Webkit pass still running; reds are to be compared with origin/main and filed after.
- TestCoreScriptBudget is red on origin/main 2d12e8274 by 7 bytes (1,533,809 > 1,533,802); this change touches no counted core script (#5918).
Not tried: a real key through a live gateway; the full Go suite (started after the tag).
2026-11-11 20:35:13 +08:00
yetone 52041e6bc5 gateway: a Team workspace's third-party refusal ("draw from extra usage", no "your") is redone as claude -p too (#5645, pidal20 on X)
Anthropic words the refusal "Third-party apps now draw from extra usage,
not plan limits. Ask your workspace admin to add more" on Team and
Enterprise. thirdPartyWords only matched the Pro/Max "your extra usage",
so an interactive turn was neither redone as -p nor recorded in
refusedTUI, and the raw 400 reached the caller every turn.

thirdPartyIn matches both wordings; its three uses (refusedTUI,
thirdPartySaid, which feeds redoable and thirdPartyRefused's message
selection) all go through it. Docs updated.

Run on mote: TestClaudeTUIThirdPartyTeamWording (reporter's literal text:
a TUI turn redone as print, and both thirdPartyRefused messages) red on
the old code (400 reached the caller), green now; go test -tags nogui
./internal/gateway ok; gofmt clean; go vet darwin, linux nogui, windows.
Not tried: a real Team account.
2026-11-11 20:23:13 +08:00
yetone 7bcb161938 gateway: the MCP router gives Alma's Node fetch magpie-image: Sec-Fetch-Mode alone is not a web page (chang_lochuan on X)
Alma's MCP client is Node's fetch (undici in alma-server/lib/server.mjs). It
sends Sec-Fetch-Mode: cors on every request, with no Origin, no
Sec-Fetch-Site and no browser agent. hubVisitor used fromBrowser, which counts
Sec-Fetch-Mode, so Alma was an Away visitor and the HereOnly servers
(magpie-image) were neither listed nor run for it, while magpie-vision showed.

hubFromPage judges the hub's visitor by what a page's POST always carries and
its script can't remove: Origin (null under no-referrer too), Sec-Fetch-Site,
a Mozilla/ agent. The hub takes POST only, so the GET-without-Origin rebinding
case fromBrowser covers does not reach it; a rebound name is still refused
first by lanGuard's rebound (an Origin or Mozilla agent) and serveMCP refuses
any Origin that isn't listed in Settings. fromBrowser itself is unchanged for
heap, memory, join, restart and the rest. No per-agent token exists for a local
agent (the hub entry carries a key only from another machine), so the decision
rests on the marks, not on a credential.

Run (mote): TestHub* in internal/gateway; new
TestHubGivesAlmaItsHereOnlyServersNotAPage (Alma's headers are given
magpie-image; Origin null, evil, localhost, evil.localhost, tauri.localhost,
app://obsidian.md, chrome-extension://, Sec-Fetch-Site only, Mozilla/ agent
only, and three rebound-Host shapes get none and run nothing, no key). Red on
the old code ("Alma's fetch is given 200 [magpie-vision]"). Broke by hand:
hubFromPage = fromBrowser(r) goes red; dropping the Origin mark stays green
because serveMCP refuses an unlisted Origin on its own (two layers).
gofmt, vet darwin/linux(nogui)/windows, then go test -tags nogui -count=1
./internal/gateway (ok, 1283s) and ./internal/library (ok, 300s) at the
commit before the rebase onto origin/main.
Not tried: the real Alma app against a real hub (its config is the user's live one).
2026-11-11 19:55:21 +08:00
yetone 6b45130829 sync: a plugin removed on one computer is removed on the others (dolacmeo on X)
Plugins rode the providers part and AddPlugins only adds, so a plugin one
computer removed came back from another that still held it and was sent up
again. davsync now keeps the plugins both sides had after the last sync
(state.Plugins, as sign-ins keep theirs); a name one side has since lost is
taken out of the server's list when it was removed here, and removed here
(provider.RemovePlugin) when it was removed there. A plugin added meanwhile
stays. A removal that fails (agent on magpie) is retried next sync. backup
now writes an empty plugin list as [] so "none" is told from "older magpie".

Run (mote): go test internal/davsync + internal/backup ok; vet darwin,
linux nogui, windows clean; gofmt clean.
Broken by hand: pluginPlan returning nothing turns
TestSyncPluginRemovalSpreads red (b keeps x after a removed it).
Not tried: real WebDAV server, two real machines, full suite before tag.
Siblings: MCP servers, skills, providers and search APIs are mirrored
(library.Put, provider.Mirror), so their removals already spread when one
side changed.
2026-11-11 19:34:40 +08:00
yetone a99abe694b claude: a summary request without its pending call branches off the waiting run's session (#6128, recih on X)
Claude Code's AgentSummary sends the sub-agent's conversation whole, minus
the assistant messages whose calls have no result yet, keeping the words
before them. branch() needs a call in the last reply to find a session
line, returned nil, and a new Claude Code was told the whole transcript:
90K-160K cache tokens written for a progress label.

branch() now also takes a last reply with no call: the run is the owner's
run with a call line whose conversation (told) is the one before that
reply, the session is cut before its first call line (cutSessionBefore,
savedSession.cutBefore), and the run is told only the request's tail.
When no branch is found the log now says why, by structure only (no
prompt text): "no branch of a run's session for this request: <reason>".

The reporter's second cause, "answered by another request", already
branches off through the calls path; the new reason line will show which
condition fails there if it still does.

Run: go test -run 'TestClaudeBranchForSummary|Fork|Branch|Retry' ./internal/gateway
ok on mote; the new test is red with the pending path off
("no run of the account made the calls"); gofmt clean; go vet darwin,
windows, linux nogui; full ./internal/gateway started after the tag.
Not tried: a real Claude Code AgentSummary against a live subscription.
2026-11-11 19:32:14 +08:00
yetone b4fc29a6e4 gateway: a video reaches a model that takes one, on every API, and a group takes its members' kinds (#6135)
LingYingNX sent MiniMax's Messages video block through the MiniMax plugin
(a plugin is always sent a translated request). readAnthropic had no case
for "video", so the block was left out: the reply was 200, the request
billed, and the model never saw the video. Chat's video_url and a Chat
file of a video were left out the same way (#4101).

A video is now a File part with a video/* media type (video_input.go):
- read from Messages' video block, Chat's video_url, a Chat file of a
  video (nested, or the AI SDK's flat {type, data, mediaType}) and a
  Responses input_file of one;
- built as a video block on Messages, video_url on Chat, inlineData on
  Gemini's API (as before for Gemini);
- Responses has no shape for one: a latest-turn video translated there
  is a 400 that says so (unportableVideo in translate).
A latest-turn video for a model whose list says it takes no video is a
400 before any upstream is asked; one of an earlier turn is told of in
words (Request.videoOff, set in buildFor). A routing group takes the
union of its members' Inputs/Outputs (buildGroupEntries, #2898), so
/v1/models lists video for group/... when a member takes it, and a video
goes only to members that take one, else to unknown ones, else a 400
naming the group.

Not changed: PDFs (Messages document, Responses input_file of a PDF, a
Chat file of a PDF) stay as #5452 says; input_audio stays with #4101.

Ran (mote, at this tree): gofmt -l (nothing), go vet ./...,
GOOS=windows go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=linux go build -tags nogui, GOOS=windows go build,
go test -tags nogui -timeout 45m ./internal/gateway ./internal/provider:
ok gateway (1072s), ok provider (132s).
Rebased on origin/main c4a9856df (3d8510f32 changed Gemini's inlineData,
which passes a video as it is): go vet ./internal/gateway and the video,
group and Gemini media tests again, ok.
New tests: TestPluginGetsTheVideoBlock (the reporter's body shape to a
plugin), TestVideoReachesEveryAPI (Chat video_url / file / AI SDK file /
Responses input_file to Messages, Messages to Chat, Chat to Gemini,
Messages to Responses = 400, Messages relayed), TestVideoForAModelThatTakesNone,
TestGroupVideoGoesToMembersThatTakeIt, TestGroupInputsAreItsMembers.

Broken by hand, each red: the Messages video parse case (4 tests), the
Messages video build, Chat's video build, Chat's video_url parse,
Responses' input_file parse, unportableVideo, the single-model gate, the
group filter, buildFor's videoOff, and unionKinds (provider and gateway
group tests).

Not tried: a real MiniMax account or any real vendor with a video; the
plugin side is plugins#985 (opencode-minimax-auth 0.2.6). The full
suite runs after the push.

Reported-by: LingYingNX
2026-11-11 19:12:34 +08:00
yetone 55dff77b4d gui: plugin pages load behind a proxy that signs in by cookie (xuanwo on X)
A plugin page's frame is sandboxed (opaque origin), so its stylesheet and
scripts are cross-site requests that carry no SameSite=Lax cookie. Behind
Cloudflare Access they were redirected to the sign-in page and the page
said it "didn't answer" (Day card). index.html's manifest link also
fetched without credentials.

In magpie web the page's HTML now comes as one document (pageinline.go):
classic scripts (bridge included) and url()-free stylesheets are written
in, scripts allowed by sha256 in the policy, deferred ones moved to the end
of body. A script the page adds later is fetched by the window (asset call,
folder-checked, window carries the cookie) and loaded from a data: address
(WebKit finds no blob made in a sandboxed frame). The manifest link has
crossorigin="use-credentials". Modules, url() stylesheets, images and
fonts loaded by the page itself still ask the proxy.

Run on mote at this tree: go test -run PluginPage ./internal/gui; node
--test plugin-page, plugin-page-idle, plugin-page-cookie-proxy in
chromium and webkit; gofmt; vet. Broken by hand: inlining off turns
TestPluginPageWebComesAsOneDocument red, the bridge shim off turns the
cookie-proxy test red in both engines.
Not tried: a real Cloudflare Access tunnel; images/fonts behind a proxy.
2026-11-11 19:11:55 +08:00
yetone e3e774be7a agents: Claude Code's Co-Authored-By commit signature on or off from its settings (9_bishi on X)
Claude Code's row in Agents > Settings gets a "Commit signature" On/Off menu. Off writes
Claude Code's own key attribution.commit = "" in settings.json; On takes out only what
hid it (attribution.commit "" , attribution false, includeCoAuthoredBy false), so the
default comes back. A custom attribution text is the user's own: the row shows "Your own
text", is disabled, and is never written over. attribution.pr is untouched.
Route POST /api/settings/claude-attribution, S2 in the settings parity test.

Run at the rebased head (on 967fefcec), on mote with a private GOCACHE:
- go test ./internal/agent -run Claude, ./internal/cli -run Parity|Settings,
  ./internal/gui -run Budget|Script: ok
- GUI claude-attribution.test.cjs + i18n-keys.test.cjs in chromium and webkit: 6/6 each
  (en and zh, fake API)
- gofmt -l clean; go vet darwin, linux (-tags nogui), windows: ok
- agent-prefs.test.cjs chromium: 5 of 28 red, identical at base 745d209dc and here
  (#6139); not from this change.
Broken by hand: Off writing "x" instead of "" turns TestClaudeAttributionSet red.
Not tried: a real Claude Code making a real commit, the Windows box, the full suite
before the tag (started after it), webkit for agent-prefs.
2026-11-11 18:14:10 +08:00
yetone 967fefcec6 gateway: a key can be set to a service tier (JackyFill on X)
A gateway key now carries ServiceTier: follow the request (unset),
standard, Fast (priority) or Ultrafast. keyTiered sets the Responses and
Chat request's service_tier to it, over the client's ask and Codex's own
setting; standard takes the tier off and Ultrafast on a bare model no
account lists it on goes as priority. What is sent upstream stays the
providers' own rule (fits, takesTier, fallback), so a vendor with no
service tier is sent none; Anthropic-protocol requests are untouched.
Set with the tier-key action, `magpie gateway-key tier <id> ...`, or the
key row's badge (zh, zh-TW, ja, de strings).

Run (wsl-run, Linux): TestGatewayKeyServiceTier, TestKeyTieredChat,
TestKeyServiceTier, TestGatewayKeyTierCLI green; internal/gui -run
Key|Tier|Caller|Access ok; gateway-key-tier and gateway-key-concurrency
GUI files 40 of 40 in chromium and webkit (serial); go vet nogui for
linux, windows and darwin; gofmt clean. Broken by hand: with the
keyTiered call removed TestGatewayKeyServiceTier fails on 4 rows.
A parallel run of all gateway-key and i18n GUI files had 8 unrelated
timeouts that pass serially (load). The whole internal/cli package hit
the default 10m timeout on this box; the key tests in it pass.
Not tried: a real ChatGPT account, the Windows box, the full suite.
2026-11-11 17:59:36 +08:00
yetone 4cc20f93c0 routing: a group says whether its requests are masked (1dwsdqwd2 on X)
Group.Redact: unset follows each member's provider (Send requests
unmasked), "on" masks as Settings say whichever provider, "off" sends
to every member as written. In a group in a group any "on" wins over
"off"; Settings with masking off still masks nothing. Every route that
reaches a group asks the same way: unredactedRoute (a provider's
fallback groups and provider.GroupsAfter), unmaskedMembers, maskedFor
and MaskRoute, and candidate.unmasked() for embeddings, images, video,
decide and count_tokens. A shared group never carries it (export and
import clear it; an import over a group keeps the old one). A save that
doesn't name it keeps it; "follow" clears it. The Routing group editor
gets a Masking row (menu, no select) in zh, zh-TW, ja, de, reusing core
strings; the Privacy page's unmasked warning counts groups set to off.

Run at the pushed head's parent (rebased on origin/main): gofmt -l, go
vet provider/gateway/gui, go test provider gateway gui cli (gateway ok
1091s, gui ok, cli ok); provider red only in
TestCancelledPluginSignInSavesNothing, open as #5047, green alone x10,
not touched here. group_redact_test.go broken by hand (UnmaskedBy's
on/off cases deleted): 5 tests red. group-redact.test.cjs: 5 languages
x 2 widths x chromium and webkit, 30 of 30; i18n-keys green.
Not tried: a real vendor request through a masked group.
2026-11-11 17:54:42 +08:00
yetone c36202ae5d routing: removing every found group turns found groups off, so no new one comes back (xwang_sh on X)
Found groups live only as removal records ({"id","hidden":true}) in
providers.json; removing them one set at a time left every model a
provider listed later to make a new group, and taking the records out by
hand brings the groups back. A user who removes every found group (the
Routing page's select-all Remove, `magpie group rm` of all) has set "none":
DeleteGroups now ends with SetAutoGroups(false) when no found group is left
shown. The removed records stay, found groups on again restores them as they
were. The GUI delete runs through agent.Reseat so an agent set to one is
moved to its model, as the found switch does.

Run on mote: go test ./internal/provider ./internal/gui ./internal/cli
./internal/tui all ok; go vet darwin, windows (provider, gui), linux
(provider) clean; gofmt clean. TestDeletingEveryFoundGroupKeepsThemOff is
red with the new branch disabled by hand ("on true, shown [auto-z]").

Not tried: a real GUI click-through; a hand edit of providers.json (the
records going back is by design, documented); WebDAV sync of a removal.
Full suite not run before the tag.
2026-11-11 17:53:05 +08:00
yetone b0b995e085 sessions: a ZCode session is named as the ZCode app names it, from its task index (Flandern1211 on X)
ZCode's desktop app keeps the names it shows (and the user's renames) in
~/.zcode/v2/tasks-index.sqlite, tasks.title by task_id = the CLI database's
session id. The CLI's own title is the model's guess or "default" (blank
here), so the Context page showed a first prompt where ZCode shows a name.
zcDB.info now takes the task's title when it has a non-default one; the
task's updated_at counts toward the file's time so a rename, which touches
no CLI row, is read again. The index is read once per change of the file or
its -wal, and a failed read keeps the last good one.

Run (mote): internal/sessions whole package ok under a sandbox HOME;
gofmt clean; go vet darwin, linux nogui, windows ok.
Broken by hand: the title overlay off -> new test red (title empty);
updated_at bump off -> the rename step red (stale title).
Not tried: a real ZCode with the CLI db (this machine has only the app's
index, no cli/db), Windows with a moved data folder (ZCodeDataIn is the
existing resolver).
2026-11-11 17:52:02 +08:00
yetone 1d60b165c3 gui: the connected Hermes row draws no control for its other profiles; each is its own row hermes#<name> (Norethcy on X)
The Hermes row's "Other profiles" section picked the model of the same
profiles that now have rows of their own (Hermes · <name>), two controls for
one value. The section is gone; the profile:<name> fields stay in the API
(the row hides them via hermesBot). The profile row's Default picker is noted
as putting back what the profile had before magpie, as the section's was.
The unused "Other profiles" i18n key is removed in every language.

Run (mote): hermes-profiles, hermes-profile-row, i18n-keys GUI tests in
chromium and webkit, 19 of 19 green; hermes-profiles rewritten to assert the
section, the profile: squares and "hermes -p" are absent, in 5 languages at
two widths.
Broken by hand: with the old app.js, hermes-profiles is red (10 of 10).
Not tried: a real Hermes with real profiles, the full GUI suite and Go
suite (GUI-only change, no Go touched), Windows/WebKitGTK.
2026-11-11 17:46:15 +08:00
yetone 745d209dcf usage:day takes a from: a week, a month or all time in one read (HeheLi29136651 on X)
HeheLi29136651 asked for the Day card's weekly, monthly and total bill. The
read only answered one day, so the plugin had nothing to draw. usage:day
now takes {from: "YYYY-MM-DD" | "all"} beside date: the days from there to
date, with the same totals, agents, models and days list (usageapi.SpanOf;
DayOf is SpanOf with no from). "all" starts at the first day with calls:
the ledger keeps old calls in wider buckets that start before the first
call, so From is taken from the first day the heatmap lists. A from after
date, or a date after today, is an error. Answers carry `from`, which is how
a plugin tells a magpie that has spans from one that ignores the param.

Run, on mote:
- TestSpanOf (week, month, all, all up to an earlier date, day alone,
  bad inputs) with calls 300 days back, where the bucket starts before the
  first call: red when the From correction is removed (From 2026-01-12 for
  a first call on 01-15), green with it.
- TestPluginPageReadsADay gains from "2000-01-01", from "all" and a from
  after the day.
- go vet (darwin, windows, linux -tags nogui), usageapi and internal/plugin
  tests ok.
- The plugin side (page-day-card 0.3.0) reads it: seen in the sandbox web
  instance in chromium and webkit, empty ledger only.

Not tried: a ledger with real calls end to end in the page (the plugin's
test covers the card from a made-up read), and a magpie from before this
change opening the 0.3.0 page (the code path throws "usage:day from" when
there is no `from`, and says to update).
2026-11-11 17:38:42 +08:00
yetone a94468ea5e gui: a plugin page behind a proxy that keeps no Host still loads its scripts (xuanwo on X)
xuanwo's Day card was blank in magpie web behind a reverse proxy. The
frame's CSP named the page's folder under r.Host (https:// and http://),
and a proxy that keeps no Host (nginx's default proxy_pass) hands magpie
its upstream's own address, so the policy named nothing the browser used
and every script was blocked.

A browser's page now names its own origin in the frame's address
(_o=, framed() in pluginpages.js; the frame sends no Referer, its
referrerpolicy is no-referrer, so a Referer can't carry it), and
ownSources adds it (browserOrigin: http(s) only, no user info, a plain
host). The desktop window's scheme is unchanged.

Run, on mote:
- TestPluginPagePolicyBehindProxyHost: red on the old code (policy names
  only the upstream host), green now; also checks that a junk _o
  (javascript:, user info, a path) adds nothing.
- Real repro: a sandbox `magpie web` behind a Node proxy that rewrites Host
  to the upstream's, opened at http://localhost:3495/?view=plugin-day-card
  in Playwright chromium and webkit. Before: a broken frame (webkit
  screenshot 52KB, no card). After: the card draws in both, the frame's
  address carries ?_o=http%3A%2F%2Flocalhost%3A3495.
- go vet (darwin), GOOS=windows and GOOS=linux -tags nogui for internal/gui,
  usageapi; go test internal/plugin, internal/usageapi and internal/gui
  -run 'PluginPage|Page|Day'; plugin-page*.test.cjs in both engines: 8 of
  10 pass. The 2 reds are plugin-page-foreign-error ("own: the frame
  opened"), red on origin/main too before this change (#6117).

Not tried: nginx itself (a Node proxy that rewrites Host stands in), Cloudflare
Tunnel, and the desktop window on Windows. The whole GUI suite is started
after the tag.
2026-11-11 17:38:42 +08:00
yetone 22f2759d71 gui: Settings › General › Sidebar pages leaves pages out of the sidebar for this browser (youimark on X)
Gateway mode hides Agents only for magpie web without agents, and the Library
only goes with its built-in plugin. A docker gateway asked to close both. The
new row is a multi-tick menu of the sidebar's pages (Providers stays), kept in
localStorage magpie.navHidden; navHides and offView read it beside gateway mode
and the built-in plugins, and start.js opens Providers when Agents is out.

Main's TestCoreScriptBudget was already 351 bytes over at origin/main
(1,534,153 > 1,533,802); this commit cuts comments in app.js to land at
1,533,596, under it, with no raise.

Run, on wsl-run (xiaomi-gpu), chromium + webkit: nav-pages-hidden 2 pass;
broken by hand (navHides without the new term) 2 red. settings-general went
red on the first draft (the row was 56 tall, the others 51, the button in a
wrapper) and passes now. i18n-keys, i18n-en-no-cjk, last-page, gateway-mode,
sidebar, phone-tabs 0 fail. go test -tags nogui -run TestCoreScriptBudget ok.
Red the same on an origin/main copy (7 and 14 fails, not from this change):
builtins webkit, side-toggle (both engines) and settings-search ("searching
posts nothing": /api/update/using); filed with this push.
Not tried: a real docker deployment, the full GUI suite, the Mac and Linux
apps, sidebar-glide (3 fails under load, base not compared).
2026-11-11 17:29:38 +08:00
yetone 8718e0427d settings: app updates get their own proxy choice (moonlityu on X)
Settings > Network has a new "App updates" row under the plugin proxy row:
Same as above (default, today's behaviour), Direct, Custom or a saved proxy.
It is Settings.UpdateProxy / UpdateProxyCustom, kept per computer
(KeepOwn), left out of auto-backups with the other proxies, and listed in
the saved proxies' "in use" check, so a saved proxy used by updates can't be
deleted. update.proxied() wraps its transport: a request that names no
proxy of its own (magpie update --proxy does) takes the setting; unset, it
follows the global proxy as before. A value a user already set is never
changed.

Per-model proxy inside one provider is not added: a proxy belongs to a
provider, an account or a key, so a provider can't split by model without a
second provider on the same URL (noted in providers-accounts.md).

app.js stays within TestCoreScriptBudget by cutting five long comments, no
raise.

Run (Linux via wsl-run, rebased on origin/main 961427f12): go test of
internal/update, settings, settingsapi, backup and internal/gui (-tags
nogui) incl. TestCoreScriptBudget and the settings-keep guards; new
settings-update-proxy.test.cjs in chromium and webkit, 5 languages, 1100
and 420px; gofmt; go vet for darwin, windows and linux (nogui) on the
touched packages.
Broken by hand: removing the updateProxy wrapper turns
TestUpdateTakesItsOwnProxy red.
GUI reds named: settings-proxy-auth "optional proxy credentials" webkit
(expected 'name', actual ''; red on origin/main too, #5562, seen again);
saved-proxies "webkit de 420px" stopped passing with the third row because
the add form's Save button sat 1px below a 760px window and WebKit's
scrollTop stuck at 214 (#6130); that test's window is now 900px high.
Not tried: a real update behind a real proxy, the Windows/macOS apps,
WebKitGTK.
2026-11-11 17:23:14 +08:00
yetone 961427f122 codex: the ChatGPT app left on "hit a snag" after a switch off a used-up account is reopened without the Restart tick (RealZeroP27 on X)
RealZeroP27 (switch only, requests not through magpie, ChatGPT app on
macOS 27.2.1): when the account ran out and magpie signed Codex in to the
next one, the app showed "ChatGPT 遇到了问题 请重试" and only a manual
restart cleared it.

Cause: magpie did end the app-server (a switch off a used-up account
always does), and the signed-in ChatGPT app fails on the one it starts
next, a fault in the app (codex_app_crash.go, #4550). magpie reopens the
app on that page only with "Restart the Codex app" ticked, which ships
off (15acba534, Michael25651150), so the page stayed.

Now an end made for a used-up account (a switch off one, or the takeover
in; crashSpent) has the app quit and opened once on that page whatever the
tick says: the app was greyed on that account already and the page is all
its window shows. Every other end (route change, switch among accounts
with room) still waits for the tick. The page check (no composer, no turn
or request since) is unchanged. The Windows reopen when no app-server came
back (codexAppGotNone) is unchanged and stays tick-gated.

This partly reverses 15acba534's gate for the used-up case; a product
call. A quit of a working app is still never done unasked.

Run on mote at this head:
- go test -count=1 ./internal/provider ./internal/agent: ok.
- go vet ./internal/provider on darwin, GOOS=windows, GOOS=linux nogui;
  gofmt -l clean.
- TestCodexAppReopenedAfterASpentEndUnasked (switch, takeover) is new;
  TestCodexAppNotQuitUnasked now ends for a route change.
Broken by hand: spentEnd forced false -> the new test red in both subtests.

Not tried: the real ChatGPT app, the Windows box. No GUI file touched.
2026-11-11 17:12:44 +08:00
yetone 65924a8927 gateway: Codex's commit message and PR text come back in the shape its schema asks for (makenxis on X)
The Codex app's "generate commit message" is an ephemeral side turn
(thread_source commit_message; pull_request_message and
commit_pull_request_message likewise) whose answer must be {"message"}
or {"title","body"}. A model behind the Chat or Anthropic API never sees
that schema and answers in plain text, which the app turned down, so the
button failed for Codex on a magpie model. Titles, descriptions,
summaries and predictions were wrapped for this reason; these three kinds
were not. codexCommit now routes them through codexShaped: commitJSON
keeps the model's own JSON when it gave every required string, else makes
the object from its text (subject cut to the schema's 72 characters,
title from the first line, body from the rest).

Run (wsl-run, Linux): TestCodexCommitMessageOnMagpieProvider,
TestCommitJSON, TestCodexSide*, TestCodexSummary* green; go vet for
linux, windows and darwin; gofmt clean.
Broken by hand: with codexCommitsTo returning "" the new test is red
(the plain text "Fix login redirect loop" goes out unwrapped).
Not tried: the real Codex app against magpie (the request shape was read
from the app.asar on the Windows box, not captured); the full suite.
2026-11-11 17:08:15 +08:00
yetone 8af7c27fff library: mcp add takes header=, env= and timeout= as settings, mcp set and mcp show (Abandon332 on X, #6111)
`magpie library mcp add` handed env=A=B and timeout=30 to the program as
arguments (exit 0, written into the agent), and refused header= on a URL,
so a token-bearing remote MCP needed a hand edit of library.json.

SplitServerWords takes header=K=V (or K: V), env=K=V, timeout=SECS,
agents= and --local out of the line; words after -- are the program's.
A setting-looking word magpie doesn't know (headers=, envs=) is refused;
header= on a command or env= on a URL is an error. New: mcp set <name>
header=|header-=|env=|env-=|timeout= keeps the rest of the server, and
mcp show <name> prints it as JSON. Header names match without case and
keep the stored spelling.

Run (wsl-run, -tags nogui): TestSplitServerWords, TestSetServerKeepsTheRest,
TestLibraryMCPHeadersEnvTimeout, all of internal/cli and internal/library
ok; GOOS=windows and darwin go vet of both packages; gofmt clean. The new
CLI test fails on the old code by construction (env/timeout in Args). Not
broken by hand separately. Not tried: win-run, the GUI (its save already
sends headers; a stale open editor over a hand edit isn't addressed), the
TUI line (still ServerOf), the other agents' encoders for timeout.
Not run: full suite.
2026-11-11 17:01:36 +08:00