60b10c69a7f68e87a08ce2909e4e6dd67ae4b672
8611
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
60b10c69a7 |
gui: Routing's live note gives way before its buttons in a narrow window (#6669)
Since Routing groups › (11-06) and Settings › ( |
||
|
|
fdfa9fc72a |
gui: a narrow window's gateway key row holds still under the pointer, so it can be dragged (#6268)
At 420px, hovering a key row brought in its four unset badges (Quotas, At once, Tier, Masking). Even shrunk, their padding and gaps took ~90px, which the masked key gave up, so the key's copy button slid under the pointer. A press meant to drag the row then landed on the button, which dragRows leaves alone. 10 reds in gateway-key-arrange at 420px, in both engines and every language. The flex-shrink fix for this held with three badges; key-redact ( |
||
|
|
a0993ed71d |
gateway keys: a key held to some models can be given a decision group (Kautism on Discord)
Kautism on Discord, after making a group of Clef and Jev models: "group
似乎不能在閘道金鑰上使用?我翻不到。" The key editor's model list comes from
GET /api/caller-keys/models, which is built from provider.Catalog, and
Catalog keeps decision groups out (no agent chats with one). The gateway
already serves a key that names one (serveDecisionGroup's groupGiven at
/v1/systemone), so a key held to some models could only reach a
decision group through All models.
Now the list puts the decision groups after the chat groups, marked
Group and Decides: only those the gateway serves (not hidden, not
switched off, found by FindGroup), and none twice.
Tests:
- TestCallerKeyModelsOfferDecisionGroups: a decision group is listed
after the chat group; a switched-off one is not. It fails with the
new block taken out by hand ("groups offered [group/chat], want the
chat group and the decision group").
- TestGatewayKeyNamingADecisionGroup: a key given only the decision
group reaches it at /v1/systemone, and a key given another model is
refused. This is a guard on gateway behaviour that is already there;
the gateway code is unchanged.
Run (worktree base
|
||
|
|
169446a1d7 |
gui: the Mac's menu bar item takes its clicks from the start, so the first click after a restart keeps the panel open (Refeccd on Discord)
Refeccd on Discord: "每次更新后,第一次在菜单栏点击唤起主界面会出现闪退现象
(实际程序未退出,只是隐藏了)" (macOS, automatic updates).
Cause:
|
||
|
|
17fe59ce35 |
library: a link in a project that leads out of it gets nothing of magpie's
A project is often a repository someone else wrote. A link in it was followed wherever it pointed: CLAUDE.md linked to ~/.zshrc had the user's project instructions (`make` in backticks included) appended to the shell's startup file, a .mcp.json linked out had the project's servers and their keys written where the link's author chose, and a .claude folder linked to a shared one got the skills and settings. Only the agents' user-wide instruction files were refused. Project.inside now checks every file magpie writes or removes in a project, links followed, before the write: instructions, MCP files, Codex's per-project off list, Claude Code's settings.local.json, subagents, the old .gitignore lines, and the folder a skill's link is placed in (the entry itself is magpie's link to the library). A link to nothing is refused too, since where a write through it lands can't be told first. A link that stays inside the project (AGENTS.md to docs/CLAUDE.md) still works. Each refusal is a problem on the project, and what magpie wrote before is kept on record. Run (fix worktree at origin/main |
||
|
|
00c6b89aca |
gui: Usage's chart metrics scroll in their own strip on a phone (#5869)
The Requests chart's #ledMetric tabs (Tokens, Cost, Calls, Speed,
Traffic) ran to 400px in German on a 375px phone and widened the Usage
page. .led-bar .segs now joins the segmented strips that already scroll
in their own width (regions, Connect's APIs, Plugins' kinds): max-width
100%, overflow-x auto, the same thin bar off a Mac and none on one, and
options that keep their width instead of squashing their words.
Run on mica at this tree (origin/main
|
||
|
|
223b900b48 |
library: a skill from GitHub or git syncs as its source, and what a sync leaves out is said (#5715)
JJasonsun (Discord #help, #5715): a skill over a sync's 64 MiB budget was left out of the server's file while Settings > Sync said the sync worked, so the other computer silently didn't have it. A library skill from GitHub or another git repository whose folder is still what was fetched (editState known and unedited, or Pending) now goes as its source, as a plugin does (plugin_carry.go): CarriedSkill gets Fetch, Hash and Commit, and the receiving computer fetches it itself after Put lets go of the library lock (fetchSkills, through updateSkills). Its files still go as far as the room the skills carried as files leave, so a magpie from before this, which ignores Fetch, writes the skill as it did. On the receiving side (fromSourceHere): same version is kept; one changed here is kept and, when the other computer has another version, said as a problem ("Update replaces them"); another version or a skill new here is fetched, unless the carried files are already the whole of it. A skill that can't be fetched stays Pending, shows "Not fetched yet" on its Library row, and is said as a problem until Update fetches it (library.Unsettled drops a settled one). A skill changed here, one from a folder, and one from a link holding a token (whose link must not be synced) go as their files, as before. What a sync still leaves out is said: state.LibraryLeft names skills and plugins whose files were too big (or that this computer never got, Skill.Missing, carried on as Left so a third computer isn't told it has them), state.LibraryProblems what the last sync bringing the library in couldn't put here. Status gives them as libraryLeft and libraryProblems, and Settings > Sync shows them in red under the status (askPreviewRows). Strings in every language. Run at this head (rebased on origin/main |
||
|
|
7b552eef31 | lessons: a guard that needs no browser runs on CI (#5425) | ||
|
|
549813abb5 |
gui tests: every short default gives navigation a minute, and CI runs the browser-free guards (#5425)
nav-timeout.test.cjs was red on main since #5425 was filed (11-06),
first for four files and now for 24: each new GUI test copied
page.setDefaultTimeout(5000) without a navigation timeout, and nothing
caught it because CI runs no GUI file. Each short default now sits
beside page.setDefaultNavigationTimeout(60000); clicks and waits keep
their 5s/6s/8s/30s bar. skygunner's 10275d5a6 did the same for the nine
files listed on 11-08, and was never taken; this covers those and the 15
added since.
The class: nav-timeout, i18n-keys and i18n-en-no-cjk read the sources
and need no browser, and LESSONS.md records each of them red on main
after a push that ran chosen GUI files. test.yml's Linux cli job, which
already sets up Node 22, now runs them, so the push that adds the next
offender goes red on CI.
Run (mica; mote was at load 26):
- node --test nav-timeout, i18n-keys, i18n-en-no-cjk at this tree on
origin/main
|
||
|
|
b2b3d488c1 |
settings: an SSH server as a saved proxy, and a failed proxy says why
@laiuuui on X (tweet 2122704105005314155) was told to put Gemini behind
a proxy in a supported region. Their VPSes give only SSH (address, port,
password or key), and every http:// proxy they added failed with Go's
words alone.
A saved proxy can now be an SSH server. Settings > Network > Add proxy
has Proxy | SSH; SSH asks for the server, the user and the password, and
Advanced (closed) holds a private key and the trusted host key. magpie
logs in itself with golang.org/x/crypto/ssh (no ssh command) and resolves
the @id to a SOCKS5 server of its own on loopback, which takes only its
own random login and carries each CONNECT as a direct-tcpip channel, as
ssh -D does: lazy login, keepalive@openssh.com every 20s, one re-login
when a channel finds the connection dead.
- Save logs in first: a refused login is said there and nothing is kept.
- The host key is trusted on first use, kept in authorized_keys form and
shown as its SHA256 fingerprint; another key is refused
(HostKeyChangedError, both fingerprints said) until Trust a new key.
- The key is a secret like the password: left out of backups and
syncs without keys, kept on a sync that has none.
- ssh:// typed as a plain address is refused: its login goes with a
saved proxy.
A failed proxy says why (netproxy.Why: an English template the page
translates in all five languages, Go's words after it): an SSH server
typed as http:// or socks5:// ("is an SSH server, not a proxy: add it as
SSH"), a refused login, keyboard-interactive refused (OpenSSH without
PAM, "unexpected message type 51"), nothing listening, not SSH, TLS on a
plain proxy, 407, timeouts, hangups, and a server that logs in but won't
forward (AllowTcpForwarding no, or macOS 27's sshd, which hangs up on
every forward, OpenSSH's own ssh -W too). A check the user asks for
reads the server's first bytes when Go's text can't tell: Go reads a
real OpenSSH banner ("SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20") as an
HTTP status line with a malformed code, and an SSH server's banner can
reach Go's transport before its request goes out
("readLoopPeekFailLocked", found red 1 of 20 on mica, then 40 of 40
green). Each save is tested at once.
app.js keeps one line (api() hands a proxy_why reply to proxies.js,
where proxyWhy now lives); both script budgets are raised by that line's
52/54 bytes, with the reason in core_budget_test.go.
Run (mica, at this head on origin/main
|
||
|
|
81c666e1c2 |
gateway: an advisor call Anthropic's server ran is a usage row of its own (#6977)
A Claude Code turn relayed on Messages with its advisor on has the advisor run at the vendor. The reply's top-level usage is the executor's alone; each advisor call is an advisor_message entry of usage.iterations, billed at the advisor model's rates (Anthropic's advisor tool page, "Usage and billing"). magpie read only the top level, so an Opus advisor beside a Sonnet executor was in no row and priced nowhere. aUsage reads iterations, whole and from a stream's message_delta (whose list is cumulative, so the latest stands for the reply). Each advisor call becomes its own row (advisorRows, written by appendAdvised at every row of a try that reached a provider, and on the native route): under the advisor's model by magpie's id (advisorKeyModel of the request's advisor tool), Served as the vendor names it, Kind "advisor" (named Advisor in Usage's filters, already translated), the request's route, agent, account and session, status 200, counted as its own request as magpie's own advisor calls already are. The executor's row is unchanged. Routing prices the calls too, before the request's own usage so the prompt is still read from the last entry. Iterations with no advisor entry (Copilot) leave Usage as it was. The fixture is Anthropic's documented example word for word; no real reply with an advisor call was captured. The core script budget is raised by 52, the Advisor entry in the generated purposes.js (the base had no room; 1 byte less is red). The kinds are read wherever Usage and Routing draw a row, so there is no page to move it to. Run at this commit's tree on |
||
|
|
b1f044fc1e |
library: a Claude plugin goes to another computer whole, its hooks naming that computer's folder (#6685)
A plugin installed from Library > Claude plugins didn't reach the other
computer by sync: the bundle carried its parts as plain items, with
${CLAUDE_PLUGIN_ROOT} already resolved to the first computer's
<library>/plugins/<name>, and neither the plugin record nor its folder.
Hooks there pointed at a path that doesn't exist, Windows' too.
Now Bundle.Plugins carries each plugin's record (name, version, source,
pick, agents, Off, parts taken out by hand) and never its parts:
- A GitHub or git link goes as its source. The receiving computer
installs it from there, as UpdatePlugin does, after the library's lock
is let go. Re-installing from the source was chosen because the files
stay the vendor's and an update keeps working there; a fetch that
fails keeps the plugin Pending (shown on its row, "Update tries again")
with a problem, and the next sync or Update tries again.
- A plugin from a local folder, or from a link holding a token (whose
link must not be synced), goes with its files on the skills' budget,
executables kept executable, and is installed from them.
- Either way the parts are read again there, so every hook, server and
skill names that computer's own plugin folder. A plugin the bundle no
longer has is removed with its folder; Off spreads.
- A bundle from an older magpie has no plugins list: this computer's
plugins keep their parts over the same-named items it carries.
- An empty list hashes as before, so computers without plugins don't
see a change; the preview names each plugin, its files as one digest.
- Sibling: a plugin installed from a marketplace under a name other
than its manifest's named the manifest's folder in its parts.
- The sync settings' text says Claude plugins go with the Library (en,
zh, zh-TW, ja, de); "Claude plugins" moved into the core i18n.js since
the core now says it.
Run at this head (54e682dc5's tree on
|
||
|
|
f1b0663f18 | lessons: a guard test reads what it guards from the code (#6030) | ||
|
|
0bad752415 |
claude-desktop: a session on a tier's pick the catalog leaves out for now stays on the pick, not on another session's model (#6748)
Claude Desktop names a Claude model with reasoning levels by magpie's own id for it (claudeLooking: magpie-<n>.anthropic.claude-opus-5-5), and aliased read <n> back from the catalog alone. When the model was out of the catalog for a while, the id stayed as asked, unserved took it for a model magpie doesn't serve, and desktopMoveTo's gone branch served it on desktopPicked: the model of the last tool turn of any Desktop session. Copilot's /models once answered without its three Claude models and the list was kept for an hour; three sessions on Copilot's Opus 5.5 were answered by another provider's model for 25 minutes, with Desktop still saying Opus (desktop-gone in the Routing rows). - aliased: after the catalog, the models picked for Desktop's tiers (DesktopTiers) are matched by <n> too, a later tier's number (desktopTierKey) by whichever tier. A pick so read back goes to its provider as asked. A routing group's id is skipped (#6719). - desktopTierTurn: an id of magpie's that still names no model but names a Claude model (aliasClaude) goes to the pick for that model's tier (desktop-tier), as Claude Code's own id of one does. - The routing reference states the rule. Ported from mdwsk88's reference commit 68f39e8ae (branch desktop-alias-tier-pick on mdwsk88/magpie, patch sha256[:16] a7b9dee0d26cdcbc, matching the issue). Reviewed line by line; code and tests taken as written, only the routing doc hunk re-placed onto current main. Thanks to mdwsk88 (dawei) for the report, the logs and the fix. Siblings checked: desktopPicked is read by desktopMoveTo (gone, title, aside branches) and desktopChosen's probe path (served picks only); aliased is reached through unprefixed and DesktopCatalogID (internal/agent's Desktop settings), which now also read a pick back. Left as they were, filed as #6983: an unresolved alias of a model that is no tier's pick (mythos-magpie-<n>, or a Claude alias whose tier has no pick) still goes to desktopPicked, and Claude Science's scienceTurn has the same fallback to sciencePicked. Run on mica, sandbox HOME with Go's caches pinned, at this head (rebased on |
||
|
|
4b8c5948e7 |
gui: old-webkit green again (#5919, #6030)
Both old-webkit reds had been on main for a week with no owner, and commit after commit cited them as "red on origin/main, filed". #5919: |
||
|
|
6c6d3bc842 |
gateway: Codex's web.run goes to a relay set to search by itself (YIXIE233 on X)
YIXIE233's GPT relay serves /v1/alpha/search itself, but Codex's web.run (<base>/alpha/search) only went upstream for ChatGPT accounts; for every API-key provider magpie ran its own searcher. The per-provider "Searches the web by itself" switch (search=yes, Advanced > Web search, default off) already sent Responses' web_search tool and Claude's WebSearch through as sent; now it covers web.run too. - relaySearchers resolves the model's provider, or a routing group's members in order (the leading candidate decides, as for the request). A provider qualifies when it has search on, is an API-key provider (not a ChatGPT account, not a plugin) and has a Responses base. - The search goes to that base's /alpha/search with the provider's key, Codex's headers, originator and the agent's User-Agent. - If the relay fails, magpie searches in its place and the output says "X's web search failed (why); magpie searched in its place." - Settings' "magpie searches for every model" still overrides it. - GUI help text, every language, names web_search and web.run; the CLI help, docs/reference.md and docs/subsystems/gateway-routing.md say so. Tests: TestCodexWebRunGoesToRelayThatSearches and TestCodexWebRunInGroupFollowsLeadingMember are red on the old code (magpie's searcher answered). TestResponsesWebSearchToolToRelayThatSearches guards the web_search pass-through. provider-search.test.cjs covers en, zh, zh-TW, ja, de in both engines and at 400px (no sideways scroll). Run (mica): gofmt clean; go vet, GOOS=linux and GOOS=windows vet ok. Full go test ./... -timeout 45m before the rebase: 102 packages ok, only internal/gui TestCoreScriptBudget red (app.js 22 bytes over); fixed by shortening the English help key (net -2 bytes), budget not raised. At 64c5e1e0a (on origin/main d4af0ca4f; then rebased over |
||
|
|
ae94571d70 |
library: a project's own instructions, in the file each agent reads
@VictorHong1022 on X asked to manage AGENTS.md per project beside a project's skills, so the shared instructions keep only general rules. A project in the Library now has instructions of its own (the Instructions tab, expand a project; `magpie library project instructions <dir>`). magpie writes them into the project file each picked agent reads there, by that agent's own name for it: Claude Code CLAUDE.md (or .claude/CLAUDE.md when that is the one there), Codex and pi their override first, Gemini GEMINI.md (or its context.fileName), Qwen QWEN.md, CodeBuddy CODEBUDDY.md, the rest AGENTS.md. magpie owns only a marked part (<!-- magpie:begin … --> to <!-- magpie:end -->): the user's own text around it is kept byte for byte, CRLF included, a hand edit of magpie's part stays until the project's text changes, a file magpie made is listed in the repo's .git/info/exclude and removed when emptied, and an agent's user-wide instructions file is refused. Worktrees of the project follow it. A first text goes to the agents the shared instructions are on for, else every agent here that reads a project file. Problems show as the project's "instructions" problem. Tested: - internal/library: 8 new tests (block kept around user text, CRLF, hand edit kept, made file excluded and removed, renamed files, global file refused, worktrees). Four broken by hand, each red. - internal/cli: TestLibraryProjectInstructionsCmd; red with the default agents dropped. - GUI: project-instructions.test.cjs, en and zh, chromium and webkit, 6 of 6. Red when Goose (no project file) was offered, and red when the defaults ignored the agents the instructions are on for. - Real use on mote: the built binary, sandbox HOME and project. add, text, agents; CLAUDE.md kept CRLF with the part appended; AGENTS.md and GEMINI.md made and excluded; the user-wide CLAUDE.md untouched; zed refused; an edited part survived `library sync`; `agents none` put CLAUDE.md back byte for byte, removed the made files and emptied the exclude block. - Full Go suite (go test ./... -timeout 45m) on mote: 103 packages ok, gofmt clean, go vet darwin, linux (nogui) and windows rc=0, at this change on origin/main |
||
|
|
28f27e07b7 |
editor: a provider's warm-up or check-in that is on opens its Advanced (ChrisYagao on X)
ChrisYagao on X asked where his warm-up went. Nothing was lost: warm-up
moved from Settings into each provider's editor (11-09), then into that
editor's folded Advanced (11-10), so a warm-up that was on vanished from
sight with no trace of where it went.
Fix: the editor's Advanced opens on its own while that provider's
warm-up (on reset or daily times) or daily check-in is on
(provPrefsOn), unless the reader opened or closed it by hand, the same
rule as Routing's Advanced. renderWarmAtOwn moves into the lazily
loaded autoresetown.js (warmAtOwnPaint), so app.js and the core script
budget each drop by 1,529 bytes. reader.cjs's openProvPrefs waits for
the modal's animations to end before measuring (warm-at-times WebKit
900px measured mid-animation, 0.66px overhang).
Old data: no setting changes and nothing migrates; a warm-up that was
on shows again the first time its editor opens.
What was run:
- warm-advanced.test.cjs (new): red 10/10 on the old app.js
("codex, warm up on reset: Advanced open"), green after; chromium and
webkit, en zh zh-TW ja de.
- At the pushed head (rebased on origin/main), on mica: warm-advanced,
warm-at-times, warm-at-own, warm-now, quota-warm, plugin-checkin,
editor-advanced-align, routing-advanced: 160 passed, 0 failed.
- 29 related GUI files (every openProvPrefs user, warm-*, quota-warm,
plugin-checkin, routing-advanced, editor-advanced-align,
codex-auto-reset*, reset-providers, search-mix, model-api-preset,
i18n-keys, segs-press-redraw, settings-groups) alone on mica: 603
passed, 31 failed; every red is red at origin/main
|
||
|
|
5bfa57e3d3 |
usage: check one model on one provider with a few fixed-answer calls, kept beside the other providers
skingstyle48487 on X runs more than ten relays and asked for something like the "pelican test" to spot one that waters a model down. In a follow-up (2122694296054972815) they said speed, failures and the model's name show whether a relay is fast and stable, not whether the model got weaker. They asked for small tests with known answers, the share of right answers and of right tool calls, and relays compared side by side. On Usage › Requests › Model speed › Providers, each row has a Check… that opens a dialog. Opening it sends nothing; only its Check makes the calls. POST /api/relay-check (gateway.CheckRelay) makes 6 small streamed Chat Completions calls through the gateway, pinned to provider/model as an agent would, three at a time: - write 1 to 40; - 1234 × 5678, 987 × 654 and 2468 × 1357; - weather in Paris and time in Tokyo, each call offering both tools, so the right one has to be picked. Each part says what it found, never a verdict on the provider: - whether the answer was the expected one, and what came back; - the model the reply named, when the ledger would call it another model (usage.Swapped, not SameSpelled or ListedAs); - the provider that answered, when the call was handed on; - how many input tokens the 118-character prompt was counted as; - first token, tok/s and the whole time. The dialog heads the parts with "Answers right: n of m" and "Right tool calls: n of m". The numbers come from the gateway's own usage records (a tap in appendUsage keyed on the request's context), not from each protocol's reply. The tally of each provider's last check is kept in the window's storage. The Providers table then shows Answers and Tool calls columns: sortable, amber when short of all, a dash for providers not checked, so relays are compared side by side. The dialog code is a lazily loaded root script (relaycheck.js), as app.js has no room left. Run, at this head: - mote: go test -timeout 45m ./internal/gateway ./internal/gui ./internal/cli ./internal/usage: ok (the full ./... suite passed at 41d88731c, before the fixed-answer calls; mote and mica were each running another session's GUI suite at this head); - gofmt -l, GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...: clean; - go test -run 'CheckRelay|ReadChatStream' -v ./internal/gateway (5 tests pass); - usage-model-speed.test.cjs, chromium and webkit, en, zh, zh-TW, ja and de at 400px: 12/12; - i18n-keys and old-webkit: their only reds are the three on origin/main, each filed (#6877 ", with an image", #5919 :has(), #6030 headerpresets.js); - TestCoreScriptBudget and the app.js budget: ok, not raised. Broken by hand: - taking tapUsage out of appendUsage turns TestCheckRelayAnsweredAsAsked and TestCheckRelaySaysWhatDiffers red; - dropping the tool-name check turns TestCheckRelayCountsEachAnswer red (get_weather for Tokyo read as right); - pressing Check as the dialog opens turns the GUI test red ("opening the dialog sends no call"). Not tried: - the whole GUI suite at this head (both machines busy with another session's suite); - a real relay (fakes only); - a context-window probe; - a comparison with the vendor's own count_tokens; - a periodic check (the check runs only on a press). |
||
|
|
2ace161020 |
usage: the model speed ranking by provider, with each provider's failed and swapped tries
skingstyle48487 on X runs more than ten relays and asked for a live view of each one's speed and model performance. The ranking's key is now model plus provider: each key counts its tries, the failed ones (failed or handed on) and the swapped ones (the reply named another model, Row.Swapped). The ledger sends them as provider_speeds; the model view merges them back as before. settledCountVersion goes to 7 so settled pages are counted again with the new fields. Run (mote): go test ./internal/usage ./internal/usageapi, and the full suite (see the last commit of this push). Broken by hand: dropping m.Swapped++ or m.Failed++ turns TestModelSpeedRankByProvider red. |
||
|
|
d4af0ca4f3 | LESSONS: a filed red cited by two commits and taken by none (#6877) | ||
|
|
db02200ce1 |
gui tests: i18n-keys leaves Go test files out of a plugin's words (#6877)
"a plugin's words are its own" read every .go file but dropped only whole-line comments. claude_image_budget_test.go ( |
||
|
|
fe41216b01 |
claude-desktop: Claude Code's WebSearch runs on the model picked for haiku (#6348)
In Claude Desktop's gateway mode, Claude Code's WebSearch call always went to the session's model (Opus here, 11-19s a search). Claude Code 2.1.321 sends it to its small (haiku-tier) model only when the remote flag tengu_plum_vx3 is on, and Desktop sets DISABLE_GROWTHBOOK=1 in gateway mode, so the flag falls back to off. WebFetch's page summaries already run on the haiku pick (#5534); WebSearch now does too. - desktopSearchCall knows the call by its shape only: tools is exactly one web_search_* server tool named web_search, and tool_choice is {"type":"tool","name":"web_search"}. The prompt is never read. - desktopMoveTo, for a request Claude Code sent in Desktop, puts it on DesktopTiers()["haiku"] when that pick is set, served and not already the model asked, recorded as desktop-search. It doesn't change the session's recorded model (desktopPicked). - A subagent's search taken by the haiku pick is Claude Code's helper, not the subagent's turn: Desktop's subagent model, effort and turn tag leave it (desktopSearchHelper; subagentTurnOf takes the agent, so terminal Claude Code is unchanged). - No haiku pick, or one magpie doesn't serve: nothing changes. - The Routing page says why (desktop-search, en/zh/zh-TW/ja/de), and gateway-routing.md has the rule. Ported from mdwsk88's f68197aa6 (mdwsk88/magpie desktop-websearch-haiku-tier), reviewed line by line. Changed in the port: the gateway-routing.md conflict was merged onto main's text (main's codex-suggestions kept), and the cheap pre-check is bodyHas on `"tool_choice"` and `web_search_` instead of bytes.Contains, since desktop.go no longer imports bytes on main (the patch didn't compile there) and every Desktop request from Claude Code takes this check. web_search_* is kept as a prefix, so a newer search tool version (web_search_20260209) is matched as the same call. Run on mote (go1.26.8). Whole packages last at base |
||
|
|
50c5a52dbd |
backup: a backup file carries the usage history, and a restore merges it (JasonLeeForOnly on Discord)
JasonLeeForOnly moved magpie to a new server with magpie backup / magpie
restore and lost every call's usage history: a backup file held the setup
only.
- backup.WithUsage puts usage.jsonl's whole lines (gzipped, usage.LogBackup)
and the quota history (gzipped) in Bundle.Usage. magpie backup and
Settings -> Sync -> Export add it unless --no-usage / the tick says no.
Collect never does, so sync, join and automatic backups are unchanged.
- Restore (Parts.Usage, on in All; magpie restore --no-usage and the Import
tick turn it off) merges: usage.MergeLog appends the lines the log here
doesn't have, compared byte for byte as a multiset, so restoring the same
file twice adds nothing and two equal calls both arrive. It reads most
of the log before the gateway's log lock, the rest under it, and appends
with O_APPEND in 4MB chunks, after a newline when the log ends in an
unfinished line. Quota points merge with provider.MergeQuotaHistory.
A file without usage (older magpie, or --no-usage) restores as before.
- Result.Usage is the calls added; the CLI and the Import form say it.
- Docs: sync-backup.md, reference.md, site sync pages (en, zh, ja) and the
search index/llms-full.txt rebuilt with node docs-index.mjs.
Not changed: where usage is also shared by sync, the old computer's calls
are in usage-others and, after a restore, in this log too: filed #6987.
Run on mote at this head (26f69e85e rebased on origin/main
|
||
|
|
659e8850a2 |
gateway: a routing group named for a model is listed by that id when the model's own row isn't (小八 on Discord)
v0.1.4377, Settings › Network and sharing › Model ids without the provider = Only: group/glm-5.2, group/glm-5.3, group/glm-5.3-flash, group/deepseek-v4.1-flash-1017 and group/sensenova-6.8-flash kept their prefix while other groups lost it ( |
||
|
|
4a1ac84421 |
usage: Qianfan's card counts its gift and bought credit packs beside the month (yuushabu_buyinn on X)
Baidu Qianfan's Token Plan Personal also holds credit packs, Baidu's
gifts (赠送积分包) among them, and the card read only the month's plan
quota. The card now reads the console's pack list too and shows:
- "Gift credits": the gift packs still live, credits used of their
total, and how many run out when (the soonest end with credits left);
- "Credit packs": the bought packs, the same way.
Each row shows only when the account has such packs. A pack list that
can't be read (refused, not JSON, a pack with no amount) is a "Credit
packs · Unknown" row, never 0 left. The month window goes on to credits
(Credits) while a usable pack holds some, since Baidu spends the month,
then the gift packs, then the bought ones. The pack rows are set aside
from routing. An account with no plan but live gift packs shows them as
its allowance, since Baidu spends gift packs without a plan; with no
plan and no packs (or none read) the card says there is no plan, as
before.
Endpoint: GET /api/qianfan/charge/tokenPlanPersonal/pack/list on
console.bce.baidu.com, with the cookie and headers the card already
sends for the resource list. Found in the console's public JS: the
qiankun "resource" micro-app (aip-static.cdn.bcebos.com/mb-static/
resource/), chunk index-5e21b2bb.js, which calls
send("charge/tokenPlanPersonal/pack/list", {}, {httpMethod: "GET"}) and
reads result.items: packType ("gift", "guoqing_lite", "guoqing_pro",
others bought), status ("active"), totalCredits, usedCredits,
remainingCredits, expiresAt, isUsable. The rules follow that page: a
gift pack counts while its expiresAt is ahead; bought packs while
active; guoqing packs are left out, as the page leaves them out.
No real account was used: no one here has a Baidu Cloud account with
a Token Plan or packs. The fixtures are built from the field names the
bundle reads, not a captured reply. String or number amounts are both
read.
Run at origin/main
|
||
|
|
3fbade47ab |
gateway: a found group gone with a provider still goes to its model (canlee886)
canlee886 on X (2122660479411855365): a Codex App thread saved on group/auto-gpt-6-1-sol failed every turn with 404 "magpie knows no model", followed by every id magpie has, after azure-fte2-sea's gpt-6.1-sol went away; other threads were fine, and switching the thread's model did not help. The user patched the thread over Codex's app-server RPC. Cause: a group magpie finds needs two providers serving the model (autoGroups). When one is removed, or its list no longer has the model, the group is gone. Reseat moves an agent's config off it, but a Codex thread keeps the model it was saved with and names it on every turn. provider.AutoStandIn sent a gone found group's id to its model only while found groups were off, or when a provider kept out of them took it away; any other way of losing the group was a hard 404, even with a provider still serving the very same model. Fix: - AutoStandInFor: with found groups on, a found group's id (group/auto-… or auto/<model>) that is no group now, and that the user neither changed nor removed (no providers.json record), goes to its model from a provider that serves it (the agent's own subscription first, then one not kept out, then the first). It is the same model, never another; a group the user removed stays a 404. - With no provider serving the model, the request is still 404, but unknownModel says the model is gone and to pick another for the conversation (Codex: the model menu under the message box), with the three nearest ids, not every id (provider.GoneAutoGroup). - Codex's compaction on the model a thread is leaving (model_downshift) already compacts locally when that model 404s ( |
||
|
|
05d46f42e5 |
gui: Claude's menu bar cards can show Anthropic's A\ mark (qingnianxiaozhe on X)
qingnianxiaozhe asked for Anthropic's A\ in the menu bar in place of
Claude's logo. Settings › Usage › Menu bar Claude logo (Mac only, shown
while logos are on and a ticked card is Claude's, under the magpie icon
row) picks Claude's logo
(the default, unchanged) or the A\.
- settings.TrayAnthropicMark, kept per computer through KeepOwn like the
other menu bar choices; settingsapi.Keys saves it; a change wakes the
menu bar (onTrayUsage).
- trayAnthropic swaps the icon of cells whose card logo is claude-color
or a plugin's claudecode-color (trayCell.Logo) for trayAnthropicMark,
an SVG drawn here (two paths, no other app's bytes), and marks it mono
so mpGlyph paints it in the bar's text colour. Menu bar logos off
wins.
- The row's code is trayClaudeRow in traywindows.js (lazy). app.js only
adds the key to prefsKeep; to stay in TestCoreScriptBudget without a
raise, renderTrayUsage's no-card branch moved into trayWindowsRow,
which now hides Windows' figure row itself when no card is ticked.
- en, zh, zh-TW, ja, de strings; docs/subsystems/gui-shell.md bullet.
Tests: TestTrayAnthropicMark (which cells change, input not mutated,
plain cells stay plain), TestTrayAnthropicMarkSVG,
TestTrayAnthropicMarkSaved (POST as the page does, saved and woken once
per change), TestTrayImageAnthropicMark (darwin: renders the real
AppKit image light and dark, the logo rect differs, the rest of the
image is identical), tray-anthropic-mark.test.cjs (five languages, 900
and 400px, Chromium and WebKit: row, two logos, default Claude, A\
posts true, another setting's save keeps it, back to false, no row with
no Claude card / logos off / no card / Win32, no page errors, no
sideways scroll). The GUI test waits for the redraw after a save rather
than a fixed time: a click on a control drawn before the save lands
sends the old value back (any setting, not new here).
Broken by hand: trayAnthropicMark taken out of prefsKeep turns the GUI
test red ("a save of another setting keeps the A\") in all languages;
taken out of settingsapi.Keys turns TestTrayAnthropicMarkSaved red.
Run:
- mica, at 2fa9295ed (this tree less the doc bullet): go test -timeout
45m -count=1 ./... : 103 ok, exit 0.
- mote, at this head's code: gofmt -l clean; go vet ./...;
GOOS=linux go vet -tags nogui ./...; GOOS=windows go vet ./... ok;
internal/settings, settingsapi, davsync ok; internal/gui -run
"Tray|CoreScript|Budget|EveryRoute" ok.
- mote GUI, Chromium and WebKit, the 20 files that touch the menu bar
rows, Settings search or prefs (tray-*, settings-search, side-effort,
searcher-pick, quota-pace, proto-menu-overflow, classify/image-timeout,
i18n-*): tray-bird first went red (its row must follow the logos row),
so the Claude row sits after the magpie icon row. side-effort is 5/5
red in both engines on origin/main
|
||
|
|
d54b7acf43 |
gateway: Claude Code's dashed advisor id goes upstream as the provider names it
Refeccd (Discord, v0.1.4366): Claude Code with Opus 5.5 as the model and
Fable 5.2 as the advisor, both on one provider; the advisor's turns came
from Opus and Routing showed no Fable request.
Claude Code 2.1.316 (real binary, sandbox HOME, a fake upstream) never
sends a request of its own for the advisor: it is the server tool
{"type":"advisor_20260301","model":"relay/claude-fable-5-2"} inside the
main request, with settings.json's advisorModel as written. magpie writes
a dotted Claude id dashed (ClaudeSpelled), and the gateway took the main
model back to the served id (validateModel) but not the advisor's. On a
provider listing claude-opus-5.5 and claude-fable-5.2 the request went
upstream as model claude-opus-5.5 with advisor claude-fable-5-2, a name
the relay doesn't know.
advisorID now takes the advisor's model to the served id as a request's
own model is (ClaudeUndashed, then unflat and CanonicalRef), and drops
[2m] beside [1m]. Every reader of it goes through it: advisorModel
(passthrough name), advisorKeyModel (key limits), advisorAsked
(advisedHere, advisedInBridge) and readAnthropic's Request.Advisor
(magpie-run advice).
Run (on mica):
- go test -count=1 -timeout 45m ./internal/gateway/: ok at 38babcb13
(this change on
|
||
|
|
a922e3864e |
provider: moving Antigravity onto agy goes through Antigravity's proxy (huiqiang6 on X)
huiqiang6 on X: in the Docker image, moving Antigravity's accounts onto "Antigravity (local agy CLI)" always fails at installing agy. Reproduced with ghcr.io/yetone/magpie:latest (v0.1.4377) on xiaomi-gpu's Docker, with the owner's real Antigravity account in plugin-auth.json: - plain network, amd64 and emulated arm64: the move works (26s, 39s); agy 1.5.10 installs into /config/data/magpie-agy-cli. - Google unreachable directly, reachable only through a squid proxy set on Antigravity alone (providers.json proxy, as a user in China sets it): the move fails in 7s, every time, with "installing Antigravity CLI failed (couldn't reach Antigravity's release server: Unable to connect…); install it yourself with `curl … | bash`". Cause: MoveToAgy ran agy's install and the accounts' import under agy-cli's proxy, which a new agy-cli doesn't have, so both went direct and never through the proxy Antigravity's requests used. Now MoveToAgy first carries Antigravity's proxy onto agy-cli (its provider proxy while agy-cli has no account and no proxy of its own; each moving account's own, or Antigravity's, as an account proxy where agy-cli would take another), then installs agy and imports through agy-cli's. A proxy the user set on agy-cli is kept. Run: - go test ./internal/provider -run Agy on mote: ok. The two new proxy tests are red with the carry and Via lines taken out (installed through "", imported through ""). - A linux/amd64 nogui build of this tree in the same blocked container (fresh volume, same account, same proxy): the move gives kumw95ya25@gmail.com "added" in 26s, agy 1.5.10 installed, providers.json has agy-cli's proxy, and a chat request to agy-cli/gemini-3.8-flash answers "OK", squid logging the CONNECTs. - gofmt -l; go vet GOOS=linux -tags nogui ./..., GOOS=windows ./... - Full suite: not run before the push. mote and mica were each running another session's suite; it runs after, one per machine, and a red gets its own issue. Not tried: native arm64 hardware with the proxy; the reporter's own config (the tweet has no screenshot, so their proxy setup is inferred); an agy-cli that already has accounts and no proxy (the move's import then goes through agy-cli's, direct; the moving accounts still keep their proxy afterwards). Moves that already failed simply work on retry; none half-moved anything. |
||
|
|
fefe3f658c |
library: DS Bot gets MCP servers, skills and instructions in its own DSH home (#5897)
sunset on Discord: DS Bot (ds-bot) can be given a magpie model, but the Library's MCP page offered no DS Bot. It had no target in targetOf and was listed "not looked at (#5897)" in noLibrary. DS Bot's desktop app runs its own DSH (0.2.2-rc.1 in DS Bot 0.3.8) with DSH_HOME at its data folder (agent.dsbotHome; app/src/main.mjs) and boots the profile ds-bot (app/src/profile.mjs) with dsh-base's bundles. Read from github.com/Fei2411/DS-Bot and the npm packages at 0.2.2-rc.1: - dsh-agent-instructions reads $DSH_HOME/AGENTS.md (then CLAUDE.md); - dsh-skill-filesystem reads $DSH_HOME/skills and ~/.agents/skills, and a project's .agents/skills; - dsh-mcp-client is in the app's installation (a dependency of @deepseek-ai/dsh in app/package-lock.json), so a patch list's insert row naming it loads, as in dsh; DS Bot's own bundle patch disables none of these. So ds-bot gets dsh's target on its own home: AGENTS.md, skills, and MCP rows in every profile's patch list (agent.DshPatchFiles, which globs profiles/*/cordis.patch.yml, profiles/ds-bot's included). It reads ~/.agents/skills too (readsShared) and .agents/skills in a project. #5624: when DSH_HOME names DS Bot's folder, the dsh agent's home is DS Bot's. The Library's dsh target now steps back there (agent.DshAppHome), so the two agents' rows are never written into one patch list under two names. This doesn't fix #5624's model wiring. Run (all at 3b47e8745 rebased on |
||
|
|
efcf8d9c0c |
routing: a key's row is named by its provider, the key after it (iamleehom on X)
iamleehom on X: "为什么路由中不显示供应商名称了?" Two OpenAI-compatible providers, each with unnamed keys, showed only "sk-4…ab10" and "sk-a…eb0c" on the Routing stage, with nothing saying which provider each belongs to. Cause: 83545a5d8's twin rule added the provider's name only when two providers' keys had the same name. A masked key always differs from every other one, so the rule never fired for unnamed keys, and a named key unique across providers lost its provider too. Change (plugins/routing/client.js, routing.css): - A key's stage row is headed by a new span.prov with its provider's name. The key's name follows in span.who, muted, and gives up room first (flex-shrink stays on .who). .who keeps the key's name, so every test and lookup that finds a row by it is unchanged. - The twin rule's sub-line is no longer needed for key rows; the plan name stays there. - The answered card says "Provider · key" (where()). - Rows inside a provider's fold are unchanged: the fold heading already names the provider once. Not changed, filed: the request list rows and the decision lines still name an unnamed key by its masked key alone (#6982). Tests: - routing-key-provider.test.cjs (new): the reporter's case, two providers with unnamed keys. Rows read [Relay East, sk-4…ab10] and [Relay West, sk-a…eb0c], the provider's name is not cut at 1100px, the card reads "Relay East · sk-4…ab10" from a live long-poll, and a fold's rows keep only the key under a heading naming the provider. Every language, both engines, 1100px and 440px. - routing-twin-keys.test.cjs: re-derived to [prov, who, sub]. Run: - Broken by hand: routing-key-provider at base 3f4372cc9's client.js on Windows, chromium: every non-fold subtest red (null .prov; the card read "sk-4…ab10"). On mica at the first design: 42 red, 20 (folds) green. - Screenshots (zh 1100px chromium, en 440px webkit, de 440px chromium) checked by eye: "Relay East sk-4…ab10" on each row, nothing overlaps. - Windows (xiaomi-gpu, win-run, Node 22, Playwright 1.62.0, Chromium + WebKit), at 90aa5bc23 (this change on |
||
|
|
3126b0bacd |
gateway: with model ids without the provider on, a routing group the user made is listed by its own id too (小八 on Discord)
"路由组的外显模型名可以选择去掉 group/ 这个前缀吗": with Settings › Network and sharing › Model ids without the provider on, /v1/models listed a user's routing group only as group/<id>, though the gateway already takes a request for its bare id (GroupFor). BareEntries skipped every group row. Now a group the user made adds a row by its own id (fast beside group/fast; under Only in group/fast's place, through OnlyBare as before), and GET /v1/models/fast and Ollama's lookup answer it (BareEntry). Only where the id is the group's alone: not when a provider serves a model by it (the model's bare id is listed, reaching the group as the gateway routes it), when it is listed already, when GroupFor of it reaches another group, for a group magpie found (its auto/<model> row is already listed under the model's bare id), or for a group a gateway key can't use. Agents: unchanged. magpie still writes group/<id> into an agent's config, as it writes provider/model under Only; the gateway takes either id, so turning the setting on or off rewrites nothing. The Settings help text says nothing that is now false, so i18n is unchanged. Run (mica, mica-run, mote over 18 cores): - go test -timeout 45m -count=1 ./internal/provider ./internal/gateway: ok (152s, 1059s) - GOOS=linux go vet -tags nogui ./...: ok; GOOS=windows go vet ./...: ok - gofmt -l on the changed Go files: nothing - After the rebase onto origin/main: TestBare in internal/gateway again. Broken by hand: with bare.go at its old version, TestBareIDsListUserGroups fails "on: [... glm-5.3 only-a only-b], want [...] and then fast once". With the found-group and already-reached checks taken out of groupBare / BareEntries, it fails listing "auto-glm-5-3". Not tried: a real client against a running magpie; the full ./... suite and the GUI suite (no GUI file changed); Windows and Linux runs beyond vet. |
||
|
|
8e1534f5f9 |
sessions: read LiveAgent's sessions (#6741)
Usage › Sessions and the Sessions page now list LiveAgent's sessions
with their title, time, model, tokens and cost, and show their
conversation.
- Where: K-brain keeps each session at
<root>/sessions/<project>/<id>/session.jsonl (older ones right under
sessions/). sessions/.runs and sessions/.deleted-history are skipped.
- Root: $LIVEAGENT_HOME, then $K_BRAIN_HOME, then
~/.liveagent/data-dir.json, then ~/.liveagent. The rule now lives in
sessions.LiveAgentDirIn, and agent.liveAgentDir calls it, so it has
one owner.
- Reading: K-brain rewrites the file whole, so it is parsed whole. The
first line is session_meta (id, title, cwd, running totals).
- Tokens:
- Each reply's own usage counts on the day it came back.
- What the totals (model_usage, else usage_in/usage_cached/usage_out)
hold beyond those replies, such as a compaction's call or a rewound
reply, counts on the last message's day, together with sub_usage.
- Cache reads and writes are taken out of prompt_tokens.
- Forks: a fork's copies of its source's messages (seq <= fork_seq) are
the source's, and count in neither the fork's messages nor its totals.
- Subagents: a subagent's own session (task-<parent>-<task>, task_id
set) is filed under its parent with its activity, but no tokens,
because its spend is the parent's sub_usage already.
- Not added:
- a Calls reader: the gateway's own record of LiveAgent's calls
carries no session id, so it would count them twice;
- resume and delete: LiveAgent has no resume command.
- Skills: SkillsManager read (skill://<name>/SKILL.md) and Read of a
skill path are counted.
Run (mote, mote-run, at
|
||
|
|
5622149331 |
gateway: a relayed Messages request whose tool exchange doesn't pair is mended (miwanzi on Discord)
Claude Desktop through magpie, several conversations at once: a conversation died with "Invalid request … 400 due to tool use concurrency issues", which Claude Code shows when the upstream answers 400 with "messages.N: `tool_use` ids were found without `tool_result` blocks immediately after" or "unexpected `tool_use_id` found in `tool_result` blocks", and every later turn carried the same history, so it stayed stuck. pairToolBlocks mended only a translated request (buildAnthropic); an Anthropic client's own body relayed to a Messages upstream went as it came. toolBlocksPaired (tool_blocks_paired.go) mends it in passthrough's Anthropic case (an API key, a relay, a plugin's fetch) and before count_tokens, by pairToolBlocks' rule: a call the next message doesn't answer gets the synthetic interrupted result (is_error), first in the user message after it or in one of its own; a result answering no call of the message before becomes the text it said; a second answer is dropped; a result after other content of its message goes first. It works on the raw bytes: a body whose exchange pairs comes back byte for byte (nothing decoded into maps, nothing marshalled), and a mended body keeps every message it didn't change, and every other member of one it did, as they came. A Claude subscription's turn goes through the bridge, which writes the history as text, so it was never refused for this and isn't touched. Cause: nothing found in magpie that makes such a history. Salted call ids (tool_use_ids.go) unsalt id and tool_use_id alike, and a stream cut mid-reply gets an error event, not a made-up block. A reply cut or failed after a tool_use block was told (an upstream drop or overload under parallel load, or the user stopping it while parallel calls run) leaves the client a call with no result; the mend is what un-sticks it. Tests (vendor's literal refusal texts through validateExchange): TestToolBlocksPairedLeavesAPairedBodyAsItCame (Claude Code body with cache_control, thinking, &, key order: same bytes), …AnswersACutCall, …OrphanResultBecomesText, …CallsWithNoUserTurnAfter, …SecondAnswerAndOrder, TestMessagesRelayMendsABrokenToolExchange (relay to a fake that refuses as Anthropic does: 200; a paired request reaches it with the client's bytes), TestCountTokensMendsABrokenToolExchange. Broken by hand: - the two call sites taken out: the relay and count_tokens tests red with "messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01B". - toolBlocksPaired decoding and re-marshalling every body: the byte tests (unit and relay) red. largeConversation's Anthropic fixture replaced the last call's answer with "go on", so its last call went unanswered, which Anthropic refuses; the mend changed it and TestUpstreamBodiesUnchanged/large-anthropic(-group) went red. Its user's words now follow the answer, as the Chat fixture's do since |
||
|
|
3be322fe4c |
library: a skill brought in from an agent goes back to it when removed (BeiWeiji on X)
BeiWeiji on X (v0.1.4322, zh): a skill imported from "Agent 中已有"
had no way back, only off or Remove, and removed it was gone from the
agents and from "Agent 中已有" too: Remove sent the folder that had been
moved into the library to magpie's backups and took the agents' links
and marked copies away.
ImportSkill now records where the skill was (Skill.Home, this
computer's own; Put keeps it for the same source, a sync never carries
it): the folder moved in (Home.Dir; handOver points it at the shared
~/.agents/skills place) and each agent's entry, a link with its own
text or a byte copy. RemoveSkill/RemoveSkills put it back (putBack):
the library's folder moves back to Home.Dir with what was changed in
the library, or the library's link goes; each agent's link is made
again as it was and each copy copied back. It is in "In your agents"
again and nothing goes to the backups. An entry the user replaced since
is left alone; when Home.Dir is taken the skill is removed as before,
its folder to the backups. This covers every agent with a skills folder
(the record is per agent entry, links and copies alike).
The page: SkillView.back lists those agents, and such a row has Put
back in the trash's place ("放回 {agents}"), whose sheet says where it
goes and sends skills/remove. Other skills keep the trash.
Old imports: a skill brought in before this has no Home record.
Removed, its folder goes to magpie's backups as before, where it can
be moved back by hand (the reporter's already-removed skill is there).
Run (at this change on
|
||
|
|
d67ccbd3c7 |
agent: a provider named magpie at another machine's address is not this magpie's Alma wiring
Alex on Discord: any provider named magpie in Alma, one pointing at a
magpie on a VPS included, was taken as this magpie's own, and the Agents
page said "Alma no longer goes through magpie, its config was changed".
almaMagpie now takes a provider by the name magpie only when its base URL
is on this machine (onAnotherMachine, as ZCode's check does). One at
another machine's address is the user's own provider and left alone; the
second match, an OpenAI-shaped provider at this gateway, is unchanged.
Run (mote), at base f1a4de736; rebased onto
|
||
|
|
4f94b8a829 |
grok: context_window is the model's window; Long conversations goes in auto_compact_threshold_percent (@xiancrong on X)
magpie wrote Long conversations' compaction threshold into each [model."magpie/..."] table's context_window. Grok Build reads context_window as the model's whole window and compacts at a percent of it: auto_compact_threshold_percent in [model.<id>], else [session]'s, else 85 (xai-org/grok-build 559751fd: xai-grok-shell/src/util/config/resolve/compaction.rs, DEFAULT_AUTO_COMPACT_THRESHOLD_PERCENT and resolve_auto_compact_threshold_percent; GROK_AUTO_COMPACT_THRESHOLD_PERCENT above all). So a 1M model held to 300K compacted at 255K and never had its real window. Now context_window is the catalog's whole window, and where magpie has it compact (grokCompactAt, the old grokWindow rule: the model's or provider's threshold, else settings.Working, none under Full window) goes in as auto_compact_threshold_percent of the window written, rounded down, at least 1 (grokPercent). None leaves Grok's own 85. - A table an older magpie wrote with the threshold as its window, on record in grok:<path>:windows, gets the whole window back. - A percent the user set in one of magpie's tables stays: what magpie gave is stashed in grok:<path>:percents, and one it has no record of giving is the user's (grokOwnPercent). A context_window set by hand still stays (grokOwnWindow). - A [session] auto_compact_threshold_percent is the user's for every model, so magpie writes no per-model one over it. Siblings: Codex (codexcat) already writes context_window and auto_compact_token_limit apart, and Claude Code has CLAUDE_CODE_MAX_CONTEXT_TOKENS beside CLAUDE_CODE_AUTO_COMPACT_WINDOW. Grok App (grokapp.go) writes the model's own window. Only Grok Build had the threshold in its window key. Run: - At cfca72eaf (this change on |
||
|
|
3edfc1be9b | LESSONS: a check and what it counts are one step; a reading counts what it had when taken (#6958) | ||
|
|
ff28dc6bd7 |
gateway: turns of sessions sent together are ahead of a near cap from their check, and of a reading their round isn't in (#6958)
TestCapHoldsUnderParallelSessions went red on ubuntu CI at 93% of a 90% cap (#6958). Five sessions' turns on one account each checked whether it was near its cap, and two gaps let a round of them past it: - A turn found not near was counted out on the account (lanes.out) only once its try took its lane. Turns checking in between saw none of the others. Now the check and that count are one step under nearCaps.check: a turn found not near is counted from its check (lanes.plan) until its lane counts it, or it leaves. The near path's wait for turns out (lanes.idle) waits for those too. The key's slot is taken before the check, as the near path takes it, so a counted turn never waits for a key slot that a near turn holds while it waits for the count to drop. - turnSpends took every turn come back as in the reading when the reading moved. A reply tells the usage as its turn begins, so the reading it brings lacks the round out then. At 20 turns come back, the reading said 82.5% while the account was at 90%. What a turn spent was halved (7.5 points over 10 turns, not 5), and the 5 turns since were never ahead of it. lanes.began now notes the turns come back as each try takes its lane, and ahead counts what that reading has (read). Turns come back since are ahead of it. nearChecked is a test hook after the check. TestCapHoldsWithAPauseAfterTheCheck runs the parallel test with a 15ms pause there, as a busy machine widens it. TestTurnSpendsAhead gains the case of a round out as the reading was told. Run at this change on |
||
|
|
f1a4de736e |
routing: a group's card says each member as one piece, parted by the list's comma (tmr11235 on X)
tmr11235 on X (v0.1.4334): a found group's card read "Kimi Code · K3.1
Pro · OpenCode Go · Kimi K3.1 Pro (关闭) · Devin · Kimi K3.1 Pro". The
same " · " parted a member's provider from its model and one member
from the next, so nobody could tell where a member ended.
Now each member is one span: its provider in the line's muted colour,
then its model in --fg-2 (both colours the page has), then what is said
after it (account, fast, free, off). Members are parted by the list's
own comma, t(", ") (、 in zh, zh-TW and ja), or " → " in order, never
" · ". Narrow (body.web), a member moves to the next line whole; before,
"(off)" could sit on a line of its own.
Siblings: memberLabel, the one text form, is built from the same parts
(memberParts). The group-picking card (the row drawn while selecting
groups to remove) uses the same memberLine. A nested group's tooltip in
the editor joined with " · " too and now uses memberJoin. The rule
tooltip already joins with ", ". The CLI and TUI list member ids
(provider/model), where "/" already parts provider from model; left as
they are. No new string, no new colour.
group-member-free.test.cjs read the members by splitting on " · ";
it now reads each .mbr.
Red on the old client.js: group-member-line.test.cjs (AssertionErrors:
the members are one text node parted by " · "). Red without the
body.web .mbr rule: WebKit at 420px, "(off)" alone on a line.
Run at f8787be1f, these two commits on origin/main
|
||
|
|
f8cd4723cc |
groups: a model its vendor lists without the maker's name joins its found group (tmr11235 on X)
tmr11235 on X (v0.1.4334): the found group auto/kimi-k3.1-pro had OpenCode Go's and Devin's kimi-k3.1-pro but not Kimi Code's, which they had to add by hand. Kimi Code lists the model as k3.1-pro (and K3 as k3), so SameModel merged it by k3-1-pro, a group of its own. - catalog.Unprefixed: the model a provider's id is when its vendor left the maker's name off, by what the provider's own models.dev catalogs say of that very id. models.dev gives Kimi Code's k3.1-pro the canonical_model_id moonshotai/kimi-k3.1-pro. The canonical alone never merges: it gives k3.1-pro-highspeed kimi-k3.1-pro and k3-256k kimi-k3, other models. The id must be the canonical's with a maker's name (letters) taken off the front, or go on past it to a model models.dev knows by that name before the whole id (k3.1-pro-highspeed is kimi-k3.1-pro-highspeed; k3-256k stays its own). No K3.1 or K3 takes K3.1 Pro. - provider.mergeKeyIn reads it after the user's same-as and the edition twins, so autoGroups, AutoGroupOf (group_share, reseat, dsh compact), offSpreadIn and the Providers editor's Same-as placeholder (MergeName) all merge alike; spelledIn takes the unprefixed spelling, so Kimi Code with Kimi Code China alone is auto/kimi-k3.1-pro. - Old data: such a model's old group id (auto-k3-1-pro, from Kimi Code plus Kimi Code China) is the found group's Former, so an agent set to auto/k3.1-pro is still served by it. Who else names models this way, from the real models.dev cache: Kimi Code's two plans (k3, k3.1-pro, k3.1-pro-highspeed), MiniMax models at relays (ofox minimax/m2-her, cloudflare-ai-gateway minimax/m3.1-flash), vercel's sakana/namazu. A canonical that is a rename rather than a dropped prefix (kimi-for-coding-highspeed, canonical kimi-k2.7-code-highspeed) is not merged; that would need the canonical to be trusted alone, which it can't be (highspeed above). Tests, red on the old code (Unprefixed's line taken out of mergeKeyIn: the Kimi Code members missing from all three groups and the relay's k3.1-pro grouped with Kimi Code's; the spelledIn line out: the pair listed as group/auto-kimi-k3-1-pro; the Former line out: auto/k3.1-pro and group/auto-k3-1-pro unserved): TestUnprefixedAs, TestFoundGroupTakesAModelListedWithoutItsMaker, TestFoundGroupOfUnprefixedIDsAloneIsTheModels, TestFoundGroupTakesKimiCodesPreset (both presets). Not changed: ownEntry still matches on sameModel. No agent's own subscription (Claude, Codex, Copilot, ChatGPT API, Gemini, Antigravity) lists a model without its maker, so there is nothing for it to join. Run at f8787be1f, these two commits on origin/main |
||
|
|
49e29de7ba |
gateway: Gemini TTS models on Vertex AI and Google Gemini speak on /v1/audio/speech (Pedram on Discord)
Pedram (Discord #help, 11-14) added gemini-*-tts models to a Vertex AI provider by hand: listed, but every speech call failed. magpie sent the OpenAI body to <base>/audio/speech: Vertex's …/endpoints/openapi/audio/speech (404; express mode has no OpenAI base at all, a 400), and AI Studio's …/v1beta/openai/audio/speech (404). Google serves Gemini's speech on generateContent alone. serveRetrieval now asks a retrieval for a vendor shape first (nativeRetrieval). A speech request for a Gemini TTS model (ServesOf speech, "gemini" in the id) on Vertex AI (not a partner or Claude model), on AI Studio (its Gemini API beside the OpenAI one, as drawGemini asks), or on a keys provider with only a Gemini API, goes to the model's :generateContent, signed for the Gemini API (x-goog-api-key, or the project's Google token on Vertex) - signing it as Chat sent the key as a Bearer, which Gemini refuses: - text: "instructions: input" (Gemini takes style in the prompt); speed has no Gemini field and is left out; - responseModalities ["AUDIO"], prebuiltVoiceConfig.voiceName: a Gemini voice by its name in any case (Puck, Charon…), an OpenAI voice by the nearest Gemini one (alloy Kore, coral Sulafat, nova Zephyr, onyx Algenib, shimmer Achernar…), anything else Kore; - the answer's 24 kHz 16-bit PCM is given back as a WAV (audio/wav) by default and for wav, raw for pcm (audio/pcm). mp3, opus, aac and flac are answered as a WAV too, with Content-Type audio/wav: magpie has no encoder, OpenAI clients ask mp3 by default so a 400 would fail them all, and players read a WAV by its header. Any other format, an empty input and stream_format sse are a 400 before anything is sent; - an answer with no audio is a 502 naming the finish/block reason and any text Gemini said instead. Masking, routing, key and account holds, side records and the usage row (operation speech, Gemini's promptTokenCount/candidatesTokenCount) are serveRetrieval's own, as for every speech call. A relay with an OpenAI-style API of its own, and plugins, are asked as before. pipeline_check's silentWAV now uses the shared pcmWAV. The Settings Quick check ( |
||
|
|
6c31af7ad9 |
usage: a Fast call is priced at Fast's price, not the standard one (Archivemylife on X)
Every service tier was priced at standard, so a Fast (priority) call was billed at half its price, and a subscription's API-equivalent value was half too. Sources: - OpenAI, developers.openai.com/api/docs/pricing: gpt-6.1-sol Fast is $4 / $20 / $0.20 cached (2x standard $2 / $10 / $0.10); Ultrafast 6x, Flex 0.5x. "Priority processing was renamed Fast mode on July 30, 2026." - Anthropic, platform.claude.com/docs/en/about-claude/pricing: Claude Opus 5.5 fast mode $8 / $40 (2x), "across the full context window". - models.dev's experimental.modes in magpie's catalog carry the same prices: OpenAI's keyed by provider.body.service_tier, Anthropic's by speed "fast". catalog.TierPrice reads those modes, only where the model's base price is the vendor's own (a relay's or a custom price is left alone). The Ledger's Pricer and the window's apiPricer both price by the billed tier: TierServed when the vendor says (Codex's backend always says auto/default, so servedTierAt keeps it "" and TierSent is used), otherwise TierSent. The tier ask is noted so a catalog change re-keys the request index, and settledCountVersion goes to 6 so stored settled costs are counted again. Run on mica. The full run was at this change on f9492fd8e; it was then rebased onto |
||
|
|
52d527f7b2 |
gateway: a Codex turn that reasons after its preamble tells its speed (Archivemylife on X)
A Codex turn often goes: a one-line preamble, then reasoning (summary or hidden), then a tool call. firstToken.see stopped looking for reasoning once the first text had come, so such a turn was timed from the preamble and its window held all of the thinking. The output then read as a burst (flow*4 < window) and Usage showed "—" for its speed; reasoning_hidden was missed for it too. Whether a turn shows a speed depended on its shape, hence "sometimes there, sometimes not". Fast (priority) makes the burst rule trip more often, but is not the cause. Now reasoning seen after text marks the turn "again": the next content restarts the text clock there, and hidden reasoning is noted. Both SSE and WS reach the same see(). Fixture: testdata/codex-preamble-reasoning-tool.json is a real capture (Codex gpt-6.1-sol, service_tier priority, effort high, through /v1/responses in a sandbox HOME), encrypted_content cut short. Run on mica. The full run was at this change on f9492fd8e; it was then rebased onto |
||
|
|
b1d5912def |
gateway: a Gemini image model listed as models/{id} is drawn at models/{id}, and a Lite one is sent no 2K
Dani Ariyanto on Discord: Nano Banana 2.1 on Google AI Studio always
answered 404 "models/nano-banana-2.1 is not found". AI Studio's
OpenAI-compatible /models (the Google Gemini preset's list) names every
model models/{id}, so the provider's id is models/gemini-nano-banana-2.1
(google/models/gemini-nano-banana-2.1 at the gateway, the model
Automatic image generation picked for them). Chat already dropped the
prefix (GeminiPath), but drawGemini put the id after its own /models/,
and asked /v1beta/models/models/gemini-nano-banana-2.1:generateContent.
GeminiModelPath now drops a leading models/ itself, so every path built
from it agrees: chat (GeminiPath), image generation (drawGemini), a
plugin's Code Assist path and Vertex's. The listed ids are left as they
are: renaming them would orphan every pick saved as google/models/... .
The reporter also saw gemini-3.1-flash-lite-image (Nano Banana 2 Lite)
refuse size 1024x1536 with 400 "Image size 2K is not supported for this
model". takesImageSize now says which models may be asked an imageSize
past 1K: not Gemini 2.x (as before) and not a Gemini / Nano Banana Lite,
read without models/ or a relay's google/. imageConfigOf (Gemini API
and Code Assist draws) and openRouterSize (OpenRouter's Image API
resolution) both ask it; such a model gets the aspect ratio alone and
draws at its 1K, as it did with no size asked.
Run at this change on
|
||
|
|
6abea5f8e8 |
agent: Antigravity's app on Windows is found by its installer's registration (JJasonsun on Discord)
On Windows magpie's Agents page showed agy but not Antigravity's desktop
app, which macOS finds right after install. desktopApps["antigravity"]
knew only the macOS bundle, so on Windows the app was found only by
~/.gemini/antigravity/agyhub_summaries_proto.pb, which a fresh install
hasn't written (the Windows box's real 2.30.0 install has no
~/.gemini/antigravity at all).
Google's Antigravity-x64.exe (2.32.1, antigravity.google/download) is
electron-builder's per-user NSIS installer (app-64.7z, SpiderBanner,
package name antigravity). The real 2.30.0 install on xiaomi-gpu is
%LOCALAPPDATA%\Programs\antigravity\Antigravity.exe, registered under
HKCU\Software\121a0be4-63bd-531e-acf8-fc3924c7e984 (InstallLocation) and
its Uninstall entry (DisplayIcon ...\Antigravity.exe,0, DisplayVersion
2.30.0, no InstallLocation). The guid is the UUID v5 of
com.google.antigravity in electron-builder's namespace, as dsh's is. The
entry now has win and guid, so AppVersion reads the registered version
(the 2.15 gate still holds) and HasApp finds the default folder too.
Linux ships only a tarball to unpack anywhere, with no desktop entry of
its own, so Linux keeps the backend-file rule.
Run:
- Windows (xiaomi-gpu, real HKCU and 2.30.0 install, sandbox
USERPROFILE/HOME/APPDATA/LOCALAPPDATA, PATH without agy): `magpie ls`
from origin/main's desktopapp.go lists no Antigravity; from this tree
it lists Antigravity.
- win-run go test -count=1 -timeout 45m ./internal/agent: every
TestAntigravity* and the new test pass; 36 reds, 35 of them listed
in #6068 (Windows CI only compiles tests), and
TestEveryFieldLabelHasTUIZh (Hermes profile labels from outside the
test home), filed as #6972. None touch desktop apps' detection.
- mote: go test -count=1 ./internal/agent ok; go vet ./...,
GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... ok;
gofmt -l clean.
Broken by hand: origin/main's desktopapp.go with the new test ->
TestAntigravityWindowsAppRegistered red ("guid \"\""; with that check
skipped, "AppVersion \"\"").
Not tried: the gateway wiring again on Windows in this change (
|
||
|
|
f9492fd8ed |
routing: a model offered at a window (claude-haiku-5-5@1m) joins its model's found group (Will on Discord)
Will (0.1.4356, macOS, Cursor plugin) ticked claude-haiku-5-5@1m and
claude-fable-5-2@1m in Cursor: served, but never in auto/claude-haiku-5-5.
Cause: found groups merge by catalog.SameModel, which keeps everything
after an "@" except a snapshot date, so every sized id the Cursor plugin
lists (it lists Claude only as <model>@<size>) and grok's grok-4.7@500k
formed a key of its own and never met the unsized model at another
provider.
mergeKey now goes through mergeName = sameModel(windowless(id)):
windowless drops a window after "@" by the same patterns pricing already
reads as "the same model at that window" (modelWindow @<n>k|m, and Grok's
@<n>). It is the same model at the same price per token, and a group's
members already differ in window by provider, so it joins rather than
needing Same as. One member per provider still: its unsized model when it
lists one (grok-4.7 over grok-4.7@500k), else the first size it lists.
spelledIn lists the group by the windowless id; MergeName (the editor's
Same as placeholder) shows it. A Vertex @20260801 stays a snapshot date,
any other "@" (model@cf) stays as it is. catalog.SameModel is unchanged,
so models.dev lookups by spelling don't lend a 1M id the base's specs.
Run (mote, mote-run): go test -timeout 45m -count=1 ./internal/provider/...
./internal/catalog/... ./internal/gui/ ./internal/agent/...
./internal/gateway/... at 9d8d9c544 (same tree): all ok (gateway 1179s).
After rebase on
|
||
|
|
a75a1fffcb |
provider: agy's Orchestrator (Argon), gemini-pro-orchestrator-g1-pro, is priced as Gemini 4 Argon (mu33410 on X)
mu33410 on X: agy's Orchestrator model showed no cost. |
||
|
|
738ede4a70 |
agents: Speed beside Model and Effort, with what decides it (Tengs999 on X)
An agent whose model has a fast mode now shows Speed next to Model and
Effort: in the window's Details and in the tray panel's opened row. It
reads Usual, Fast (one bolt) or Ultrafast (two), and its menu (the app's
openProtoMenu, never a native select) offers Default, Fast and, where the
model has it, Ultrafast. It sets the very pick the model's bolt in the
picker sets: POST /api/agent-fast {for, ref, fast, ultra}; no new state.
A refused post puts the old pick back.
What decides the speed is said as the gateway decides it (speedNow): the
agent's own pick, else the model's own tier (ModelTiers) -> "Fast · model
setting", else for Codex its service tier in Settings -> "Fast · Codex
setting", or "As Codex asks" when that tier is unset. The tooltip says
it in a sentence, and Default's note in the menu says what Default gives.
Words in en, zh, zh-TW, ja and de.
speedNow and speedField live in agentspeed.js, imported when such a row
draws, and before a fast model's Details first slides open so it measures
the line. What is left in app.js (two helpers and three call sites) is
499 bytes; both script budgets go up by that, with the reason written.
Run (mote/mica, at this head):
- internal/gui/tests/agent-speed.test.cjs: Chromium and WebKit, en zh
zh-TW ja de, window 1100px and panel 440px, all green. Broken by hand:
dropping the model-tier line in speedNow turns it red ("Fast · model
setting" expected, "Usual" actual); the panel's lazy line not taking a
.field's place was found by it (0 Speed fields) and fixed.
- go test ./internal/gui/: ok (TestCoreScriptBudget included). gofmt -l
clean.
- GUI files that reach the agent rows and the guards (agent-menu-label,
fast-pick, fast-ultra, desktop-tiers, i18n-keys, kimi-subagent-pool and
more) at this change and at origin/main
|