Commit Graph
7804 Commits
Author SHA1 Message Date
yetone 65cb76ca2e gateway: Copilot's Gemini gets tool schemas of six shapes it took as 400 (ProgCZ, tmhyt1 on X)
Copilot answered 400 to an MCP tool schema with an array-level enum, a root
oneOf or anyOf, prefixItems, an anyOf beside its own type, or an object
without properties at the root. copilotGeminiToolShapes (after
copilotGeminiToolUnions) writes each as the nearest schema it takes:
properties {} added; same-type anyOf merged (null kept as anyOf with null);
an anyOf with an untyped branch dropped, so geminiTypes types the node;
array enum moved to string items or dropped; root union an object with the
branches' properties, none required; prefixItems / items-as-list one items
schema. Nested oneOf and fit schemas go byte for byte. Antigravity's
plainSchema had the same array-level enum and now moves it to items. A
same-type object anyOf that wasn't provably disjoint is now merged instead
of refused (TestCopilotGeminiKeepsUnprovenUnions uses mixed types now).

Real Copilot account, sandbox magpie (own HOME, only the copilot login),
gemini-3.8-flash and gemini-4-argon, build without the pass -> with it:
array enum 400->200, root oneOf 400->200, prefixItems 400->200, root anyOf
(strings, objects, untyped) 400->200, anyOf beside type 400->200, root
{"type":"object"} 400->200, fit control 200->200. Nested object-without-
properties and nested typeless same-type anyOf were already 200 on the old
build, so the reports' failing forms are the root and type-beside ones.

Run: new TestCopilotGeminiTakesToolShapes (8 rows, red on the old code with
the call unwired), TestCopilotGeminiToolShapesLeavesFitSchemas,
TestAntigravitySchemaArrayEnumMovesToItems, -run Copilot|Antigravity|Schema
on internal/gateway ok (mote); vet darwin, windows, linux nogui ok.
Not tried: the full gateway and provider package run (mote busy, still
going when tagged); Google AI, Vertex and Antigravity with real accounts;
the GUI suite (no GUI file touched).
2026-11-12 18:43:08 +08:00
yetone 67f61bd789 gateway: a Claude account's plain rate limit on one model rests that model, not the account (kaitokiku on X)
v0.1.3817 and the fixes after it scoped Fable's quota refusals ("hit your
limit", "reached your Fable limit") to Fable. A plain 429 rate_limit_error
is failRate, and restAfterMarked rested the whole account for it, with its
backoff ladder and sink: Fable rate limited showed "限流 · 42 分钟后恢复" on
the account's Opus row too.

claudeModelRate: a Claude account's failRate that names no window that
counts every model (5-hour, session, weekly, usage limit, organization,
overage, or a representative-claim header of five_hour/seven_day) rests
that model only, in restAfterMarked, rateRest and the sink. Anthropic counts
rate limits per model. Quota refusals and account windows rest the account
as before. Messages, Chat Completions, Responses, groups and the Routing
rows share restAfter.

