ac4af582301a4e8a29245dbba767eba31334ddf9
7089
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
844c355059 |
dsh: the model shown is the start of the profile in use, and the round's log says what it wrote (#5222)
#5222: with DeepSeek Harness Desktop and four profiles, the desktop
profile started on hy4free while web, headless and open-design started
on deepseek-v4.1-flash, and magpie's log said "wrote dsh's route again"
every half minute or so. Read against dsh 0.2.1-rc.2's own source and
reproduced in a sandbox HOME with dsh's real save (saveSelection through
ConfigEditor.edit and its yaml 2.9.1 library):
- dsh saves a model picked in it into the profile in use alone. The
profiles drifting apart is dsh's design, and each start is the user's
own: magpie copies it nowhere.
- magpie never wrote over that pick. After dsh's save the next round
wrote once, moving magpie's web search entry to follow the new start,
and then wrote nothing. The log called that "wrote dsh's route again",
which read as magpie rewriting agent-default-model.
- magpie read the start from the web profile alone, so with the desktop
app in use the Agents page showed a model its sessions don't start on,
and picking what it showed changed nothing there.
- A session dsh already has keeps the model of its last request until a
model is picked in it (selectionFor in dsh-api-session-controller), as
noticeDsh1 says. The reporter's 429s were OpenCode Zen Free's own free
limit, reached by a session still on it; the gateway didn't change the
model.
Now the model and effort fields read the desktop profile when DeepSeek
Harness Desktop is installed (dshLead), else web's as before, and effort
levels are checked against that model. The round logs "dsh's web search
in <file> follows the model it starts on now" when that entry is all it
moved; "wrote dsh's route again" is kept for the route itself.
Run (mote, on origin/main 7dd2434d3; rebased onto
|
||
|
|
461f9b1ff9 |
providers: a model chip's right-click turns its image input on or off (archsiono on X)
archsiono on X: "Magpie 给模型开图片输入的开关藏在「名称与推理档位」里,谁能找到 😅 建议在模型右键提供配置". The only place to tell agents a model sees images was the Accepts images tick inside Names, prices & levels. A model chip's right-click menu in the provider editor now has Turn on image input / Turn off image input (开启/关闭图片输入, zh-TW, ja, de too), under Copy model ID, for every model but a decision model. It stages the same modelPrefs images value the tick stages: the tick follows, the footer says "{model} accepts images once saved", and the Save sends it. Nothing is saved, picked or scrolled by the item. The core scripts were already 105 bytes over TestCoreScriptBudget on origin/main |
||
|
|
78128b5101 |
provider: a plugin's thinking model listed as, or the same as, another takes that model's levels (axelburks)
axelburks on Discord: a plugin's model that thinks and declares no
variants, set the same as and listed as claude-opus-5.5, took Claude Opus
5.5's price but showed its reasoning levels unknown, none ticked.
Cause: pluginCatalog borrowed levels for the plugin's own model id
(borrowedEfforts(m.ID)), which no catalog knows, so it got none; the
rename to the id the user lists it by (localIDs.list) then kept that
empty list. The price is looked up by the listed/same-as id, which is why
only the levels were missing.
Fix: a model whose levels were borrowed (catalog.Model.EffortsBorrowed,
set only in pluginCatalog's borrow) borrows them again for the id it is
listed by, which also follows the user's same-as. Levels the plugin's
own variants give stay first, and the levels the user kept narrow the
borrowed ones as before (effortsKept).
Test: TestPluginModelListedAsBorrowsLevels (listed as and same as one
id, listed by a name of the user's own, a model with variants of its
own, the price, and kept levels narrowing them).
Red on the old code: with the localid.go hunk reverted it fails with
"claude-opus-5.5 listed with levels [] ... want [low medium high xhigh
max]", the same for the gateway's p.Efforts and for my-opus.
Broken by hand: dropping the EffortsBorrowed set in plugins.go turns it
red (4 "want [low" errors). TestPluginThinkingModelBorrowsEfforts and
TestClinePluginBorrowsEfforts stay green.
Run on mote at this tree (on
|
||
|
|
7dd2434d31 |
remote quotas: a key with Quotas on but told no card shows why too (yi_time)
|
||
|
|
0ebe6c72c9 |
providers: each account row in the editor has its own Check in now, when the check-in reaches it and it isn't in today (xwoffice_91592 on Discord)
xwoffice_91592 asked for 立即签到 on each account in the provider editor
sheet (Trae CN, a plugin's subscription, one row per account with its
Credits line). The editor's rows read GET /api/login/usage, which carried
no check-in. It now passes those cards through provider.LoginCheckins,
which marks them as the Usage page's cards are (WithCheckins: checkins,
checkinBy, checkin, checkinOff) and adds checkinKey, the account's key
in its vendor's check-in (markCheckins sets it).
The row's button is Settings' Check in now for one account (xiaowu_95660),
not a fork. ciAcctFill in checkinnow.js presses ciNowSend with
{key, user} and checkinBy, so the same POST /api/usage/checkin-account,
the same status-line success and failure, then the row's usage is read
again. When to show it is checkinDue, taken out of checkinRow so the
Usage card's press and the row decide alike: the check-in reaches it, it
isn't off, and it isn't in today (a failed day, an "again" answer, or a
Qoder campaign not open yet still count as due). It sits at the end of
the account's usage line, small (.ci-acct), and wraps whole there rather
than being cut. app.js is 51 bytes smaller (comments cut); checkinnow.js
is lazy and not in the core.
Run (mote, worktree at origin/main
|
||
|
|
ce21ea8566 |
usage, routing: counts are said short (K/M, 万/亿), the exact number on hover (skyhuang1994)
skyhuang1994 on Discord: long token and request counts on Usage and
Routing are hard to read at a glance. They now go through fmtN (K/M/B,
in Chinese 万/亿), with the exact grouped number (ledNum) as the title,
so hovering shows it. A count that fmtN already writes in full gets no
title.
- Usage (plugins/usage/page.js): the Requests table's input, output and
cache cells (output keeps its reasoning line, cache write its TTLs
under the exact number), the Requests block, retried, the sources
tile and the ledger's sum line. sameRead moves here from app.js,
beside loadSessions, its only reader.
- app.js: the Tokens and Requests blocks (blk takes a title), the
ledger's call count, the rank's values and "{n} requests".
- Routing (plugins/routing/client.js): the day menu's note, the "more
days" name, the day rows and the stats.
Core scripts: 22 bytes smaller than their base (1533979 at this head;
TestCoreScriptBudget stays red on #5139 as on main, not worse).
Tests: usage-compact-counts.test.cjs is new (Usage and Routing, every
language, chromium and webkit, 420 and 1100px). panel-usage's rank
value expects "900K" with title "900,000"; ledger-cache-unknown's
counted cells expect fmtN text with ledNum as the title.
Run (mote-run):
- at ded9e4a62 (on
|
||
|
|
c03dee7e3e |
agent: LiveAgent, magpie's models in its model picker (xiaoxiaofei. on Discord)
xiaoxiaofei. asked for LiveAgent (Stack-Cairn/LiveAgent, v2). LiveAgent 2 is a Tauri app that runs its models through K-brain, a Go backend it starts as `k-brain backend -data-dir <root>`; every provider lives in <root>/config.json (JSONC, Pi's provider shape). Root: $LIVEAGENT_HOME, else $K_BRAIN_HOME, else the folder ~/.liveagent/data-dir.json points to, else ~/.liveagent, on every OS (LiveAgent's data_home.rs and kbrain_backend.rs, K-brain's internal/config and internal/storage). Connect adds providers.magpie: type claude_code + api anthropic-messages (what LiveAgent's own settings write for an Anthropic-compatible provider), baseUrl the gateway root (K-brain appends /v1 and posts /messages with X-Api-Key), the key naming LiveAgent, activeModels null, modelOrder in magpie's order, models sorted by id with display name, window, output limit and input [text, image]. K-brain decodes with unknown fields refused, so only its fields are written. A default or compact model still K-brain's endpoint-less demo model1 becomes magpie's first; the user's own pick stays. Through a sync the user's name, the models they turned off, their order, K-brain's metadata and a model's own displayName stay; a new model is on and last; nothing to change writes nothing. A file K-brain wouldn't read as providers (not an object, providers not an object, top-level models, a bare provider) is left alone. Disconnect takes the entry out, puts picks back to K-brain's default, gives a file left with no provider K-brain's demo back (its CLI restores config.json.bak, which could hold magpie's, from a file with none), and removes a file holding only what magpie made. LiveAgent's backend holds the settings and writes them whole on any change, so a change is refused while liveagent or k-brain runs (macOS/Linux; the notice says to quit it first, in every language). Logo: the app's own 64px icon (src-tauri/icons/64x64.png, MIT) in an SVG. Run on mote at this tree: - gofmt -l clean; go vet ./internal/agent ./internal/agentenv for darwin, linux (nogui) and windows - go test -tags nogui ./internal/agent -run 'LiveAgent|GatewayKey|ListsModels' ok; ./internal/agentenv ok; ./internal/gui: only TestCoreScriptBudget red, which is red on its base too (app.js untouched here; #5139) - GUI icon-tile, i18n-keys, agent-notice-lang, gui-zh-tw, gui-ja, gui-de: Chromium 27/27, WebKit 27/27 Broken by hand on mote, each red: the user's activeModels not kept (TestLiveAgentProvider "activeModels after sync [], want [...]"); the demo provider not put back (TestLiveAgentMakesItsFile "emptied file"); the demo default not replaced (TestLiveAgentProvider, TestLiveAgentMakesItsFile). Real use on mote (sandbox HOME and LIVEAGENT_HOME, this magpie on 127.0.0.1:3562, a fake Anthropic upstream on 3561, LiveAgent 2.0.5's bundled k-brain from the release dmg): - k-brain backend's first start wrote config.json as {}; magpie liveagent magpie then wrote providers.magpie and the default pick - `k-brain run "Reply with exactly: pong"` (K-brain's CLI, same config and routing code) answered "pong"; the upstream saw POST /v1/messages from magpie - the backend LiveAgent starts listed magpie's model in /v1/models with it as the default, and its /v1/text/generate answered "pong" through magpie - with k-brain running, connect/disconnect were refused with the notice; after it quit, disconnect removed the file magpie made Not tried: LiveAgent's window itself (its model picker was not opened; the backend's API it reads was); LiveAgent on Linux or Windows; a real vendor reply (fake upstream). |
||
|
|
1a1ca0351b |
Revert "catalog: a listed model its id names a video model is one (agnes-video-2.5)"
This reverts commit |
||
|
|
0a5dc40abc |
gateway: a group's trusted Claude, GPT and Gemini thinking streams as it comes, a refusal or error after it going to the next member (#4166)
A try whose model's vendor may refuse after its reasoning (#248) had its reasoning held while another candidate could answer, whatever the member had answered lately. Through a routing group Claude Code saw a Claude member's thinking only with its text, all at once, and never its "thinking with <effort> effort". waynesguan measured it on one WorkBuddy account: `workbuddy claude-opus-5.5` alone, first thinking at 3.66s; through the group, all 67 thinking deltas with the text at 17.25s. Ported from waynesguan's 71aacaa (on |
||
|
|
e7b0c398ee |
sessions: find a ZCode title by its gateway id (#5195)
ZCode sends its session id to the gateway without the sess_ prefix stored in its database. Routing asks Titles with that bare id, gets no title, and falls back to the folder name even though the Sessions page can show the real title. Titles treats zcode:<id> as an alias for zcode:sess_<id> when it reads local session files, and returns the title under the key Routing asked for (the sess_ key too, which callers ignore). A regression test uses the database id shape ZCode writes and the bare request id it sends. Ported from Flandern's b1a952b73 (fix/zcode-routing-session-titles on flandern12111/magpie), code and test unchanged, reviewed line by line; the body is rewritten (the original had literal \n's), and gateway-sessions.md says it. Run on mote via mote-run, at origin/main |
||
|
|
70a98dd85c |
routing: a long Accounts and keys shows its first rows, the rest behind Show N more (ferock4669, iyou00 on Discord)
With many keys the Routing page's Accounts and keys ran on and on: each card held every window, the models it answered and a meter. Now a card keeps its name, one line of what is left (or its rest) and how it fares, with Try now or Sign in again when it needs one. The models it answered are in its tooltip under its id, and a subscription's other windows are on hover over its figure. A list longer than 8 rows shows the first 8 and puts the rest behind "Show N more" at its foot (kept across a reload in magpie.routingActsAll). Never behind it: a row to sign in again, a resting account or model, failures with no answer, a remote whose allowance can't be read, rows under a fold the reader opened, and the heading of a provider with a row shown. Two more alone aren't folded. The button clicked stays where it is on the screen. "View usage" beside it opens Usage's Overview, where each account's card says it all, without making that tab the reader's own (window.openUsageOverview). The foot writes only what changed, so an idle page writes nothing (routing-live-calm). Tests: routing-acts-compact.test.cjs (new; chromium and webkit, en zh zh-TW ja de, 1300px and 420px). routing-account-windows, routing-read-allowances, routing-wallet-lapse, routing-accounts-narrow and routing-columns follow the card's new shape and the foot. Run on mote via mote-run, worktree based on origin/main |
||
|
|
c4245c4c20 |
gateway: a Messages body's tools with a root union go folded to every upstream
ziko on X (11-04): ZCode on Zed's subscription, Claude Sonnet refused every request. Six of the GoAnyAPI MCP server's tools (goanyapi_adsense, the 36th, among them) have a oneOf at their input_schema's root, ZCode sends every tool with every request, and Anthropic's API turns such a request away: "input_schema does not support oneOf, allOf, or anyOf at the top level". Cause: a request translated to Messages always had its tools folded to an object root (objectSchema, #1271), but a Messages body relayed as it came (ZCode or Claude Code to an Anthropic-protocol provider, the Zed plugin's models among them, whose plugin provider has an Anthropic URL) never was: foldsRoots and objectRootsBody handled Chat and Responses only, so neither the first ask nor the retry after the refusal folded it. Change (object_root.go): - foldsRoots is true for every Anthropic-protocol relay, from the first ask, as a translated request already was. - objectRootsBody takes a Messages body: a client tool's input_schema goes through provider.ObjectRoot; a server tool (no input_schema) and a schema with no root union go as they came. The translated path (to != Anthropic guard at gateway.go's objectRootsReq) is unchanged, so nothing is folded twice. - docs/subsystems/gateway-routing.md gains the root-union bullet. Test: TestMessagesRootUnionFolded, POST /v1/messages (stream) to a relay with an Anthropic URL whose fake refuses a root union with Anthropic's own wording: the union tool goes as an object root on the first ask, its branches' properties merged; a plain tool's schema goes unchanged, and so does a body with no union. Run on mote at |
||
|
|
14f6d10de0 |
routing: a remote's Claude card whose read failed says so on its row, not nothing (yi_time on Discord)
remoteWinsOf ( |
||
|
|
ef6bd155ff |
provider: a remote magpie that holds this key says so, where its Claude card went missing with no word (yi_time on Discord)
yi_time on Discord: "没变化 还是不显示通过局域网添加的Claude额度". |
||
|
|
b5b6cc5739 |
catalog: a listed model its id names a video model is one (agnes-video-2.5)
glorious_rabbit_30894 on Discord (#help): models of a custom provider pointed at Agnes AI (apihub.agnes-ai.com/v1) "can't be added to an agent". Agnes runs new-api; its /v1/models rows carry only id, owned_by "custom" and supported_endpoint_types ["openai"], no kind, domain or modalities. Nothing but the id tells agnes-video-2.5 and agnes-video-2.5-flash from its chat models, and magpie had a name check for image models (DrawsID) but none for video, so both were offered to every agent as chat models, and never as video models. FilmsID is DrawsID for videos (video, sora, veo, kling, seedance, hailuo, vidu, runway, *-t2v/i2v/r2v; veo and kling only as a word of their own, so inkling still chats). fetchPage marks a row a video model by it when the list says no kind, no domain, no text output and the id isn't an image model's. mendKinds applies the same to a list saved before, so a fetched Agnes list is fixed on the first read, not the next fetch. A model whose list says it answers in text is never moved. Checked FilmsID against every id in models.dev's cache (~/.cache/magpie models.json, 2026-11-04): every id it matches outputs video and no text, except nvidia/synthetic-video-detector (a classifier, text out); video models it misses are named for nothing it could know (ray2, minimax-h3, gemini-omni), and their lists' modalities or a user's kind still mark them. Not the cause of the report, as far as can be told: with Agnes's real list (testdata, fetched 2026-11-04) and models.dev's real cache, a custom provider at .../v1, at the bare host, Anthropic or Responses protocol, reaches Available, Exposed and Catalog with all four chat models, and every agent's picker (claude, codex, opencode, pi, omp, ... 75 fields) lists them beside a relay's. The reporter says (#help 09:52) dsh, VS Code and Codex can't pick them, with no error; that is not reproduced here and is asked for. Run (mote): - at this tree on origin/main |
||
|
|
69eb93e0a2 |
antigravity: an account's tiers are asked again each hour, so one that became Ultra lists Gemini 4 without a restart (rick_49551 on Discord)
rick_49551 reports an Antigravity account on Google AI Ultra whose model
list in magpie has no Gemini 4. magpie lists whatever fetchAvailableModels
gives, less chat_/tab_ ids, six fixed ids and the models Google marks
disabled; which models Google gives depends on the tier named in
entitlement.userTier, and that tier came from loadCodeAssist once per
magpie run: googleState.projects kept it with no expiry, while Gemini
CLI's experiments (flags) are asked again each hour. An account that
became Pro or Ultra after magpie first asked went on naming its old tier
(none, for a free account) in every hourly relist, and Google went on
listing it gemini-4-argon-disabled with "disabled": true, as it does the
owner's free account today (app.log 11-04: "disabled
[gemini-4-argon-disabled]"), which
|
||
|
|
8ac5f98e2a |
claude: an interactive run's side question branches after the whole reply, not after its tool call
sleepy_shibe (Discord, magpie 0.1.2906, Claude Code 2.1.318, claude-opus-5-5, macOS): in the bridge's interactive mode, the turn after a prompt suggestion went on in a branch that held only U1, the tool_use, "Tool call interrupted" and <synthetic>. The call's result and the reply A1 were gone. Cause: in TUI mode the reply streams through tap.js and the turn ends at the stream's message_stop. The transcript translator, which polls the session file every 50ms, notes the reply's row (and its uuid) only after that. Claude Code asks for its suggestion straight away, so resume saved run.lastLine as the place to branch, and lastLine was still the tool_use row. branchAt then cut the copy just after the call. Fix: the run also keeps the reply's message id (lastMsg). It is set at the stream's message_start, or from a row that was never streamed. The id travels as backMsg, then behindMsg, then savedSession.behindMsg. The cut (cutReply/cutAfterReply) keeps everything up to the last line of the main thread whose message.id is the reply's, so the reply's thinking and text rows and the tool_result before them stay in. A sub-agent's (isSidechain) line with the same id doesn't count. With no id, or none found in the file, the cut goes after the uuid as before. Tests: - TestClaudeInteractiveSideQuestionAfterACallKeepsTheReply. The fake claude writes its reply row a second late, as the real transcript does. The test runs a turn with an MCP call, then its result, then a suggestion, then "now commit it". The next turn must go on in a branch that holds 4 lines (U1, the call, the result, A1) and is told only "now commit it". - TestClaudeCutReplyKeepsTheWholeReply cuts a Claude Code 2.1.318 shaped jsonl: a tool_use and its tool_result, a reply split into thinking and text rows, a sidechain row of the same id, turn_duration, and the suggestion and its answer. The fake's MCP call body is built outside $( ), because macOS sh (bash 3.2) lost the $$ in there. Run (mote, at this tree on |
||
|
|
009076a2a4 |
gateway: group stand-in tests make Codex low by its 5 hours, a week at 92% is spent first (#5209)
|
||
|
|
9595a503a9 |
provider: a Claude account made first stays first when Claude Code renews its sign-in under another's profile (motui9535)
motui9535 on Discord: after making another Claude account first in Providers, a refresh at the top of Usage turned the previous account back into the first. Here is how. Make first switches Claude Code to the account (say Max). A Claude Code started on the previous account (Pro) before the switch keeps writing Pro's profile into ~/.claude.json afterwards. While the credentials are still the ones a saved record holds, claudeSignInOwner names the sign-in by them (#1938, netfishx). The Usage refresh then runs /usage in Claude Code's own config, and that renews the sign-in. The new tokens are held by no record, so the sign-in was named after the stale profile: Pro. rememberLogins then saved Max's renewed tokens under Pro's record and marked Pro active. Max's record kept a dead refresh token, and Pro's record now held Max. The fix: the held record now keeps the profile magpie read at its last look (HeldAs). A sign-in held by no record is the held account's own renewal when all three of these hold: - its profile is that same profile; - the profile names another account; - its plan is not another's. A /login writes its own account's profile, so it is still the new account's. Tests: TestClaudeMadeFirstStaysFirstWhenRenewedUnderAnothersProfile (the reporter's sequence, then a SwitchWhenSpent look) and TestClaudeLoginAnewIsTheNewAccounts (a /login with a new profile, or with another plan, is the new account's). Run on mote: - go test -count=1 -timeout 45m ./internal/provider ./internal/gui ./internal/cli: ok. - go vet for darwin, linux and windows on ./internal/provider: ok. - gofmt -l: clean. Broken by hand: - claudeRenewedHeld never applied: the first test goes red ("first is pro@x.com", pro holds tok-max@x.com-renewed). - No plan guard: the "its plan" subtest goes red. Not tried: - The reporter's real accounts and a real Claude Code renewing its token. The sequence is reproduced with files in a sandbox HOME, and that Claude Code renews during /usage is inferred, not observed. - A /login back to the very account the stale profile names, on the same plan, still reads as the held account's renewal. |
||
|
|
00d8aac596 |
routing: Free quota by expiry spends the soonest-lapsing free quota first (wowbbs)
wowbbs (and shamen_xiaohong) keep check-in free accounts in one group:
WorkBuddy CN x2, MiniMax Code, TraeCode CN and Qoder CN. They asked that
the group spend the free quota that lapses soonest first, go on to the next
when one is used up or has lapsed, and use a paid account only when no free
quota is left.
This adds `expiring` (provider.FreeExpiring, routes.FreeExpiring). It is a
group's only, picked in the Routing page's group menu, with
`magpie group set <g> routing=expiring` or in the TUI. Nothing changes for a
group or provider that doesn't pick it. A provider keeps refusing it, as it
refuses `cheap`.
- routes: Seat.FreePlan and Strategy.ByPlan. FreeExpiring has three tiers:
- free seats (Free, a model at no cost, or FreePlan) by Expires, the
earliest of the window renewals and Lapse, to the hour; an unknown
expiry goes last and ties keep their listed order;
- then the paid seats, as Smart orders them;
- then the spent and resting seats, by when they come back.
- provider.FreePlan reads an account's plan word: free, trial, 免费, 试用,
体验, 體驗.
- gateway: weighRouted fills FreePlan when the strategy asks. The trace's
Weighed rows gain `expires`, so the Routing page's story can say "its free
quota is lost soonest, in 1d 2h". There are also lines for "a free one with
no expiry told" and "no free quota left, so the paid one".
- GUI: an option in the group menu, the mode line, the story lines, and
i18n in zh, zh-TW, ja and de. app.js only adds `expiring` to ROTATION,
paid for by a shorter comment beside it, so the core is 11 bytes smaller
than at its base.
- docs: gateway-routing.md (order of keys and accounts) and
plugin-runtime.md (Seat and Strategies).
Plugins whose usage doesn't say when their free quota lapses got issues
rather than edits:
- magpie-community/plugins#718: Trae sums its packs; the soonest end comes
from any pack, spent or past, and there is no runsOutAt.
- magpie-community/plugins#719: Qoder's plan is the raw userType
personal_standard, which doesn't read as free, and its add-on, shared and
dedicated pools have no expiry.
WorkBuddy (Free plan, resetsAt and runsOutAt) and MiniMax (Free, runsOutAt
on credits) already report what this needs.
Run, all on mote via mote-run at this tree (base
|
||
|
|
d5d48f4f9b |
routing: a week at 90% renewing soonest is spent before its reset, not kept for last (ysicing_01858)
ysicing_01858 on Discord (Use before expiry, three accounts): the
account at 90% of its week, renewing today, took few requests, while most
went to one renewing tomorrow. Smart and Use before expiry put every
account at 90% of any window into tier 1 ("kept for last"), behind every
one with room, so what that week had left was lost at its reset.
Now 90% means "kept for last" only for a rate cap: the five hours, or a
window that doesn't say how long it runs (Allowance.CapUsed). An account
at 90% of its week alone (Seat.WeekLow) keeps its place: by its reset
(Smart) or by share left per hour (Use before expiry). 98% of any window
still puts it last. A new conversation kept for its session may go to
such an account (readyForNew). The trace carries weekLow, so the Routing
row doesn't call it "kept for last" and doesn't dim it. Least used first,
In order and the others are unchanged. The Pace description in Settings
says so in every language.
Their later report ("90% 额度账号已经自然重置了 现在的调度机制又默认主要调度到刚重置的
账号了") is not this bug, and this change doesn't alter it. Use before
expiry orders by share left / hours to reset. A fresh week is about
0.6%/h (100/168h), so it goes ahead of any account with less than that
per hour, e.g. 30% left in six days. Conversation affinity and the
fewest-tokens tie-break, for paces within a tenth, keep it there. Smart
is the routing that goes by the soonest reset alone. Their numbers would
tell whether a pace is wrong there.
Run on mote:
- At 49d6ad779, the same tree on
|
||
|
|
0e804be29b |
provider: requests missing together list logins once, and a plan asks OwnPaused of the held list
Every request's routing plan lists the agent's accounts (perKeyEvery asks AlsoOn, and OwnPaused of the signed-in one), and each list took logins.json's lock. A write in a request (a token refresh) dropped what was held, and every request then in flight listed again, one after another on the lock: 20 requests queued on it in #5104's dump. And OwnPaused was never held: each ask was its own read under the lock. heldOf now builds a missed key once a request: the first caller builds, the others wait for it and take its value. OwnPaused goes through heldOf under its own key, so a write lists it anew as it does Logins. Ported from ggbdpq's ecb829370 (#5104). Changed from that patch: - A waiter takes the build only if nothing changed while it ran: held's generation, filememo's generation (settings.Save tells only filememo) and the environment. The patch skipped heldFreshLocked on wake and kept a build made across a filememo write, so a later caller could get settings from before the save. - A caller outside a request (no Hold) never joins a build; it builds fresh, as on main. - The wait is bounded (heldWait, 5s). A stuck or panicking builder, or one waiting on a lock its waiter holds, can't hang the request; the waiter builds on its own. - When a write came during the build, waiters go round again (up to heldRounds) so one of them builds and the rest wait, instead of all rebuilding at once. - With heldFor 0 a waiter takes the builder's own result (it is not kept, so the patch's waiters found nothing and built again). - New tests: TestHeldWaiterBuildsAgainAfterAWrite (Changed and filememo.Forget), TestHeldWaiterTakesTheBuild, TestHeldWaiterNeverStuck (stuck builder, panicking builder). providers-accounts.md says it. Run (mote, at the pushed tree): - The patch's two tests on main's product code: red 3 of 3 ("20 listed before the first was built", "OwnPaused was not listed once a request"). - go test -race -count=20 -cpu 1,2,8 -run 'TestHeldWaiter| TestLoginsMissedTogetherListedOnce|TestOwnPausedListedOnceARequest| TestLoginsListedOnceARequest|TestHold' ./internal/provider: ok. - go test ./internal/provider: ok. go vet for darwin, linux, windows; gofmt -l clean. - Nesting: an instrumented run of provider, gui, agent, gateway and profile recorded every heldOf inside another build and every heldOf made under a file lock. No heldOf key reaches itself (only heldFrom, untouched). Under logins.json.lock only "migrations" is asked, and its build takes no lock and asks no key; under caller-keys.json.lock the keys asked take logins.json.lock only. No build takes caller-keys.json .lock. So a waiter never holds a lock its builder needs. - Half-written files: unchanged readers. logins.json is written through temp+rename, sharedLogins keeps the last good list on a bad parse, another process's write is seen when loginsMu is taken (Look). Broken by hand, each red: - No filememo check on the build: TestHeldWaiterBuildsAgainAfterAWrite got "before", built 0 times. - Unbounded wait: TestHeldWaiterNeverStuck timed out at 60s. - No take of the builder's result: TestHeldWaiterTakesTheBuild built again. Not tried: a live load of parallel Claude Code requests; two magpie processes contending for logins.json; Windows and Linux test runs (vet only). #5104 Co-authored-by: ggbdpq <67929842+ggbdpq@users.noreply.github.com> |
||
|
|
129baeca01 |
gateway: the same 5xx from two accounts in one request rests neither (mycf_711)
mycf_711 on Discord: 127 of one provider's 128 503s in a day were
"AIError AI服务异常" word for word, all one agent's request with an empty
tool schema the upstream always refused. forbiddenAlike/unforbid
(plugins#243) only took plain 403s, so each such request walked every
account of the provider into backoff, and other agents' normal requests
then found every account resting.
A 500/502/503 that says nothing of why (plainUnavailable: failOther, not
overloaded, no proxy down, not codexReset, not the protection refusal, not
"did not stream", some words) now joins forbiddenAlike when:
- a second account of the same provider, model and reasoning gives it in
the same status and words, request/trace ids left out (refusalWords);
- and the provider answered another request within answeringLately (5m,
noted in servedCandidate as routed.answered).
Then neither rests, the first one's rest and failure count are taken back,
the other mates go last (matesLast, so a group's other members are asked
first), and the last one left isn't asked again after a moment
(sameRefusal; before, the two-account case re-sent the request 13 times).
Kept as before: one account's 503 alone rests it; 503s in other words are
each account's own; a provider that answered nothing in the last 5 minutes
may be down, and its alike 503s rest as before, so an outage is backed off
once 5 minutes have passed since its last answer. A 403 is still alike only
to a 403. Overloads keep their own short model rest.
Ran (mote, via mote-run, at this tree on 6b47bce67; after the rebase onto
|
||
|
|
186453e009 |
provider: a plan key's card says when it was read (jiabubu)
jiabubu (Discord #feedback): on Usage -> Overview the Kimi Code card
showed no "Updated ..." line while every other provider's card did.
The GUI's readWhen shows it only when a quota carries readAt, and
PlanQuotas' key plan cards (Kimi Code, OpenCode Go, GLM Coding Plan,
MiniMax, Ollama, Command Code) and StepFun's, Volcengine's and
Tencent's never set it. Each now goes through readNow, which stamps
a reading that worked and has windows or a balance, as the other
subscriptions' cards already did. A failed read is left alone.
Test: TestPlanKeyCardSaysWhenRead (sandbox HOME, a fake Kimi
/coding/v1/usages, a kimi-code-cn key) wants the card's ReadAt between
the call's start and end.
Run on mote at this tree:
- go vet ./internal/provider: darwin, GOOS=linux -tags nogui, windows
- go test ./internal/provider: ok (184s)
- go test -run 'Quota|Usage|Plan|Balance' ./internal/gui ./internal/cli: ok
- gofmt -l: clean
Broken by hand: without readNow on the plan path the test is red
("readAt <nil>, asOf <nil>"); green with it.
Not tried: a real Kimi Code key; no GUI test, since the page already
draws readAt when the API gives it and the omission was the API's;
Windows/Linux runs.
|
||
|
|
17154e1654 |
provider: a Claude account not used in five hours shows its 5-hour window unused, not missing (motui9535)
motui9535 (Discord #feedback, v0.1.2909, screenshot): of three Team accounts the preferred one showed 7 days 17% and 7 days · Fable 30% and no 5-hour window; the two others showed all three. Anthropic leaves a window out (null) while it hasn't started (claudeWindowsExpected says as much for the warm-up), so Claude Code's /usage has no "Current session" line for an account nobody used in the last five hours, and the card took the missing line as no window at all. The aggregate's 5 hours (100%) then averaged only the two other accounts. A whole /usage reading (claudeWindows, the one place the active and the saved accounts' readings are kept) now gets the 5-hour window it leaves out as not started: 0% used, no reset, first, as Claude Code orders them (claudeKindOrder, taken out of NoteClaudeLimits). A header heard later replaces it as before. Only the 5-hour window: a reading that tells any window tells the week. parseClaudeUsage is unchanged (TestClaudeUsageWeeklyOnly still holds that the parser makes none up); TestClaudeSwitchWeeklyOnly's card now has the unstarted 5-hour window. Run (mote, at this tree): - go test ./internal/provider: ok (132.9s) - go test -run 'Claude|Usage|Quota' ./internal/gateway ./internal/cli ./internal/gui: ok - go vet ./internal/provider on darwin, linux (-tags nogui), windows; gofmt -l clean Broken by hand: without the claudeWithUnstarted call, TestClaudeUnstartedSessionShownUnused is red: windows ["7 days" "7 days · Fable"], motui's shape. Not tried: a real Claude account's /usage with an unstarted session (the null comes from claudeWindowsExpected's note and the screenshot); no GUI test, the cards draw every window /api/usage/quotas gives and the change is in what it gives; Windows/Linux runs. |
||
|
|
f8987ce617 |
gateway: Qoder 1.1.82's requests find their session in Qoder's own files
qodercli/qoderclicn 1.1.82 (11-03) stopped sending session-id to a
provider of the user's own, and nothing else in a request names the
session (coderlee233 on Discord). Its requests were recorded with no
session: the Sessions page lost the conversation's title and showed each
title and suggestion side call as a row of its own.
A request from Qoder or Qoder CN (by its agent token) on this computer
that names no session is now matched against Qoder's session files
(sessions.QoderDir/projects/<project>/<id>.jsonl and its subagents'
files): the session whose typed prompts (user lines with humanInput /
origin.kind human) appear most in the request's user text wins, the file
written last on a tie. Qoder's <system-reminder> blocks are left out. A
side call (no tools) no file matches yet is held up to 600ms, since the
first title is asked ~0.1s before Qoder writes the file. The id found
goes on the request as session-id, the header 1.1.81 sent, so it is
grouped and titled as before. A request that names a session (older
Qoder's session-id, X-Magpie-Session) is left as it came. Files are read
incrementally; a half-written last line waits for the next read.
Run (on mote, rebased on origin/main
|
||
|
|
6b47bce670 |
cli: magpie model compact <agent> sets an agent's own Long conversations
|
||
|
|
2ba044aa66 |
gui: the Mac panel's page is told when Wails hides it, so it follows Settings' units (blrbrzkj)
blrbrzkj on Discord: Settings said ¥ 人民币 and 中文(万 / 亿), while the tray panel's Usage tab still showed ≈$7.18 and 16M. On the Mac a page in an ordered-out window keeps drawing, so magpie tells it when it is hidden (hideWebview) and shown (showWebview), and the page reloads its state, settings included, on the shown signal. The panel is mostly closed by a click elsewhere, which Wails' HideOnFocusLost does with a plain Hide, and by Escape (HideOnEscape), likewise. The page was never told it was hidden there, so the shown signal was a no-op (magpieWindowVisibility returns early when it was never told otherwise), and the panel kept the currency and number units it was first drawn with until magpie restarted. sayWailsHides (windowvisibility.go), on the panel: on the Mac the page is told on WindowLostFocus, as hideWebview tells it, and Escape hides the panel through hideWebview. Other systems are unchanged: WebView2 and WebKitGTK mark a hidden window's page hidden themselves. Tests: - TestPanelHiddenByWailsMarksPageOutOfSight (AppKit, darwin): makes the real panel (h.makePanel), closes it by a WindowLostFocus event and by the Escape key binding, as Wails does, shows it with showWebview, and checks the page saw itself hidden and marked. The probe page now reports what it saw when it is told it is shown, so a native hidden event before the told one can't be the record it sends. - panel-units-follow.test.cjs: the page half. A panel open on its Usage tab in $ and K/M; Settings picks ¥ and 万 / 亿; hidden and shown, the panel re-reads the state and shows ≈¥185, 15.4 亿 (億 in zh-TW) and a 万 axis, then back to ≈$26.40 and 1.54B. zh, en, zh-TW, ja, de; Chromium and WebKit. Run on mote (macOS 27.2), at this tree: - go test -run 'TestClosingWindowMarksPageOutOfSight|TestPanelHiddenByWailsMarksPageOutOfSight' ./internal/gui/: ok - go vet ./internal/gui/, GOOS=linux go vet -tags nogui, GOOS=windows go vet: ok; gofmt -l: nothing - node --test panel-units-follow, window-visibility, number-units: 20/20 Broken by hand: - sayWailsHides(w) not called: the AppKit test times out with no hidden report. - only its Escape binding removed: red, "hidden=true marked=false play=running". - the page's visibilitychange without loadBack (a copy of the assets): panel-units-follow red, "shown again, the panel reads the state again". - The panel test written to show without a told hide (the old Mac path) was 0/12 on the unchanged page, which is how the cause was found. Not tried: the real tray panel by hand on a Mac (the AppKit test makes the real panel window but no status item); blrbrzkj's system isn't known, and on Windows and Linux the page is marked hidden by the webview itself, so this changes nothing there. |
||
|
|
75e30625f5 |
plugin: a command that serves no pages moves a page's service off the app's port (#5187)
MYCF711 (#5187, Windows, 0.1.2901): magpie plugin update run while the
app runs hung with no output. Its host loads every plugin, and
page-chat's service waits for port 3477, which the app's host holds:
each CLI command that starts a host waited ~6s on it, then kept trying
the port every second in the background, so it could take 3477 from
the app's host when that restarted after the update.
Now magpie run with a command that serves no pages (anything but the
app, tray, tui, web, serve, a bare magpie or a magpie: link opened in
the app; servesPages) sets plugin.ServePages(false), and its host hands
a plugin whose magpie.page.service names an option a free port of its
own in that option (hostOptions). The plugin's other parts load at once
and the app's port is left alone. plugins.json is not changed, and a
service no option moves is started as before. The class, not
page-chat: any plugin page service declared with an option.
Run, at base
|
||
|
|
95a0ee1b9e |
providers: a long model id no longer squeezes its name field away in Names, prices & levels (#5170, chiperman)
chiperman's case: beside deepseek-v4-1-flash-economy-20261017 the model's display-name field shrank to ~20px at 900px wide (77-94px at 400px), too small to click. The field could shrink to nothing (min-width: 0) while the id beside it kept its whole width. The field now keeps a 96px floor. It still fills only the room the id leaves (flex: 1, basis 0, up to 220px), so a long id gives way after the field reaches 96px and ends in an ellipsis. A short id is shown whole as before. Ported from chiperman's 8691d31 (issue thread; PRs are collaborators-only), with one change. Their `flex: 0 1 220px` made the field and the id shrink together, so a short id that fit was cut: "example" went 48 -> 41px at 1100px in WebKit, and readable-focus's "selecting a model ID" went red in WebKit (selection ran past the cut id). Only the min-width is raised here. Their regression test is kept (the reporter's id in provider-same-as at 900px). Added: one test per engine, at 400/900/1440px in en, zh, zh-TW, ja and de. It checks the field is >= 96px, the id is beside it, inside the row and ellipsized, and that a short id is shown whole. Run on mote (macOS 27, Playwright 1.62.0, chromium + webkit), at |
||
|
|
3eb2bda4f2 |
settings: Codex, Claude Code and Grok Build each take a Long conversations of their own (molianyin4227 on Discord)
molianyin4227 (Discord #help): models differ, so one compaction size
for every agent fits none; they asked for Codex, Claude Code and Grok
Build to each have their own, falling back to the shared one.
- settings.AgentCompacts[agent] {At, Full} for the agents that write a
compaction window (CompactAgents: codex, claude, grok); Settings.
ForAgent(agent) lays it over CompactAt/FullContext for that agent's
readers only: codexcat.entriesAt, provider codexListed, Claude Code's
writeCompact and desktopPlan, grokModelTables, the route list's
buildModels, Codex's window line (api.go) and Tuned for you
(gui/tune.go, agent/tune.go). A model's or provider's own Compact at
still comes first. An agent with none follows the shared value, so
nothing new is written for it, and an agent outside the three has no
such key and is refused (provider.SetAgentCompact).
- POST /api/settings/agent-compact {agent, own, full, at}; own false
takes the agent's value away. settingsapi.Merge keeps the map.
- GUI: a row "Long conversations in <agent>" under Long conversations,
in the agent's opened row and its sheet: Every agent / Compact at N /
Full window (segs, no select), a size box when Compact at. It lives in
agentcompact.js, imported when the agent's settings hold Long
conversations, then put in synchronously (an async put-in after a
redraw moved the page in chromium: codex-memories-settings' scroll
check). It draws again only when its own values change. i18n in
zh, zh-TW, ja, de.
- Tuned for you's Use on an agent with its own value changes that one,
stashed under tune.long.compact.<agent>; Undo puts it back.
- codex-memories-settings' "no Codex" check counts Long conversations
alone again (:not(.agent-compact)) and waits for the new row.
- docs/subsystems/agent-wiring.md: a row for it.
Core size: app.js 1,311,919 bytes, 109 under origin/main
|
||
|
|
0ee424e3ee |
codex: a thread Codex 0.166 won't resume for its provider moves with Codex (毅, AcMilan on Discord)
Codex 0.166 (openai/codex#57840) refuses to resume a thread whose saved
provider isn't the configured one: "This chat uses openai, but your
current provider is magpie. Switch to openai to continue." (毅), and
"This chat uses cc-switch-official, but your current provider is
openai" (AcMilan). The rollout's session_meta provider wins over the
state DB row, and no -c override gets past it (openai/codex#58865).
Cause on magpie's side: bringOver relabelled only plain rollouts in
place. A thread Codex had packed to .jsonl.zst (a week after its last
turn) stayed on openai, so with magpie as provider it can't resume.
cc-switch-official is the id CC Switch 3.17-3.20 gave the official
account; CC Switch 4 moves those threads back to openai itself (#7948
there), but a user who left CC Switch keeps them stranded.
- sessions.MovePackedCodexThreads: packed threads on `from` updated in
the last 30 days, newest first, up to 128 MB per sync, each moved by
the existing packed rewrite with its copy kept in the trash. Rows
are checked against the file (plain absent, .zst present, meta on
`from`, same home). A state DB without updated_at moves nothing.
- bringOver calls it after RelabelCodexThreads; bringBack already
moves packed threads back.
- bringOfficial: while magpie wires Codex and Codex is on openai or
magpie, cc-switch-official threads move there, unless the user's
top-level model_provider or a profile names cc-switch-official.
- Other providers and packed threads older than 30 days are left; the
Sessions page's Move or Resume takes them.
Run (mote, at the pushed base
|
||
|
|
c7bbd3faf6 |
routing: a Claude joined over the network shows its windows in Accounts and keys (yi_time on Discord)
A remote magpie's provider row on the Routing page showed no usage, while the subscriptions above it did. The remote's cards already reach the window as /api/usage/quotas entries with `from` set (provider = <remote id>/<card provider>), but the page's cardOf/winsOf match only kind "account" with no `from`. remoteWinsOf (plugins/routing/client.js) now draws those windows on a remote-magpie row: a claude-* model row gets the remote's claude cards, gpt/codex/o\d rows its codex cards, each window prefixed by the user when several cards match. When the remote's read failed it says "Allowance unavailable — hover for why" with the error as the title (existing string, all languages), never 0. The usage comes from the machine that owns the account; no gateway change. Run (mote, no Go change): - routing-remote-windows.test.cjs (new; 5 languages, widths 1100 and 420, chromium and webkit) and routing-account-windows.test.cjs at ec697e692 on origin/main 07f02d0d9..: 44 pass, 0 fail. - Broken by hand: render call removed, and the model-family filter removed; each took the new test to 0 pass, 11 fail. - Full go test -timeout 45m ./... at ea1aab179 (same client.js, rebased on |
||
|
|
07f02d0d96 |
provider: moved Zed users get opencode-zed-auth 0.1.17, which drops a thinking display Zed refuses (plugins#708)
Claude Code sends thinking.display "updates" for its newest models, and
Zed's cloud accepts only "omitted" or "summarized", so it answered 400.
@magpie-community/opencode-zed-auth 0.1.17 (plugins commit aa44cc3e)
sends "highlights" as summarized and drops any value Zed doesn't know.
Raising the Zed mover's min from 0.1.15 to 0.1.17 lets keepMovedCurrent
update every moved user's plugin.
Run:
- npm view --prefer-online --registry https://registry.npmjs.org
@magpie-community/opencode-zed-auth@0.1.17 version: 0.1.17.
- mote-run -C <worktree> go test -count=1 -timeout 45m ./internal/provider/
at
|
||
|
|
f0b99745ed |
provider: a Codex account is held on allowed false alone, as the 26.1029 app's Send gate reads it (xiaoq6285)
xiaoq6285 (Discord, Codex App 26.1029 on Windows, Plus, model_provider = "magpie", requires_openai_auth = true) answered |
||
|
|
f177c36a9b |
provider: routed Until used up, Codex's sign-in stays on the account the requests went on to
WalterAIBuilder on X (11-04): two Codex accounts, A (Team, first) and B
(Plus), routed Until used up, affinity auto, stop at cap on. A used up
its 5h window (98% cap). Codex was signed in to B, then signed back in
to A once A had room, while B's week kept being spent until it was at
100%.
Cause: returnsToFirst (internal/provider/codex_switch.go) sent Codex's
sign-in back to the first account for every routing but Claude's and a
switch-only Codex's. Routed Until used up, the gateway keeps requests on
the account it moved to (routes.Drain, internal/routes/strategies.go),
and auto affinity keeps a conversation on whoever answered last while
the cache is warm (chatGPTCold, internal/gateway/affinity.go). So Codex
and the accounts list showed A in use, with B marked to go back from,
while requests through magpie stayed on B. The GUI note under Routing
also promised "back to the first" for drain. This is the hxy920830 rule
("not use one up, then the next") missing its Drain sibling.
Now, routed Until used up, Codex's sign-in stays on the account it moved
to till that one is used up too, the same as the requests. In order and
Smart still go back to the first. The Routing note has its own drain
text in en, zh, zh-TW, ja and de. The subsystem page says so.
Old data: a user signed back in to the first stays there. A user with a
return still pending stays on the next account until it is used up, and
the "First again" mark goes away.
Not changed (filing is the reviewer's call): a provider's own accounts
have no back-to-first under auto affinity (backToFirst and
backFromStandIn apply to groups only, inOrder := isGroup && ... in
internal/gateway/gateway.go). Routed In order, a conversation that moved
to the second account stays there after the first renews, for as long as
its cache is warm.
Run on mote (mote-run), at base
|
||
|
|
d3c544ddf4 |
claude: a replayed transcript marks no earlier turn as the one to answer
The interactive mode gives a conversation no run has to a new Claude Code as its own transcript (replaySession): a user line with the messages before the last reply, the reply as the assistant line, and the turn after it typed. The user line was rendered with renderClaudePrompt, which ran historyEnd again on the cut messages, so for U0 A0 U1 A1 U2 it was history(U0, A0) + <current_turn>U1, "the turn to answer now", followed by A1, then U2 typed. U1 was answered already; the reporter saw the model answer an old question again, and say earlier tool calls had no results (愛睏柴犬阿茶 on Discord #feedback, with the analysis and the fix suggested). renderClaudePrompt is now renderClaudePromptAt(req, historyEnd(...)); replaySession calls it with the split at the end, which tells every message before the reply inside <conversation_history> and closes it there, with no <current_turn>. Every other render is unchanged. Siblings: historyEnd has two callers, replaySession (whose own split, on the whole request, is right: the reply and the turn typed after it) and renderClaudePrompt. replaySession is the only place that renders a cut slice of the messages (grep 'Messages = .*Messages\[:'). renderClaudeTurn (the typed turn) has no history marks. Run (on mote, mote-run): - go test ./internal/gateway -run TestClaudeTUIReplayMarksNoEarlierTurnCurrent: red on the old code (all 5 subtests: two turns, three turns, tool results in both turns, tool results only before the reply, the client's calls after the reply), green with the fix. - Broken by hand: put renderClaudePrompt(&before) back in replaySession, the new test went red; restored. - go vet ./internal/gateway, GOOS=linux and GOOS=windows go vet: ok. - go test ./internal/gateway -run 'Claude|Replay|Prompt|Turn': ok 124.6s. - go test ./internal/gateway -run 'Loop|Guard|Doc': ok. - gofmt -l internal/: clean. Not tried: a real Claude Code resumed on such a transcript with a real account (the change to what the model sees was checked in the transcript file only); the full suite runs after the tag. |
||
|
|
1987fe220c |
agent restart: a script run on the app's own executable is not the app (WorkBuddy's sidecar)
Northes (Discord #feedback, 11-04): WorkBuddy's Agents row kept "重启 WorkBuddy 后生效" after they quit and reopened it, and its Restart quit WorkBuddy and never opened it again. #3700 (Raters0) is the second half on WorkBuddy AI. Cause, from WorkBuddy 5.5.6's app.asar (read only) and its processes on the Windows box: WorkBuddy starts a sidecar as `<its own executable> .../app.asar/main/sidecar-entry.js --token ...` (ELECTRON_RUN_AS_NODE, detached). The sidecar outlives the app's quit and the next start reuses it, and its prewarm and `--serve` CLIs run as `<executable> .../cli/bin/codebuddy ...`. The daemon is `WorkBuddy.exe ... daemon-app-server-entry.js --stdio`. All of them match the running check's `Contents/MacOS/<exe>` pattern (and WorkBuddy.exe's image on Windows), so: - (a) findRestartable took the oldest match, the sidecar, as the app's start, so magpie's change was always "after" it and the row never cleared, however often the app restarted. On Windows the earliest start was used too. - (b) reopenBundle waited for every process under Contents/ to end; the sidecar never does, so after 30s it said "still open" and never ran `open`. Fix: runsScript(cmd, exe) tells a script run on the app's executable (a .js/.cjs/.mjs argument, or a first non-flag argument that is an absolute path) from the app itself and its helpers (--type=..., /prefetch:, -psn_, a deep link). The macOS running check and the reopen's wait skip such processes (appProcs), and the Windows check reads each process's command line (proc.CommandLine, new) and skips them too. The reopen still waits for real helpers (renderer, GPU). This is shared by every restartable app: Claude desktop, WorkBuddy, WorkBuddy AI and the Codex app. Tests (red on the old code: a copy of the base with runsScript returning false failed all three, since = the sidecar's 2h, the Windows since the sidecar's, and 6 RunsScript rows): - TestWorkBuddySidecarOutlivesQuitOnMac (WorkBuddy and WorkBuddy AI, a space in the bundle): a 2h-old sidecar and prewarm beside the app; the row is behind by the app's start, a manual reopen clears it, the sidecar alone is not "running", Restart quits then opens. - TestWorkBuddySidecarOutlivesQuitOnWindows: same, and Restart closes and ends only the app's tree, then opens it. - TestRunsScript: real Windows command lines from WorkBuddy on the box, macOS ones, and #3700's `codebuddy --serve` line. Run at this head (rebased on |
||
|
|
d6d3e6cc82 |
provider: Devin's mover min is 0.1.36, which sends another model its earlier reasoning (plugins #703)
devin 0.1.36 (plugins 1a342edf) sends swe-2 and the other models that
aren't Claude their earlier turns' reasoning back as unsigned thinking
(field 11), from chat's reasoning_content, OpenCode 2's reasoning parts
and Messages thinking blocks. Claude still gets only signed thinking
(#665). keepMovedCurrent brings every moved Devin user up to it.
npm view --prefer-online showed 0.1.36 before this change.
Run: gofmt -l internal/provider (clean); on mote, go vet
./internal/provider and go test -timeout 30m ./internal/provider (ok,
229s) at
|
||
|
|
5957223d89 |
library: a project's skills can be given to DeepSeek Harness, in the project's .agents/skills
xingchen_c on Discord (#general, 11-04): "资源库按照项目配置能否支持一下dsh".
projectSkillsDirs left dsh out, its comment saying it reads no project
folder magpie can rely on. It does, and always has: the skill provider
every dsh profile mounts (dsh-base's cordis.patch.yml, id skill-filesystem)
scans <projectRoot>/.dsh/skills (rank 100) and <projectRoot>/.agents/skills
(rank 200), the project root being the nearest folder up from the
session's cwd with a .git, else the cwd (roots and findProjectRoot in
@deepseek-ai/dsh-skill-filesystem 0.2.1-rc.5; the same two joins in
0.0.1-rc.3, 0.1.0-rc.6, 0.1.5-rc.3, 0.1.7-rc.2, 0.2.0-rc.2, 0.2.1-rc.1
and 0.2.2-alpha.3). dsh now gets the shared .agents/skills, so the
project row lists it and one link serves it with Codex and the rest.
MCP stays as it was: dsh's servers are dsh-mcp-client rows in a
profile's patch layers (bundles, the profile's and $DSH_HOME's
cordis.patch.yml, --patch overlays; composeProfile in @deepseek-ai/dsh
0.2.1-rc.5), none of them the project's. Said in project_mcp.go and
docs/subsystems/library.md.
Run:
- mote: go test -count=1 ./internal/library/ ok (102.9s); gofmt -l
clean; GOOS=windows and GOOS=linux go vet ./internal/library/ ok.
- Broken by hand: TestProjectSkillsDsh with projects.go at origin/main
fails ("magpie knows of no folder dsh reads a project's skills from").
- Real dsh: @deepseek-ai/dsh 0.2.1-rc.5 from npm on mote, sandbox HOME
and DSH_HOME, headless profile against a fake OpenAI-compatible server.
Run in a folder with .git, a skill linked into its .agents/skills is in
the request's <available_skills>; run in a folder with no .git, its own
.agents/skills is read; run in a subfolder of the repository, only the
root's is read, not the subfolder's (filed as #5172).
- GUI: /api/library's view from library.Read with a sandbox ~/.dsh,
served to the real assets in Chromium and WebKit, en and zh: the
project card's skill rows have a dsh chip (lit where given), and the
"reads no project skills folder" line no longer names it.
Not tried: the dsh Desktop app (its own profile; the same base bundle
is assumed, not checked); the full GUI suite (no GUI file changed);
Windows copy mode with a real dsh.
|
||
|
|
83bdfe70d2 |
otlp: OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME name the server a trace or metric came from (#5167)
Several magpie servers exporting to one collector or to Langfuse all sent
the same resource, service.name=magpie alone, so nothing said which server
an event came from. Both signals' resource now merges the standard
OTEL_RESOURCE_ATTRIBUTES over that default, and OTEL_SERVICE_NAME over
that (otelResourceAttributes in internal/otlp/otel_resource.go). Nothing
about the machine is looked up; only what the user set is sent. Neither
variable turns export on.
Ported from reyoung's 7ed03b819 (feat/otel-resource-attributes, base
|
||
|
|
cd83c3147f |
plugin: a hook's auth.set doesn't sign in again an account signed out while it ran (#5126, #5119)
Cause: a plugin hook that saves a sign-in through client.auth.set (a models list spending a rotating refresh token) wrote it into plugin-auth.json unconditionally. A listing that began before a sign-out, or before a failed move's putBack took the accounts back out of the plugin (plugin.Take), landed after it and wrote the account in again. TestMoveToPlugin's reset signs fakeco out, but a background listing set off by the step before spent a@fake's "rot-a" token again (rot-a+++++ seen in the file right after the sign-out), so the next Move saw a@fake as the plugin's own (movedAccount.Was), restored it on failure, and "the plugin kept an account of a failed move". TestMoveCutShort (#5119) fails the same way: the account Take removed came back through the same write. Not a leak between runs: the race is inside one run, and more runs only gave it more chances. It is a real bug for users too: signing out of a rotating-token account while its models are listed brought it back. Fix: inScope in host.js notes whether the account was signed in when the call began (had); auth.set skips the write under the file's lock when it was and is gone now, as renewLocked already does for renewals. Sign-in steps (signingIn) are not held to it, their account is new. Test: TestSignOutOutlastsRunningHook holds the fake plugin's models hook (new FAKE_MODELS_HOLD: marker file in, release file out) across a SignOut in a real host and checks the account stays gone, and that a hook not raced still keeps the token it saved. Run (all at this tree): - mote-run go test -count=30 -run 'TestMoveToPlugin$|TestMoveCutShort$' ./internal/provider: ok. Before the fix the same run on mote failed 3 TestMoveToPlugin + 9 TestMoveCutShort of 30 each; -count=15 of TestMoveToPlugin alone failed 2 to 4 of 15. - wsl-run go test -count=20 of the two plus the new test: ok. Before the fix: 4 + 17 of 20 failed on Linux. - mote-run go test -count=5 -run TestMoveToPlugin$: ok. - mote-run go test -count=5 TestSignOutOutlastsRunningHook: ok. - mote-run go test -timeout 45m ./internal/provider ./internal/plugin: ok (provider 171.6s, plugin 160.4s). - gofmt -l clean; go vet, GOOS=linux and GOOS=windows go vet of both packages: ok. Broken by hand: host.js reverted with the test kept: TestSignOutOutlastsRunningHook red 3 of 3 ("the hook signed the account in again"), and the provider tests red as above. Not tried: a real vendor's rotating-token plugin signed out mid-listing (the fake plugin's rot- sign-ins stand in for it); the full ./... suite runs after the push. |
||
|
|
efe11df3a0 |
gui: a press and release on a button with no click after it is clicked once (refeccd, Tap to click)
refeccd (Discord) reports, a third time, that with macOS Tap to click the first tap on a magpie button only shows the pressed state and does nothing; the second tap works, a physical press works first time. Fixes |
||
|
|
40cfd32b0b |
provider: a Codex account with no credits and every window at 100% counts held though allowed isn't false (xiaoq6285)
xiaoq6285 (Discord, magpie 0.1.2891, Codex App 26.1029, Windows): a used-up
Plus account, no credits, 用量 showing it used up, config.toml with
model_provider = "magpie" and requires_openai_auth = true, Send grey until
Codex was switched off in magpie. Banked resets and paid credits were ruled
out (codexHeld reads neither resets nor, here, any credits). What is left is
a reading that doesn't say allowed false: codexHeld needed exactly that, so
CodexUsedUp stayed false and Sync kept requires_openai_auth, which makes the
app read the account's rate limit and grey Send.
codexAtLimit now holds: allowed false (as before); allowed not said with
limit_reached or a window at 100%; allowed true with every reported window
at 100%. Credits and the workspace-overage exemptions are unchanged and
still run after it.
Why the two cases that were false stay narrow:
|
||
|
|
d1fa254b1d |
gui: masked words and Never mask are a list, a row per word (noahhrreion on Discord)
noahhrreion: "希望脱敏词选项可以做成真正的列表,在一个小输入框里面不方便管理多个脱敏词". Settings → Privacy's Masked words was one comma-separated box. It is now a list (wordList in plugins/redact/settings.js): each word is its own row, edited in place (Enter or leaving the row saves, Escape puts it back, emptied is removed), × removes it, and the last row adds. Its sibling, Never mask under the mask actions, had the same box and gets the same list. Stored values are unchanged: redactWords and the allow list are still string arrays, saved through the same savePrefs / settings/redact-allow calls, and nothing is rewritten on open (the new test checks that opening the page saves nothing). Typed or pasted text splits as the old box did (, , and newlines, trimmed, empties dropped), so a pasted "a, b" is two rows. The Hide eye still shows every row as dots. New strings are in the redact plugin's i18n for zh, zh-TW, ja and de; the two old "separated by commas" hints are gone from the core i18n. The site's masking docs (en, zh, ja) say a row each. Run (on mote via mote-run, Chromium and WebKit): - new redact-words-list.test.cjs: 5 languages × 1100/400px × both engines, draw, add with Enter, paste-split, edit, Escape, ×, empty-and-Tab, reload; with i18n-keys 24/24 ok - redact-words-hidden, any-case, whole, mask-actions, redact-route, redact-kinds, redact-shape, settings-search, settings-sections, settings-lines-wrap, settings-hints, settings-groups, readable-focus, masking-records, mask-alert: 378/378 ok - go test ./internal/gui/ -run 'TestCoreScriptBudget|TestSettings': ok (app.js shrank; no budget raised) - screenshots light/dark, 1100/400px, both engines, looked at Broken by hand: without wordFocusBack (focus kept across a redraw) the new test goes red (waitForFunction timeout after the first add). Dropping the blur guard during a redraw (wordsRedrawing / isConnected) stays green in both Playwright engines, which fire no blur on removal; it is kept as a guard for engines that do, with no test that fails without it. Not tried: the real app on WebKitGTK / Windows WebView2; no Go files changed. |
||
|
|
4ca55c6b62 |
gateway: a guard test that Only switch Claude Code's sign-in keeps every route off the Claude accounts (zhangxiaoxiaoxx on X)
zhangxiaoxiaoxx on X asked for a switch so that, with Claude signed in, magpie never forwards or routes another agent's request onto it. That switch exists: Providers > Claude, "Only switch Claude Code's sign-in" (magpie accounts switch-only claude on, |
||
|
|
f4e52659a8 |
plugins: a pick listed as another id leaves with its model (axelburks)
A plugin's model the user lists as another id ("list as", SetModelID) is
picked under that id, but pluginListedIDs held the plugin's own ids. The
hourly relist and Refresh compared the pick with a list that never had
it, so "in the old list, not in the new one" was false, and a model the
plugin dropped stayed picked and on, as if typed in by hand. The built-in
providers' liveIDs already mapped through modelIDsOf; the plugin path
now does too. The list-as stays in settings, so when the plugin lists the
model again relistPicks puts the pick back under the same id.
Run: TestListedAsPickLeavesWithItsModel (new: aaa listed as
claude-opus-5.5 and picked, next list lacks aaa -> pick set aside, alias
kept, a hand-typed pick stays; aaa back -> pick back, alias intact), on
mote. Broken by hand: with pluginListedIDs returning the raw ids the test
fails ("dropped []"). go test internal/provider, internal/plugin: ok.
internal/gui: TestCoreScriptBudget (1535230 > 1533802) and
TestMainWindowCorners (mote's macOS) red, neither touched by this change.
Not tried: a real plugin sign-in.
|
||
|
|
525e69b976 |
gui: a page served anew reloads once, not once per read (visamzh on X)
667317159's servedAnew reloads a magpie web page once another version of magpie answers for it. Clicked back into on the Settings page, the page reads /api/update twice, for the badge and for the Version row, and each answer called location.reload(). When the second answer comes a few ms after the first, Chromium starts the reload again and the page is loaded twice. The whole GUI suite at |
||
|
|
759b4d1d7d |
agents: a new user's list is folded under Get started (Renzexi01)
Renzexi01 on X (一进来就这么复杂): a new user saw Get started and, under
it, every agent found on the computer at once. While the Get started card
shows and no agent is in use yet, the whole Agents list is folded under
it behind "Show all {n} agents" (en, zh, zh-TW, ja, de); the card's
second step already names the agents found, each connected in a click.
Once one is connected, or the card is put away, the list is as before:
the ones in use in view, the rest under "Show {n} more".
getting-started checks the list folded under the card, the button's
words and aria-expanded in every language, and the list back once an
agent is connected or the card put away. Tests whose fake state is a new
user with no agent in use, and which read the agents' rows, now set
guideHidden as a user past Get started has (account-arrange,
aside-native, agent-*, claude-picker-magpie-first, codex-accounts-via,
omp-profile-connect, picker-rail-current, picker-speeds, pop-phone-room,
reasonix-roles, snow-fields).
What was run, on mote through mote-run, at a9a82a1c3 (tree e91b8e625,
the same as this commit once its fixup was squashed in), on base
|
||
|
|
67bc50aa29 |
routing: a group switched off is listed after the ones on (justacati)
justacati on X: a group switched off stayed where it was among the ones on, so the list read as if it were still in use. Routing's group list now shows the ones on first and the ones off after them, each part in the order the user set. Moving a group (drag, Move up/down) moves it among its own part only: the last one on is not offered Move down into the ones off, and a drag only passes cards of its own part. The saved order is unchanged, so agents' pickers list groups as before, and a group switched on again is back in its place. group-switch-add-many checks the order after a switch off and on, and that Move down is not offered on the last one on. What was run, on mote through mote-run, at a9a82a1c3 (tree e91b8e625, the same as this branch's head once the fixup was squashed in), on base |