No real Fable 429 was available: ~/.config/magpie/usage.jsonl, rests.json
and app.log hold none, and Claude Code's bridge keeps no response headers,
so the rule is not checked against real anthropic-ratelimit-unified-*
headers. The account-wide limit the logs do hold ("You've hit your weekly
limit · resets 2pm") is in the test and still rests the account.

Cost if the guess is wrong (Anthropic applies a plain 429 to the whole
account): the next Opus request to that account gets its own 429, rests
Opus there, and falls over to the next account in the same client request,
as any rested candidate does; the user sees no error. One extra refused
request per model per rest. The test checks Opus's own rest and that
Fable's stays and a second account is not resting.

Run at this tree (mote): TestClaudeModelRateRestsThatModelOnly red with
claudeModelRate returning false (account rests, Model empty), green with
it; TestFallback* ok; gofmt. Package internal/gateway and internal/provider
run, and vet on darwin, linux and windows, were still running at commit;
results follow. Not tried: a real Fable-limited account.
2026-11-12 18:34:34 +08:00
yetone 5241308212 settings: a day can start at 0 to 6 o'clock (ssharpcc on X)
Settings > Usage > "Day starts at" (dayStart, 0 to 6, default 0; also
magpie settings set dayStart 4). With 4, a call at 01:30 counts toward the
day before: the Usage page (summary, charts, heatmap, ledger day filter,
hour labels of Today) and the daily and monthly key caps (access.Window,
provider.SpendCap.Window).

internal/dayzone makes a time.Location whose midnight is the real day's
hour:00 (TZif built from the zone's own offsets, same DST instants), so
every place that cuts days by a Zone's midnight follows without edits;
usage.Zone returns it and the "now" reads use it too.

Run (mote): go test usage, settings, settingsapi, access, provider, gui,
dayzone, also with TZ=UTC and TZ=Pacific/Kiritimati; gofmt; go vet darwin,
linux nogui and windows; day-start, currency, number-units and i18n-keys
GUI files in chromium and webkit, en zh zh-TW ja de; TestCoreScriptBudget.
Broken by hand: TestDayStartsAfterMidnight red with 9 failures when the
hour is ignored. New tests: dayzone over 5 zones x hours 1/4/6 x two years
of days, usage, limit window, spend-cap window, day-start GUI.
Not tried: a real log history in a real window.
Not shifted, filed as #6314: the Sessions page, TUI sessions filter,
davsync shared per-day files, gateway_sessions day keys, credits_daily.
Rows are never stored in the shifted zone.
2026-11-12 18:31:50 +08:00
yetone c5b9e448a8 gui: Codex's settings lines say less and say what a choice does (siantgirl on X)
siantgirl found the Codex settings block hard to follow when connecting
Codex to DeepSeek. Three lines were the cause: Codex subagent model (a
paragraph on resumed subagents and the pick rules), Codex subagents on
any model (named multi_agent_v2) and Long conversations (a list of which
models are and are not capped). Each now says what it does in one
sentence: the lead's pick or its own model, pick one here for every
subagent; a GPT lead can start subagents on other models, new threads
only; compact at 272K or the size typed, magpie's models only. Strings
changed in app.js, index.html and en, zh, zh-TW, ja, de, with the same
placeholders. No layout change.

Run (mica): codex-subagent-model 20 pass 0 fail (its pinned lines are red
on the old text), i18n-keys 4/0, gateway-mode 6/0 and the compact,
settings-general, agent-details-ready, context-tune and lang files ran;
agent-prefs 46 pass 10 fail, the same 10 on origin/main 2e92d71aa
(#6139, commented). The Go size-budget test is ok.
Not tried: the whole GUI suite, the real Linux app, a screenshot of the
new lines.
2026-11-12 18:15:24 +08:00
yetone 32412db655 site: a Grok App docs page in en, zh and ja
/docs/grok-app says how magpie sets up Grok App (RongleCat/grok-app):
the [model.magpie] channel in agent-home/config.toml under the App's
data folder, written as the App writes one, with magpie's own key, chat
completions and app_models carrying each model's context window, images
and efforts; why magpie never sets [models] default (the App would drop
its own sign-in) and Use in the App's Settings › Account is what
switches; the one-time put-back of a route an older magpie set; the
effort the picker starts on; where the data folder is found on each
system; disconnecting, which touches the route only while it names
magpie. Each claim is from internal/agent/grokapp.go. Linked from each
language's fx page; in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: Grok App itself with magpie for this page; it names only
what magpie's source says.
2026-11-12 18:14:00 +08:00
yetone d964031412 provider: a model's test can be sent to one chosen account or key (tmr11235 on X)
A provider with two or more accounts or keys that are on now offers
"Test on account..." in a model chip's right-click, an app menu (never a
native select) of those accounts' or keys' names. The pick is posted as
`account` with provider/test and pins the test (provider.TestOn,
accountNamed / keyNamed; an unknown or switched-off one is an error row,
not a silent fallback). Every result now names the account or key it went
to (Result.Account, set in probe), and the status line ends " - <name>"
for such a provider, whether the test was pinned or routing picked.
Test models and the CLI still test with routing's pick.

Core script budget raised 1,263,333 -> 1,263,700 (+367): the model chip
menu is core code and there is no page to move it to; the PLAY icon
literal was folded into one constant and the status call tightened first.

Run: gofmt clean; mote-run go test ./internal/gui ./internal/provider ok
(new TestModelTestPinnedToAKey, TestTestPicksNeedSeveral,
TestModelTestPinnedToAnAccount); model-test-account.test.cjs 10 of 10
(chromium and webkit, en zh zh-TW ja de) on mica. Broken by hand: with
the menu entry disabled the GUI test is 0 of 10. GUI batch model-*,
provider-*, i18n-*, gui-*: reds are the same on origin/main 2e92d71aa
(model-chip-steady, model-copy-id, provider-fetch-again, provider-max-
output, provider-many-keys, provider-mask, provider-typed, gui-de/ja),
all already filed (#4388, #4621, #3292, #6209, #5109, #4673, #5475).

Not tried: a real multi-account provider end to end; the CLI and the bulk
Test models button (unchanged); vet on windows/linux not rerun beyond the
earlier builds.
2026-11-12 18:09:14 +08:00
yetoneandggbdpq 2e92d71aab gateway: Anthropic's message_stop and a Responses upstream's completed end a translated read too (#5936, ggbdpq and polaris-yhl on X)
The [DONE] fix in the previous commit (ggbdpq's patch, applied with git am,
reviewed: three hunks in continuation.go plus tests, nothing else, nothing
that reaches out) ended a Chat upstream's read at its own end. The other two
translated upstreams had the same hole: a relay that holds the connection
after message_stop, or after response.completed/incomplete/failed, kept the
translated reply's end waiting for the hangup. saidOver now names each
protocol's last word and the read ends there.

Run: TestAnthropicStopEndsTranslatedReply and
TestResponsesCompletedEndsTranslatedReply (a held upstream; Responses client
over Anthropic, Chat client over Responses) plus ggbdpq's two tests; all four
red on origin/main's continuation.go (5s/30s timeouts), green with the fix.
go test ./internal/gateway ok (1039s, on mote); go vet darwin/linux/windows
clean; gofmt clean.
Not tried: a real OfficeAce account, the full ./... suite before the tag.

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-12 18:02:08 +08:00
ggbdpq 48875e580a gateway: a Chat upstream's [DONE] ends a translated reply's read, not its hangup (#5936)
A relay that streams a reply whole, says it over (finish_reason, [DONE])
and holds the connection kept the client waiting on the translated
reply's end: the read went on, the end was said only when the reading
gave up, and the client — Codex on a Chat-only provider, its turn stuck
in progress — gave up first. The reply now ends at the [DONE] its
protocol says it over with, its usage in the chunks before it; a reply
that said nothing is still the empty reply's to answer, and an upstream
whose end is told by its finish_reason (Gemini's OpenAI-compatible,
Command Code) is read as it was.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-12 18:02:08 +08:00
yetone 36eebea136 update: the header's Update pill waits until it is news (certhon520, jkd6688, Yuyuaneth, milianxinqi on X)
A release comes every few minutes, so a downloaded update was always
waiting and the pill (window and tray panel) never went out. /api/update
now says "quiet" while this version has been behind for less than 3 days
(update.Quiet, the Stable channel's soak; counted from the first newer
version seen, kept in update-behind.json for the version running), and the
pill stays away. An urgent release ("**Urgent release:**" in the latest's
notes or any release between, fetched once per check) lights it at once and
a dismissal does not hide it. The x dismissal now also starts the quiet over,
so the pill is not back with the next release. Settings > Version, the tray's
Restart to update, quit and Restart automatically are unchanged. Plugins'
dot is for plugins that do not update by themselves; left alone.

Run (mote): go test ./internal/update (ok), go test -run Update|Asset|Budget|Script ./internal/gui (ok),
gofmt, go vet darwin / linux nogui / windows clean, update-quiet.test.cjs 21/21 in chromium and
webkit across en, zh, zh-TW, ja, de, panel and window. Broken by hand: dropping
!u.quiet in app.js (11 red), forcing Quiet=false in jsonIn (TestUpdateQuietUntilBehindAWhile red).
Not tried: a real 3-day wait, and the urgent range lookup against the live site.
2026-11-12 18:00:00 +08:00
yetone 2a1111cbab library: an agent's profiles are one chip on a row, picked in the app menu (Yanzhongixuy on X)
With several Hermes profiles the Library listed each as its own icon on every
skill/MCP row (~20 identical glyphs). Profiles of one agent family
(hermes#, omp#, claude#, qwenpaw#, WSL variants too) now collapse into one chip
with a count; a click opens the app menu (openProtoMenu, multi-tick, live) to
pick profiles one by one. All still toggles every profile. Rows only; the
By agent view is unchanged. Other multi-profile agents (omp, claude, qwenpaw)
had the same problem and go through the same code.

Run on mote at the branch head: library-profile-chip.test.cjs (new, 12 cases,
chromium + webkit, en/zh/zh-TW/ja/de), red 12 of 12 with profileChip broken by
hand; library-*, group-skill-chips, skill-*, mcp-*, i18n-*, hermes-*, omp-*,
project-* GUI files: all green except library-loading (Claude plugins tab,
already #6204) and one webkit billion-context card case that passed alone
(load flake).
Not tried: a real Hermes install with 20 profiles, Linux WebKitGTK.
2026-11-12 17:57:13 +08:00
yetone 409581c053 routing: Least used first spends credits about to lapse first (kudi3699 on X)
kudi3699: a WorkBuddy account with a 5000-credit pack ending next March,
half used, plus check-in credits ending soon, was ranked by the whole
pool's used share in "Least used first", so it was never picked and the
check-in credits were lost. Smart (Renewal, Lapse) and Use before expiry
(Pace) already went by the plugin's runsOutAt/runsOut; Least used did not.

Allowance.Lapsing is what a window loses at RunsOut (RunsOutLeft of Of, at
most what is left) as points of the used share, fading to nothing a week
out; an amount not told is 0. routes.Seat.Lapsing at >= 0.5 points puts a
seat with room ahead of the rest, soonest Lapse first, then Used as before.
A seat at 90%+ is not helped. It is the shared runsOutAt/runsOut field, so
any plugin that sends it gets this. The WorkBuddy plugin already reports it
(0.2.27, the soonest pack incl. check-in rewards), so no plugin change and
no mover min change.

Run (mote): go vet routes/provider/gateway; GOOS=linux -tags nogui and
GOOS=windows vet; go test internal/routes, internal/provider (all),
internal/gateway -run "WorkBuddy|LeastUsed|Smart|Pace|Routing". Broken by
hand: urgent() forced false turns TestLeastUsedSpendsLapsingFirst and the
gateway test red. Not run: the full suite (started after the tag), real
WorkBuddy accounts, the plugin's bun tests (plugin untouched).
2026-11-12 17:56:38 +08:00
yetone 727e236378 gateway: a management API for providers, accounts and gateway keys, for a key set to manage (ljayic on X)
ljayic asked for a complete, stable management API so nothing needs a
hand-edited file. /v1/magpie/admin/ now serves the app's own /api handlers
(providers and their keys and accounts, OAuth sign-in start/poll/cancel,
gateway keys, account groups) to a gateway key set with
`magpie gateway-key admin <id> local|any`. Routes and actions not in
gui/admin.go's adminRoutes are 404, so a provider's saved key, a gateway
key's secret, sign-in export and actions on this computer's apps are not
served; "admin-key" is not served either, so the API can't raise its own
caller. Sign-in returns the vendor's page and code, opens nothing, takes no
password.

Guard (gateway/admin.go), in order: any Origin or Sec-Fetch-Site/-Mode is
403 with or without a key (Origin null, foreign, listed, *.localhost, an
app scheme); no key 401; a key without Key.Admin 403; from loopback the Host
must be ownHost (a rebound page's GET has no Origin); from the network the
key must be "any"; a proxied request counts as remote. Key.Admin is dropped
(adminOf) for a read-only, Browser, issued, expiring or default key, and
setting read-only clears it. The route is in readOnlyRefused and keySlotFree.

Docs: docs/reference.md "Management API", gateway-routing.md, and the
remote page in en, zh and ja. Routing Groups, sign-in export and a GUI
switch for the level are left to #6307.

Run (mica, the worktree before the rebase onto 9 newer commits): go vet of
access, cli, gateway, gui (darwin), GOOS=windows vet of the same four,
GOOS=linux -tags nogui vet of access, cli, gateway; gofmt -l empty;
go test -count=1 -timeout 45m ./internal/access ./internal/cli
./internal/gateway ./internal/gui: all ok but TestKeySlotEveryRoute, which
named the new route and is fixed here, then it and the read-only, admin and
guard tests pass again. After the rebase the same tests ran again.
Broken by hand, each red in TestAdminAPIGuards: browser check off (a
browser case served), Admin check off (a key without it served), Host check
off (a rebound name served), the "any" requirement off (a local-only key
from the network served, and a proxied request).
Tests: TestAdminAPIGuards (no key, unknown key, non-admin, read-only,
local/any, x-api-key, 8 browser headers x 3 callers, rebound Host, proxy,
no handler), TestAdminKey (access: levels, read-only, Browser, issued),
TestGatewayKeyCLIAdmin, TestAdminAPIGatewayKeys / Providers (a canary key
is never told) / SignIn, TestAdminRoutesEveryAPIRoute.
Not tried: a real sign-in against a vendor through the API, a request from
a second computer on the LAN, the GUI suite (no page or app.js changed), a
Linux/Windows run of the new tests.
2026-11-12 17:47:11 +08:00
yetone 3f743d2cd7 site: an fx docs page in en, zh and ja
/docs/fx says how magpie sets up Vercel Labs' fx (fx.sh, not the JSON
viewer): found by ~/.fx, not the command; provider and models.magpie in
~/.fx/settings.json, with providers.magpie on openai-chat-completions at
the gateway's /v1 with auth none; no effort, as fx sends none to a
provider of the user's own; model_metadata capped at fx's 256 with the
model in use first, and no output limit that isn't below the context
window; reviewer_model and an omit tool_choice_mode kept, auth written
whole; the restart notice; switching back to the provider fx talks to
without magpie, Vercel's AI Gateway when unset. Each claim is from
internal/agent/fx.go. Linked from each language's Aside page; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: fx itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 17:40:14 +08:00
yetone 4a5e58a04f gateway: one account held only by Codex credits being off is sent at once, not queued (tmr11235 on X)
tmr11235, after v0.1.3857: "没有设置上限或者并发,只有一个号,这个号额度用了95%,
但我不希望排队". v0.1.3852/3857 made a turn that waits for its account's one
turn near a usage cap say "queued". The wait itself is nearCap: an account
within 5 points of a cap holds one turn at a time. HoldCaps counts a Codex
account set not to spend its credits as capped at 100% of any window
(Credits), though the user set no usage limit, so such an account at 95%
was near its "cap" and its second turn waited for the first, with no other
account to send it to.

Now a try near its cap takes the account's turn only when the user set a
usage limit on it (a share or an amount: userCapped) or the turn has another
candidate to go to (it is sent there first, the account kept behind). A sole
account whose only hold is credits off is sent at once; the 100% hold itself
still applies at the try (capHeld). A cap the user set keeps its one turn at
a time, as dyzdyz010 asked for.

Run (mica): TestNearCap*, TestFarFromCap*, TestPiTwoTurns*,
TestNearCapOnlyCreditsOffOneAccountSendsAtOnce (a single account at 95%,
credits off, no cap: both turns out at the vendor at once, none waiting);
gofmt; go vet darwin, linux nogui, windows of internal/gateway.
Broken by hand: the userCapped condition removed, the new test red ("never:
both turns out at the vendor at once").
Not tried: a real Codex account; I could not tell from the report whether
tmr11235's account has credits off or a cap they forgot: with a cap set,
a sole account still queues, by design. Full suite after the tag.
2026-11-12 17:37:42 +08:00
yetone 4718943432 gateway: a small reply limit sent to Tencent's DeepSeek has room to think above it (WaiooT on X)
WaiooT (Tencent Cloud Token Plan, deepseek-v4.1-flash, an agent named
nowledge-mem): requests often ended "an empty reply (the model answered
nothing; try again) -- cut at its length, the whole output spent on
reasoning". Output 4,096, reasoning tokens 4,096, finish length. The
request named max_tokens 4096 (the memory tool's own setting; magpie adds
no limit to it) and no reasoning. Tencent's DeepSeek runs thinking by
default (docs 1823/132248: thinking "enabled", reasoning_effort "high",
"max_tokens >= 2048 advised in thinking mode") and counts it in
max_tokens, so the thinking spent the whole limit before an answer.

A Chat or Responses request to a tencentmaas.com provider's DeepSeek model
that names a reply limit of 16384 or less, names no reasoning of its own
(reasoning_effort, thinking, enable_thinking, reasoning...) and has no Max
output set by the user is sent that limit plus a high effort's room
(replyRoom, as side calls are), within the model's own limit where known
(withThinkingRoom, maxoutput.go). Scoped to that host and DeepSeek models.

The failure itself, a cut void, was already failed at once and asked
nowhere (#2972): its text now names the limit the request set and what to
do ("raise max_tokens in the agent, or ask for less reasoning"), still
holding cutVoidWords, so the group and patience matching is unchanged.

Run (mica): TestTencentDeepSeekCapGetsThinkingRoom (4096 gets room;
max_completion_tokens too; effort asked, thinking off, a large limit, no
limit, and another vendor's DeepSeek go as they came), TestChatLength*
(the error names the limit), TestShortDefault*, and gateway tests matching
Void|Length|Empty|Cut|Tencent|Output|Thinking|Reasoning; gofmt; go vet
darwin, linux nogui, windows of internal/gateway.
Broken by hand: withThinkingRoom's call removed, the new test red
("4096 and no reasoning: max_tokens 4096, want 28096").
Not tried: a real Tencent Token Plan key (none here), so that the 4096
came from the agent and not a Tencent default is read from the docs and the
reporter's numbers, not seen on the wire; an Anthropic-protocol client in
front of Tencent's DeepSeek is not covered; full suite after the tag.
2026-11-12 17:37:04 +08:00
yetone e0b67f342b gui: times follow the system's 12 or 24 hour clock (iXerol on X)
An en-US Mac set to 24-Hour Time showed Routing's request times in 12
hours: no webview hands the page the system's clock, and navigator.language
carries only the region. boot.js now says it as hourCycle ("h23" or "h12",
left out when the system names none, and for a browser tab, which keeps its
own): macOS from AppleICUForce24HourTime / AppleICUForce12HourTime, Windows
from Control Panel\International sTimeFormat, Linux from gsettings
clock-format. intlLang() adds -u-hc-<cycle> to its tag, so every formatter
that takes it follows, and the places that forced 24 hours (hour12: false,
hourCycle h23) spread hourClock() instead: 24 unless the system says 12.
Read once per 30s, so a change in System Settings shows at the next load.

Run on mote: new hc-clock.test.cjs (en-US on a 24h system, en-GB on a 12h
one, a silent system), chromium and webkit; Go tests for the three readers
and boot.js; gofmt; go vet darwin, windows and linux nogui; internal/gui
tests; GUI files of gui-*, i18n-*, panel-*, quota-*, reset-*, routing-*,
usage-* in chromium and webkit. TestCoreScriptBudget was over by 77 bytes
and passes with two app.js comments cut, no raise.
Broken by hand: hc-clock is red without the intlLang suffix.
Not tried: a real Windows or Linux session's setting (the readers are
unit-tested on their formats), a live Mac.
2026-11-12 17:29:52 +08:00
yetone ed08a03793 provider: moving only when accounts were last seen builds no catalog anew
An idle magpie rewrote logins.json every seenEvery (10 minutes) only to
move each account's Seen time, and the write called Changed(): every
held catalog was dropped and filememo forgot what it had read, so the
next dsh round (KeepDshWired, every 30s) built the magpie models again,
~42 MB of the 62 MB a real account's idle magpie allocated in five
minutes. Nothing built from the accounts reads Seen.

rememberLogins now writes such a file quietly (writeLoginsTold with
tell false): no Changed(), no filememo.Forget. A reader still finds the
file's new time and size; a request holding it reads the old bytes for
up to a second. A write that changes anything besides Seen is told as
before.

Found with a traced build on mote, sandbox HOME holding a real Codex
account: the stamp moved at 00:59:41 from
keepHooksToldOfSignIns -> SignInAlertsAt -> Accounts -> rememberLogins
-> writeLogins -> Changed.

Run (mica): go test -count=1 -timeout 45m ./internal/provider
./internal/agent ./internal/filememo ok; go vet for darwin, linux and
windows ok; gofmt clean. TestSeenOnlyWriteBuildsNothingAnew is red with
the write always told (tell true), green with this change.
2026-11-12 17:27:33 +08:00
yetone cfd3367df8 usage: a request's details show its service tier (JackyFill on X)
The ledger has kept each call's service tier since #1784 (tier_asked,
tier_sent, tier_served in the log, the CSV and the JSON), but the
Requests page never showed it. A request's details now have a Service
tier line: "asked X", then "sent Y" only when it differs, then
"answered Z" only when the reply named a tier. A call with none shows
no line. Row flag bits are untouched: the tiers are string slots, so no
bit is taken.

Run, on mica: new ledger-service-tier.test.cjs (3 rows: all three tiers,
asked+sent without an answer, none) in chromium and webkit, en zh
zh-TW ja de, 12 of 12 green; with the add("Service tier") line removed
by hand it is 0 of 12; i18n-keys caught a duplicate "Service tier" key
(the core table already has all four languages), which is removed;
ledger-*, i18n-keys, i18n-en-no-cjk and gui-* files rerun green after
(ledger-cache-hit chromium was red once in the first batch, green on
rerun in the same batch's second run).

Not tried: a real Codex priority call end to end (the gateway side is
#1784's); the full suite runs after the tag.
2026-11-12 17:22:03 +08:00
yetone 65e1422c4a update: fall back to the GitHub release when usemagpie.ai can't be reached (ssharpcc on X)
A company network that allows github.com and no other domain could not
update magpie at all: the feed (usemagpie.ai/api/latest) failed and that
was the end. When the default feed fails (20s limit, so dropped packets
don't hold the check for 10 minutes), the newest release is now read from
yetone/magpie-releases: the API, or the release page's redirect when the
API is rate-limited, plus SHA256SUMS and SHA256SUMS.sig from github.com
(or the API route when github.com's address is busy). The result goes
through Release.verify like the feed's: ed25519 signature against the
embedded key, the version inside the signed message, every hash from the
signed list. Unlike the feed, a release read this way must be signed
whatever its version. Files download from github.com (Asset.GitHub),
checked by hash as before; feed files named on the site now also get a
github.com address, so a download falls back too. Covers the app,
`magpie update` and the Windows and Linux builds (all go through
latestAt). Not on Stable (the site's choice) nor on MAGPIE_UPDATE_FEED.

Run (mica, tree at this head): gofmt clean; go vet update/cli/gui, GOOS=windows
and linux vet of update; go test internal/update, internal/cli, internal/gui all ok.
New tests use a feed port nobody listens on and a fake GitHub (API and
rate-limited redirect paths): update succeeds and stages the file by hash;
wrong key, swapped sums, missing and junk signature, signature for another
version, unsigned old version are refused with no download. Broken by hand:
with verify() removed from the fallback, 4 of those tests go red.
Not tried: the real github.com, a real allow-listed network, Windows run.

Other usemagpie.ai-only on such a network: install.sh, plugin catalog
(falls to raw.githubusercontent.com, ok), npm registry for plugin
installs, models.dev catalog, partners/icons, telemetry.
2026-11-12 17:19:40 +08:00
yetone 0d3bba882e tests: the search queue's fake upstream ends when its client fails first (#5666)
macOS CI at 169ec9165 (run 43178215035) hit internal/gateway's 30m alarm
in TestSearchQueueKeepsCodexAlive/silent, as #5666 recorded for
/comments at 00198b26e. The fake upstream waited on proceed with no other
way out, and proceed was closed only after the client's Do returned. When
the client failed first (t.Fatal on a loaded runner), the deferred
up.Close waited for that handler until the package alarm, and the
client's error was never printed.

The handler now also returns on its request's context, and a deferred
once-close of proceed runs before up.Close. A client failure is a named
red with its message, in under a second. Why Do failed on that runner is
still unknown; the next red will say.

Same approach as the fix proposed on #5666 (Gaoshou101's comment), made
on the current test, which has since gained release/finish.

Run on mica:
- go test -tags nogui -race ./internal/gateway -run '^TestSearchQueue'
  -count=10: ok (15s).
- GOOS=linux go vet -tags nogui and GOOS=windows go vet on
  internal/gateway: ok. gofmt clean.
Broken by hand: a t.Fatal injected after Do, once the handler had
reached proceed. Old code: panic at the 60s -timeout, stuck in
/comments, the same shape as CI. Fixed: all four subtests red in 0.33s
with the injected message. A 1ms hard cancel failed fast on both (the
request never reached the upstream), so it doesn't exercise this.
Not run: the full gateway package (a test-only change to this one test).
2026-11-12 17:17:31 +08:00
yetone 4940aed1d8 gui: times follow the system's region, not the webview's (iXerol on X)
A Mac set to English with Japan as its region (AppleLocale en_JP, 24
hours) showed 12 hours: with neither AppleICUForce24HourTime nor
AppleICUForce12HourTime set, the page formatted in WKWebView's
navigator.language (en-US). boot.js now carries the system's own tag as
"locale" (macOS: `defaults read -g AppleLocale`, with @rg= winning;
Windows: Control Panel\International LocaleName; Linux: LC_ALL, LC_TIME,
LANG), and intlLang takes it over navigator.language for English. The two
forced clock switches still win over the region's clock. A browser tab
keeps its own locale.

Run (mica): go test -run 'HourCycle|LocaleTag|Boot' ./internal/gui ok;
gofmt -l clean; go vet darwin, linux nogui, windows on internal/gui clean;
GUI hc-clock, reset-clock-formats, dates-gui-lang, i18n-keys, header-relang,
desktop-lang in chromium and webkit: 0 fail. Real AppleLocale on this Mac
reads en_SG. Broken by hand: intlLang back to navigator.language turns the
new en-JP case red in both engines. Not tried: a real Windows or Linux
session with a regional format that differs from the display language; full
suite starts after the tag.
2026-11-12 17:16:34 +08:00
yetone c1a91b5a52 agents: Mistral Vibe is an agent, and a Library target (alterxyz4 on X)
Vibe (mistralai/mistral-vibe, the `vibe` CLI) keeps its settings in
config.toml in $VIBE_HOME, else ~/.vibe. magpie now connects it: a
[[providers]] entry named magpie (the gateway's /v1, api_style openai,
backend generic), one [[models]] entry per catalog model aliased
magpie/<provider>/<model>, and active_model set to the alias, with the
previous value stashed and put back on Disconnect. Vibe reads keys only from
the environment, the keyring or ~/.vibe/.env, so the key naming Vibe goes in
the provider's extra_headers as an Authorization header; nothing is put in
the user's environment. Avibe's `vibe` command is turned away by binNot.

Library (#5595): instructions are $VIBE_HOME/AGENTS.md and skills
$VIBE_HOME/skills (vibe/core/system_prompt.py,
vibe/core/config/harness_files/_paths.py, read at 3.1.2). VIBE_HOME is in
appdir's usable list and agentenv. README (en, zh), docs/reference.md and
docs/subsystems/agent-wiring.md list it; the restart notice is in zh, zh-TW,
ja, de.

Run (mica, sandbox HOME):
- go test -count=1 ./internal/agent ./internal/library ./internal/appdir
  ./internal/agentenv ./internal/gateway ./internal/gui: ok.
- gofmt -l clean; go vet darwin, linux -tags nogui, windows on the touched
  packages: clean.
- Real vibe 3.1.2 (uv tool install mistral-vibe) with the file shape magpie
  writes, against a fake OpenAI upstream: the alias with slashes resolves as
  active_model, the request goes to /v1/chat/completions with model kimi/k2,
  Authorization: Bearer <key> from extra_headers and user-agent
  Mistral-Vibe/3.1.2.
- GUI: agent-notice-lang, i18n-keys, i18n-en-no-cjk, gui-zh-tw pass.
- Broken by hand: vibeMine returning false fails TestVibe,
  TestVibeOwnModelTakesMagpieOut and TestVibeSyncKeepsTheirs.

Not tried: the file written by the built magpie binary itself (the unit tests
write it through the same code), Windows runs of the new tests, a Vibe
signed in to Mistral with its own models alongside. gui-de and gui-ja
"every zh string" were red on the base for the "{agent} isn't installed
here" string, not for this change.
2026-11-12 17:07:23 +08:00
yetone ffe0dc49a3 site: an Aside docs page in en, zh and ja
/docs/aside says how magpie sets up Aside: providers.magpie in Pi's
format in each account's ~/.aside/u/<id>/models.json, with magpie's own
key for Aside, and why an entry with no key or another key is left
alone; the default model, thinking level, the fast, standard, deep and
visual modelCategories and imageGenerationModel set through Aside itself
(aside repl), then read back; which account is set up (picked in
magpie, else currentAccountId in accounts.json, else u0); switching back
to the saved value of each setting magpie changed. Each claim is from
internal/agent/aside.go, aside_account.go and aside_native.go. Linked
from each language's Ante page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: Aside itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 17:06:11 +08:00
yetone db9048829b provider: a vendor's 400 whose message is only "Bad Request" shows its type, code and param (FjTxw0Mz8wxBuye on X)
Codex on a Team account (gpt-6.1-sol, high reasoning) showed a bare
"Codex: Bad Request" with nothing of what the vendor refused. apiError took
the error object's message alone; when that message is only an HTTP
status's text, the error's own type, code and param now follow it.
Any message with words of its own is shown as before.

This does not find why that account is refused: no Team account was
available, and a Pro account takes the same request (gpt-6.1-sol, high,
a tool call, HTTP and socket). The next report shows the vendor's field.

Run: new TestAPIErrorBareStatusMessageGivesItsFields (red on the old
apiError, green after), internal/provider and internal/gateway whole at
this tree, go vet darwin, windows and linux nogui for provider, gofmt.
Not tried: a Team account; the GUI tests (no GUI file touched).
2026-11-12 17:03:53 +08:00
yetone 8d5bcf18b0 gateway: a request to Mistral keeps its newest 20 images (regain4125 on X)
Mistral answers a Chat request with more than 20 images with 400 "Total
number of images exceeds the maximum allowed of 20." Codex reading its
21st screenshot in one conversation failed on every later turn. Both
routes to Mistral (the Chat passthrough and the Responses-to-Chat
translation) now replace the oldest images past the newest 20 with a
short text part, in place; a request within 20 goes byte for byte, and
other vendors are not touched. Mistral's docs give no number ("depends on
the model"), so 20 is the one its error names.

Run on mote: TestMistralImageLimit (Chat route, Responses route, 20 images
unchanged, another vendor's 26 images unchanged). Broken by hand: with the
two calls off, the chat and responses cases fail. Not tried: a real
Mistral key; a model with a smaller limit than 20 (Mistral's docs do not
say any does).
2026-11-12 17:00:39 +08:00
yetone da5d54e2e3 catalog: Mistral's DeepSeek V4.1 Flash takes images (regain4125 on X)
models.dev lists Mistral's deepseek-v4-1-flash-1017 as text-only, so its
image input was off by default. Mistral's models page lists DeepSeek V4.1
Flash 1017 with "text and image inputs", and DeepSeek's own docs give
deepseek-flash Vision. Mistral's entry now says image; the same model at
other vendors (chutes, nearai: text-only rows) and Mistral's other models
keep models.dev's row. DeepSeek's own deepseek-flash and the relays'
deepseek-v4.1-flash already read as image (checked with the bundled
catalog: SeesImages true).

Run: TestMistralDeepSeekFlashSeesImages and the catalog Provider tests on
mote. Broken by hand: with the call removed the test fails (Images:false).
Not tried: a real Mistral key, the Codex picker in the GUI; the reporter's
provider was not named, Mistral is inferred from the second report.
2026-11-12 17:00:39 +08:00
yetone 327da691ae gateway: the Codex app's list stands on Codex's cache while the backend can't be reached (not_4O4 on X)
Beside the ChatGPT sign-in the Codex app's picker reads
magpie-desktop-models.json, written only once the ChatGPT backend's model
list is known. not_4O4 (Windows, Codex App 26.1106.6628.0) had no such file:
the backend's ask never succeeded from there, so the file was never written
and the picker showed GPT alone while the account had room, magpie's models
only (and no GPT) once it was used up and magpie became the provider.

After an ask has failed with no list from before for that sign-in,
CodexDesktopCatalog now hands Codex's own models_cache.json entries and
magpie's models (the revoked sign-in's path), told once through
CodexDesktopChanged; the backend's list replaces it when it answers. With no
cache the file stays as it was, and a 502 after a revoked sign-in is still
no answer.

Run (mote): go vet gateway and agent (darwin), GOOS=windows and linux -tags
nogui vet of gateway, go test ./internal/gateway ./internal/agent;
TestCodexDesktopCatalogBackendUnreachable is new and TestCodexDesktop*,
TestCodexDesktopCatalogRevokedSignIn still pass. On the Windows box
(win-run) the agent's Codex desktop tests passed and a used-up probe wrote
magpie-models.json with relative key as in the report.
Broken by hand: the stand-in only for revoked, the new test went red.
Not tried: the real Codex app on the reporter's network; the reporter's
used-up half (GPT missing from the provider catalog) did not reproduce, the
catalog carries codex/<slug> entries in the probe on macOS and Windows.
2026-11-12 16:54:10 +08:00
yetone c4f7ba9d3a update: only a release whose SHA256SUMS carries the release key's signature is installed (danny0dong on X)
The updater took a file and its SHA-256 from the same feed answer, so
whoever could change /api/latest could swap both; only the Mac app also
checked its signing team. Now release CI (yetone/magpie-releases) signs
"magpie release <version>\n" + SHA256SUMS with an ed25519 key held as that
repo's UPDATE_SIGNING_KEY secret and publishes SHA256SUMS.sig (release
assets: 16 -> 17). The site worker carries the list and signature in the
feed; internal/update/signed.go checks them against the public key built
into the binary, takes each file's hash from the signed list and refuses a
missing or bad signature or a feed hash that differs. Versions from
0.1.3862 require it; older ones and binaries older than the key update as
before. MAGPIE_UPDATE_FEED lifts the requirement for local test servers.
mirror-release waits for 17 assets; docs/reference.md and code-standards
say 17 and describe the transition.

Run: go test internal/update, internal/cli, internal/gui -run Update|WhatsNew
(ok); node --test site/*.test.mjs (116 ok); gofmt; go vet darwin, linux
nogui, windows on internal/update. Broken by hand: signature check skipped
(tamper and other-key tests red), feed-hash comparison skipped (swapped
hash and feed tests red), worker not attaching signed (worker test red).
The embedded key is checked against a sample signed by the real key with
openssl, as CI does. Signing script run against a throwaway key.
Not tried: a real signed release before this tag; install.sh does not
verify the signature.
2026-11-12 16:43:23 +08:00
yetone 19a698d0f9 Plain wording for the held-compaction error and the account-switch hint (ccw1942796 on X)
The error magpie gives Codex when a conversation's compaction has failed 3
times now says what happened, how long magpie waits and what to do:
"Couldn't compact the conversation: <model> failed N times in a row (last:
<vendor's reason>). magpie waits <t> before asking it again. To compact now,
switch this conversation to another model." It is a 400 back to Codex
(codexCompact), never sent upstream as prompt.

The hover hint beside "Switch {agent}'s account automatically" is two short
lines per agent instead of three long ones, in en, zh, zh-TW, ja and de.
It still says it is the agent's own sign-in that moves, that the agent sends
the requests, and that sharing an account is against the vendor's terms.

Run on mote: gofmt -l, go vet (darwin, linux, windows) on internal/gateway,
go test -run Compact ./internal/gateway, and in chromium and webkit
i18n-keys, i18n-en-no-cjk, keep-login, pool-ends, sign-in-moves (84 of 84
GUI subtests ok, en and zh). The hold test now asserts the new wording.

Not run: the full suite before the tag (started after it); ja, de and zh-TW
screenshots of the hint; breaking the new assertion by hand (the old text
lacks the asserted words).
2026-11-12 16:37:49 +08:00
yetone 1b884225ad gateway: agy's own /effort or --effort level beats the Agents row's pick (haohaolee on X)
Antigravity CLI on a Google model through an API provider: the row's
effort field was there and applied (TestAgyAgentEffort), but agy's own
/effort (works on the Google names agy knows, which the gateway serves
by bare name) and --effort low|medium|high (any model) send a
thinkingLevel that the row's pick then rewrote, so the session's choice
seemed to do nothing. A request naming a level is now left as asked
(agyLevelAsked); a request with thinkingBudget -1 still gets the row's.
"/effort" stays "not adjustable" for "magpie/..." model keys: agy 1.5.5
and 1.5.6 have no settings or ModelInfo key that enables it (tried
thinkingLevel, thinkingBudget, displayName, vertexModelId).

Run: TestAgyAgentEffort, TestWithGeminiEffort on mote; the new case is red
(sent "low" for an asked HIGH) with the condition removed by hand and green
with it. Real agy 1.5.5/1.5.6 against a fake Gemini upstream in a sandbox
HOME showed the levels reaching the gateway. Not tried: a real Gemini API
key, agy against the real gateway end to end.
2026-11-12 16:34:34 +08:00
yetone a5c3ea1aca site: an Ante docs page in en, zh and ja
/docs/ante says how magpie sets up Ante (antigma.ai): the magpie entry
in ~/.ante/catalog.json ($ANTE_HOME) at the gateway's /v1 on the
OpenAiCompatible wire style, with magpie's models in preferred_models;
why it has no auth block, and the user's own auth, http_headers and
extra_body kept in it; why support_vision is left alone and a routing
group gets no efforts; why provider and model in settings.json are set
too, since Ante's shipped providers come first in auto-detection; the
once-per-process read and the lenient parse; switching back to the saved
pair, with a choice made in Ante since left standing. Each claim is from
internal/agent/ante.go. Linked from each language's omp page; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Ante itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 16:31:18 +08:00
yetone 531b277836 claude: an idle run's session survives a restart, so the next turn resumes it (recih on X, #6292)
As the gateway ends (abortAll), keepShelf shelves every run idle between
turns and writes the shelf to claude-shelf.json (temp and rename): per
entry the conversation fingerprint (turnKey: account, model, settings,
messages), Claude Code's session id, its project folders (config folder
and work folder), the account, tools and cache marks. The next gateway's
unshelve reads the file once when its shelf has nothing for the turn
(loadShelf, which takes the file away) and starts Claude Code with
--resume, told the turn alone, instead of the whole transcript (~100k
cache-write tokens on a long conversation). A file that does not parse
whole, another version, a missing session file, a folder that is not a
Claude project folder, or an entry older than idleLongest is unknown and
falls back to today's replay. Rewritten-turn matching (looseTurn) is not
kept; runs in a turn or parked on tool results at the stop are not
either; a crash writes nothing.

Run (mote): gateway "Claude|Subscription" tests green (90s), gofmt, go vet
darwin/linux/windows (nogui) and gui. TestClaudeIdleRunSurvivesARestart
(two Servers on one HOME, fake claude) is red with keepShelf off (session
removed as the gateway ended) and green with it; the unreadable-file
cases fall back to replay. TestClaudeSessionFilesAreRemoved now expects
the sessions to stay until the shelf discards them.
Not tried: a real Claude Code (a sandbox HOME has no sign-in), the
full ./... suite before the tag, Windows.
2026-11-12 16:25:28 +08:00
yetone 4b283e4f2c gateway: a Claude refusal for one model's limit rests that model, not the account (YsiCing on X)
Claude Code's "You've reached your Fable limit. Run /usage-credits to
continue or switch models with /model" read as a plain rate limit: the
"reached your ... limit" wording was in none of the quota word lists (only
"hit your ... limit"), so the whole account rested and Opus was refused
with Fable though its quota was left.

The four lists in routing.go and fallback.go's quotaWords take "reached"
as they take "hit". modelNamed (so every rest path that asks modelLimited)
reads a Claude account's "reached/hit your <family> limit" as that model's
when the family is in the model's id (claudeFamilyLimit); "usage",
"session", "weekly" and the like, and "You've hit your limit", stay the
account's. Messages, Chat Completions, Responses, the group fallback and
the Claude Code bridge all rest through restAfter.

Run at this tree (mote): TestClaudeNamedModelLimitRestsThatModelOnly red
without claudeFamilyLimit (rests the account, Why rate), green with it;
internal/gateway and internal/provider, gofmt, vet on darwin, linux and
windows (results below). Not tried: a real Fable-limited account; the
family word is Claude Code's wording as the screenshot shows it.
2026-11-12 16:15:49 +08:00
yetone 8a705a5e5f tray: the menu bar's counts follow Settings' 万/亿 units (jipairamen on X)
The tray's totals (the Σ cell and the tooltip) always said K, M and B.
trayCount now takes the tray's language and, in zh or zh-TW with
chineseUnits on, says 1.33 亿 / 68.1 万 (億 and 萬 in Traditional) as the
page's fmtN does; English and the other languages are unchanged. The tray
is also read again when chineseUnits changes, with no restart.

The TUI and the CLI are English-only and the setting means nothing there
(settings.ChineseUnits: "when magpie speaks Chinese"), so they keep K/M/B.

Run (on mote): TestTrayCountFollowsChineseUnits, new, red with the unit
branch switched off by hand (all 8 cases and the total card), green after;
go test ./internal/gui ./internal/settings ok; go vet darwin, linux
(nogui) and windows clean; gofmt clean.
Not tried: the live menu bar (never run the live binary).
2026-11-12 16:03:34 +08:00
yetone 223b57ffa3 gateway: a turn waiting for its account's turn near a usage cap says queued, not routing (tmr11235 on X)
tmr11235 (Pi, Codex subscription, gpt-6.1-sol): the second request sat in
"routing" until the one before it was answered. Two Pi turns at once on a
Codex sign-in are both out at the vendor at once (HTTP and websocket
upstream, TestPiTwoTurnsOnCodexAreOutTogether, green on the old code too),
and no concurrency cap is set for Codex by default. What does hold a
second turn is an account within 5 points of a usage cap the user set
(nearCaps, one turn at a time). That wait comes before the first try is
begun, so the row had no try and read "routing", and the wait wasn't a
known one for the unrouted watch either (it could end the request as
unknown after 30s).

The wait now sets the route's Phase to "queue" and the request's phase
(notePhase, so it is a known wait). The Routing page says "queued…" and
its explanation says what it waits for, in en, zh, zh-TW, ja, de.
The one-turn rule itself is unchanged: it protects a cap the user set.

Run (mote): TestNearCap*, TestNearCapWaitSaysQueued, TestPiTwoTurns*,
go test ./internal/gui, routing-queued/routing-masking/routing-wait-dot
in chromium, routing-queued in webkit, i18n-keys, i18n-en-no-cjk, gofmt,
go vet darwin/linux nogui/windows of internal/gateway.
Broken by hand: showQueued replaced by a no-op, TestNearCapWaitSaysQueued
red ("never: the waiting turn's route says queued").
Not tried: a real Codex account near a real cap; full suite is started
after the tag.
2026-11-12 16:02:11 +08:00
yetone b883b11c8a gateway: a test holds Copilot's Gemini and Grok tool schemas on every client route (Novello42 on X, #3931, #4374)
Novello42 reported Codex with MCP tools through Copilot's Gemini and Grok
failing with 400 or empty tool arguments. Both causes were fixed in
b1f5806cb (v0.1.3757): Copilot's Gemini no longer gets `type` written
beside a nullable anyOf, and Copilot's Grok gets root unions as objects
(nested unions folded) and namespaces flat. This adds the matrix that was
missing: Pydantic's Optional[str] (#3931), Codex's move_thread_to_project
projectId and a reconstruction of automation_update (root oneOf through
$defs, unions inside the branches), each sent by a Chat, Messages and
Responses client to both models, against a fake Copilot that refuses what
the live account refused.

No product change. Run (mote, -tags nogui): the new test passes at
origin/main 4028687b8. At b1f5806cb^ (before the fix) 12 of its 18 cases are
red: all nine Gemini and the three Grok automation ones, so it guards the
fix on every route, not only the Responses one.
Not tried: a live Copilot account; Grok with a union inside a union that
sits under a property rather than at the root (no recorded refusal to
copy); the full suite.
2026-11-12 16:01:00 +08:00
yetone 4121bebea6 site: an omp docs page in en, zh and ja
/docs/omp says how magpie sets up omp (oh-my-pi, a fork of Pi): each
role's model under modelRoles in ~/.omp/agent/config.yml as
magpie/<provider>/<model> with an optional :level (default, task, smol,
slow, plan, vision, advisor, commit, tiny, memory, and what each falls to
when unset); the keyless magpie provider in models.yml with each model's
window, cap, input, levels and cost (without which omp counts 0); max
only from omp 16.4.0; image models for the image role from 18.7.0; why
magpie/** joins an enabledModels list; each model on its native API;
profiles as omp#<name> and WSL; switching back from the stash, and the
provider kept while anything is on magpie. Each claim is from
internal/agent/omp.go and omp_scope.go. Linked from each language's
StepCode page; in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: omp itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 15:58:35 +08:00
yetone 4028687b8c memory: dates in memory_search and the dream's notes are the user's local time, with the hour and offset (Norethcy on X)
memory_search printed a memory's Updated as a bare UTC date, so a memory
saved at 04:30 on the 11th in Shanghai read as the 10th, and the stored
times were written in UTC. Now:
- every memory time is written in the local zone (now() instead of
  now().UTC()): created, updated, edited, used, sync tombstones, digest
  publish time;
- memory_search shows 2026-11-11T04:30+08:00 (memoryStamp);
- the dream's notes list the creation day in local time, as "Today" there
  already was.

Old data: the file already held full timestamps, only in UTC ("...Z").
They parse as the same instants and are shown in local time, so no
migration; they are rewritten with a local offset when next changed.
There is no date filter in memory_search, and the Memory tab shows no
dates, so nothing else read the UTC day.

Tests: TestMemorySearchDatesInLocalTime (gateway) with time.Local at +08:00
reads an old "Z" memory and checks a new save is stored with +08:00. Red on
the old code both halves, broken by hand: the DateOnly line printed
2026-11-10, and now().UTC() in memory.go failed the saved-zone check.
Run with TZ=UTC and TZ=Asia/Shanghai on mote: internal/memory,
internal/memdistill, internal/gui (memory tests) ok; gofmt clean;
go vet ./..., linux nogui, windows ok. Not run: full ./... suite before
the tag (started after it), GUI browser tests (no assets changed).
2026-11-12 15:54:34 +08:00
yetone b21eefadac gui: a provider's models leave out the listed window, reply limit and merge name that equal what is in use
/api/providers sent, for each of a real account's 875 models, the
window and reply limit the vendor listed even when they were the ones in
use (851 and 786 of them), and the merge name when it was the model's
own id (241). Every reader already falls back to context, output and id
(modellimits.js `m.listed || m.context`, `m.listedOutput || m.output`,
app.js `"listed" in m ? … : m.context` and `m.merge || m.id`), so these
are left out.

TestProviderModelWindowSaid now expects no listed window when it is the
one in use; with the drop removed by hand it is red ("[1000000
1000000]").

Run: go vet + go test ./internal/gui on mica (ok, 124.9s); GUI files
that read these fields, both engines, on mica.
2026-11-12 15:54:08 +08:00
yetone 169ec91651 gateway: a relay's Chinese "未知请求字段:prompt_cache_retention" is read as a refusal of that field, and the request is asked again without it (ldl123292 on X)
基元律动's OpenAI-compatible relay answers a field it doesn't take as
"未知请求字段:<name>". refusedOptional only knew the English wordings, so
the retry without prompt_cache_retention (and the other optionalFields)
never happened and the error went to the client. magpie itself adds none
of these fields to a custom provider's request: prompt_cache_retention is
the client's own, and optionalFields already drops it on a refusal and
remembers the provider. Added the Chinese wordings (未知/未识别/不支持/
不允许/无效 + 请求 + 字段/参数/属性) to unsupportedOptionalField.

Run: gofmt clean; go test -run 'Optional|Refus' ./internal/gateway ok on
mote; go vet gateway darwin/windows/linux. chinese-unknown-field and
chinese-unsupported-quoted in TestRefusedOptionalNamesOnlyUnsupportedFields
fail on the old gateway.go (checked by hand). Not run: full suite before
the tag (started after), the relay itself (no account).
2026-11-12 15:50:10 +08:00
yetone f38ef9821b site: a StepCode docs page in en, zh and ja
/docs/stepcode says how magpie sets up StepCode (StepFun's step
command): defaultProvider and defaultModel in ~/.stepcode/config.toml
(or the folder above an absolute STEP_CODING_AGENT_DIR, renamed by
STEPCODE_CONFIG_DIR), written with the rest of the file kept;
providers.magpie in models.json (JSONC, Pi's provider format,
openai-completions), checked to be objects before a write; why magpie
appends its pick to an enabledModels scope and removes only what it
appended, and a renamed provider's entries moving with it; switching
back from the saved original provider, model, scope and providers.magpie
text, with files magpie made removed. Each claim is from
internal/agent/stepcode.go. Linked from each language's Avibe page; in
the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: StepCode itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 15:24:53 +08:00
yetone 2cf09b1940 site: an Avibe docs page in en, zh and ja
/docs/avibe says how magpie sets up Avibe (avibe-bot/avibe, the avibe-os
package and vibe CLI): magpie as one Model Hub source, serving Vibey and
the Claude Code, Codex and OpenCode it runs; the home ($AVIBE_HOME,
~/.avibe, ~/.vibe_remote before 3.0) and model_hub.sources; why a source
is added through Avibe's internal API (dispatch.sock, or endpoint.json's
port and token on Windows) and only while Avibe runs; the create_source
payload; the stashed id, a hand-added source at the gateway counted as
magpie's, and a moved gateway's source made again; why openai_chat
rather than Responses; the model list from /v1/models and the refresh on
a change; removing it, confirmed with what Avibe listed. Each claim is
from internal/agent/avibe.go. Linked from each language's MothX page; in
the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Avibe itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 14:50:52 +08:00
yetone b43c4eda80 provider: a plugin's kept icon found on disk isn't looked for again for a minute
/api/providers asks for every plugin provider's icon on each answer,
and each ask ran os.Stat on the icon's file. On a real account (26
providers) a CPU profile of 40 /api/providers calls on mote had
pluginOwnIcon's stat at 80ms of providersState's 420ms. A file found is
now taken to be there for iconSeenFor (a minute); one removed is looked
for, found gone and stored or fetched again once that has passed.

Run (mica unless named):
- go test -count=1 -timeout 45m ./internal/provider/ ./internal/gui/: ok
- go vet ./internal/provider/ with GOOS darwin, windows, linux: ok
- TestKeptIconNotLookedForEachAsk broken by hand (the seen check made
  never true): red, "the file was looked for within iconSeenFor and
  stored again"; green restored.
- Real account on mote (sandbox HOME, magpie web, 40 /api/providers
  under a 10s CPU profile): providersState 420ms -> 230ms of samples,
  pluginOwnIcon gone from the profile. mote was at load ~54, so the
  per-call wall time (11ms) moved within noise.

Not tried: the GUI suite (no GUI file changed).
2026-11-12 14:35:38 +08:00
yetone 5dd63727ce gui: a state sends each option once, its lists as indexes into them
After 647071f2b the real account's /api/state was still 346,210 bytes:
17 lists, 327KB, most of them each agent's 231-255-option catalog with a
few models of its own first, so no two were alike. The state now sends
each option once, in "options", and each list as the indexes of its
options ("optionLists"); api() in app.js looks each one up as it puts a
field's list back, a fastFor of "*" still given the agent's id.

shareOptions tells alike options apart by sorting pointers to them by
Value (slices.SortStableFunc on int32 indexes), not in a map, and each
list is a run of one []int32: a map sized for the options made
TestStateWriteGrowsNoBufferItsSize allocate 977KB for its 1.6MB state
(12,000 options unlike each other), the bar is half the state; now it
passes. writeStateJSON writes the indexes through one 512-byte buffer
and each option alone, as each agent is.

Run, at this tree on mote:
- go vet ./internal/gui; go test ./internal/gui: ok (TestCoreScriptBudget,
  TestStateWriteGrowsNoBufferItsSize, TestStateSendsEachOptionListOnce,
  which now also counts the 7 options its 4 lists name once each).
- state-option-lists.test.cjs: 16/16, Chromium and WebKit, 5 languages,
  1000px and 420px; crush's list now starts with one model of its own,
  an index past the shared catalog's. Broken by hand: without the
  options lookup in app.js, red (8 of 8 Chromium).
- Real account (sandbox HOME with its data), magpie-w19: GET /api/state
  159,767 bytes (689,949 before 57443ac5f, 346,210 at v0.1.3848),
  14,765 gzipped, 7-9ms a GET; ?last=1 159,779. Its agents, lists put
  back, are equal to w18's.

Not tried: the whole GUI suite; a real window drawing this state.
2026-11-12 14:24:46 +08:00
yetone a168d4dd96 gateway: a sub-agent's report delivered as a system message reaches the Claude bridge (#6277) (recih on X)
Claude Code delivers a sub-agent's report that arrives mid-turn as a
{role: "system"} message: "Another Claude session sent a message while
you were working: <agent-message from=...>report</agent-message>", beside
a <task-notification>. saidWithResults skips system text, and
withTaskNotices kept only the notification, so the bridged main agent was
told the report was delivered and never saw its 14k chars. withTaskNotices
now also hands over <agent-message> blocks from system/developer messages,
in order, labelled as another agent's output and not the user's. User-role
standalone reports already went through as said text, so no duplicate.
Siblings: the only other system filter is saidWithResults's (deliberate:
system text is never the user's); the workdir scan skips system on purpose.

Run: TestClaudeAgentMessageReportGoesWithTheResults (notification beside,
split across blocks, two agents) red on origin/main's code (3 of 3), green
after; go vet darwin/linux nogui/windows; full internal/gateway on mote ok;
gofmt clean.
Not tried: a real Claude Code with a real sub-agent, GUI tests (no GUI change).
2026-11-12 14:24:40 +08:00
yetone 9892f68fef site: a MothX docs page in en, zh and ja
/docs/mothx says how magpie sets up MothX (oschina/mothx, formerly
vibecoding): settings.json in $MOTHX_DIR, %APPDATA%\mothx on Windows or
~/.mothx; defaultProvider and defaultModel set to magpie's, and
providers.magpie with the gateway's /v1 on openai-chat, magpie's key,
thinkingFormat openai and one entry per model (reasoning, input, window,
reply cap, cost); headers or an httpProxy the user added kept, and a
thinkingFormat already there; defaultThinkingLevel and the levels
offered; why thinkingFormat openai (MothX otherwise guesses the vendor
from the id); MothX in a WSL distro; restarting, with the notice for a
running mothx or vibecoding; switching back, the file put back byte for
byte when it says the same as before. Each claim is from
internal/agent/mothx.go. Linked from each language's PenguinHarness page;
in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: MothX itself with magpie for this page; it names only what
magpie's source says.
2026-11-12 14:17:46 +08:00
yetone 4f38882c4c copilot: the window is the prompt Copilot takes, and Codex's entries say effective_context_window_percent (codealc on X)
Copilot's /models says capabilities.limits.max_prompt_tokens per account
(936000 for gemini-4-carbon); magpie dropped it and told agents models.dev's
1048576 for the id, so Codex sent prompts Copilot answered 400 to. The
window of a Copilot model is now that limit (models whose list says none keep
models.dev's); other vendors are unchanged, the field being read only in
copilotModels.

The model catalog magpie writes for Codex lacked
effective_context_window_percent, which every entry of Codex's own catalog
has (95); Codex 0.166 worked out no limit from such an entry and never
compacted. Magpie's entries now say 95, and a vendor-listed entry that
omitted it gets it.

Run: TestCopilotWindowIsThePromptItTakes, TestCodexCatalogSaysEffectivePercent
and the codexcat/provider tests via mote-run. Broken by hand: window set to 0,
and the percent left out; each new test goes red.
Not tried: Codex 0.166 itself against the catalog (Codex 0.165 is on this
machine; the live config was not touched).
2026-11-12 14:17:12 +08:00
yetone 28b8244d47 gateway: a Chat reply with only a usage frame is an empty reply, asked again (codealc on X)
Copilot's gemini-4-carbon now and then answers a Chat request 200 with
completion_tokens above 0, no content or tool delta and finish_reason null
(~855 bytes: the usage frame). thoughtOnly never saw it (no reasoning in
it), the Chat decoder gave no stop, and the Responses encoder closed it
with an empty response.completed, so Codex stopped without a word.

A Chat upstream's reply that said nothing and never gave a finish_reason now
takes the empty-reply path (#667): asked again in place, the error when it
stays empty. A reply with text and no finish_reason, and one ending with a
stop and no text, go as before.

Run: TestChatUsageOnlyReplyIsEmpty plus the gateway empty/length/thinking
tests via mote-run. Broken by hand: without the `voids && stop == ""`
condition the new test is red with the empty response.completed.
Fixture: role chunk, then a choices:[] chunk with usage, then [DONE].
Not tried: the real Copilot account (the empty reply is intermittent).
2026-11-12 14:17:12 +08:00
yetone b4b82e5857 agents: Codex's profile list drops a deleted provider's models (JNDliuliuM on X)
Codex wired by its profile alone (codex -p magpie) kept offering the models
of a provider that was deleted. The profile's model was one of that
provider's, so it no longer resolved as a magpie model, wired() was false,
and the profile's Sync returned before it wrote magpie-models.json again.
The old list stayed, new providers' models never reached it. The Sync now
writes the list again whenever the profile names magpie as provider and its
list, even when the model it was set to is gone. All-of-Codex scope already
did this (asProvider and ownCatalog), as did the models_cache.json staling.

Found by syncing a sandbox HOME in both scopes after a provider edit and a
provider delete: only profile scope plus delete left the old list.
TestCodexProfileListDropsADeletedProvider is red on the old code (listed
added/m2 and added/m3 after the delete) and green now.

Run on mote: internal/agent package, go vet darwin, linux nogui, windows.
Not tried: a real Codex CLI reading the list; the viaBase models_cache.json
path (covered by existing tests, not changed).
2026-11-12 14:14:36 +08:00
yetone 647071f2b9 gui: a state shares the option lists that differ only in their own agent's fastFor
9ed6a312b sent each fields' option list once, but the real account's
/api/state only went from 689,949 to 627,061 bytes: each agent's
catalog (231 options, ~51KB) marks ~34 of them fastFor its own id
("crush", "droid", …), so no two agents' lists were alike. shareOptions
now sends a fastFor naming the field's own agent as "*" before it
compares, and api() in app.js gives each agent its own copy of those
options with its id back, so a fast pick for one agent still marks that
agent's options only (setFast matches on fastFor).

setFast's three loops are one mark() over every list, the picked option
included, which pays for the expansion within the core script budget
(1,263,333, not raised).

Run, at this tree on mote:
- go vet ./internal/gui; go test ./internal/gui: ok (TestCoreScriptBudget
  ok).
- state-option-lists.test.cjs: 16/16 (Chromium and WebKit, en zh zh-TW
  ja de at 1000px, en zh at 420px), with a new check that codex's fast
  leaves crush's alone on a shared list.
- Broken by hand: without fastForSelf, TestStateSendsEachOptionListOnce
  is red (5 lists, want 4); without the "*" map in app.js the GUI test is
  red ("the kept state's lists put back").
- Real account (sandbox HOME with its data), magpie-w18: GET /api/state
  346,210 bytes (689,949 before 9ed6a312b, 627,061 after it), 30,390
  gzipped; ?last=1 346,222.
- fast-ultra.test.cjs and fast-pick are red with this app.js and with
  the one before 9ed6a312b alike: #6201 (an extra POST
  /api/update/using). With that one POST left out of their record (not
  committed), both pass 36/36 in Chromium and WebKit with this setFast.

Not tried: the whole GUI suite (mote over its cores); a real window with
this state. Lists of 231-255 options that differ in their first
entries are still sent whole (17 lists, 327KB); an option table is next.
2026-11-12 14:10:22 +08:00