1ccacad63281094de8a3372d5a507d38f9969e5c
1960
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5e1b10913 |
settings: longest context can hold a model's own window too (WJaunita45604 on X)
v0.1.3681's Longest context left a window the user set for a model, or "*"
on its provider, alone even when longer. Settings > Models > Routing now has
a menu beside the field: "Models without their own" (the default, as before)
or "Every model". In both modes the shorter of the cap and the user's own
window is told; they differ only when the user's own is longer (own keeps it,
every model brings it down). Settings.ContextCapAll, Settings.CappedOwn,
POST /api/settings/context-cap-mode {all}, magpie model context-cap all|own.
Applied in provider.windowIn (so /v1/models, catalogs, compaction), Codex's
CodexNativeWindow/CodexWindow (the list's ETag tag carries the mode) and the
gateway fallback window. i18n in zh, zh-TW, ja, de.
Run (wsl-run, mote's disk was full): provider (full), settings, settingsapi,
codexcat packages; cli -run ContextCap; gateway -run ContextCap|ModelsList;
GUI context-cap, i18n-keys, model-load, settings-places, settings-general in
chromium and webkit; TestCoreScriptBudget; gofmt; go vet nogui and
GOOS=windows vet. Broken by hand: windowIn's CappedOwn removed turns
TestContextCapAllHoldsTheUsersOwnWindowsToo red.
Not tried: the whole Go and GUI suites, a real Codex reading the list, macOS
or Windows runs, GUI in zh-TW/ja/de beyond the i18n-keys check.
|
||
|
|
4a7d222dc8 |
providers: an OpenCode Go key takes the usage cap an account does (@wanggenjidev on X)
Backend only; GUI follows. Tests: provider TestKeyTakesUsageCap, gateway TestKeyUsageCapPassesTheKeyOver (red with the hold removed by hand). |
||
|
|
08a852a369 |
provider: a model off for an agent stays off while the vendor's list lacks it; zcode min 0.1.59 (WJaunita45604 on X)
ZCode's GLM-5.3-Flash-Trial is listed only from about 23:00. SetHiddenModels
rebuilt the agent's off list from the models listed right now, so an off
choice for an absent model was dropped on the next Save, and the model came
back on at 23:00. It now keeps hidden ids that ListedFor no longer lists.
(Provider picks and per-agent PickedModels already survive a relist; a
3-day flip test with an editor Save in between guards that.)
The display half is in the plugin, zcode 0.1.59 (npm checked): a reply the
gift answered names the -Trial entry, so Usage, sessions and the request log
show the model served. The mover min is raised to 0.1.59.
Run: go test ./internal/provider (wsl, ok); gateway zcode/trial tests ok;
gofmt clean; go vet linux, windows, darwin ok. Plugin: bun test in
packages/zcode 243 pass.
Broken by hand: SetHiddenModels reverted -> TestHiddenModelAbsentStaysHidden
red ("an unlisted model's off choice lost"); plugin trialNamed removed -> the
2 new gift tests red.
Not tried: a real Start Plan reply or live account; mote was out of disk, so
tests ran on wsl. GUI not touched.
|
||
|
|
d936be7639 |
usage: Claude's card shows the extra-usage cap and its spend (Shinji_Zl on X)
Claude Code's `claude -p /usage` text omits extra usage, but with `--output-format json --verbose` a message carries usage_report.rate_limits.extra_usage (cap and spend in cents). The gateway adds it as a line; parseClaudeUsage reads it as an Aside "Usage credits" window (n / cap USD), so a spent cap never marks the account used up. magpie asks Anthropic nothing itself, and cannot make a request spend credits: Anthropic decides. The prepaid balance is a separate endpoint and is not shown. Run (wsl-run, linux): TestClaudeUsage*/TestClaudeOverage in provider and gateway, go vet linux/windows/darwin, i18n-keys, i18n-en-no-cjk and claude-overages GUI files (chromium + webkit). Broken by hand: Aside false -> TestClaudeUsageCredits red. Not tried: a real account with extra usage on (the owner's is off); full suite after the tag; Windows run. |
||
|
|
b39a793c98 |
codex: the Codex app, left showing fewer projects after a switch while it ran, says to quit and reopen it (linsm66 on X)
"为什么codex在触发自动更换账号后侧边栏已有的项目文件夹会消失呢". v0.1.3600 ( |
||
|
|
4ddc150c66 |
gui: a hover hint beside the account switch says how it works and why it is the agent's own use
The owner (11-11): "在这个切换开关旁边有一个 hover 的提示,提示这个原理是啥,
以及它为什么不会让你的账号被封禁". Beside Switch {agent}'s account
automatically, an ⓘ mark; resting on the row (or a key reaching the
switch) shows settingshints.js's card with three lines:
- how: the next account's sign-in is written where the agent keeps its
own, as /login or codex login does; what is left is read by Claude
Code's own /usage, or where Codex's /status reads it; sessions already
open keep their account until restarted;
- why it is the agent's own use: Claude Code still sends every request
itself, straight to Anthropic, unchanged, and magpie sends none (an
account's own proxy kept); for Codex, only which of your own accounts
it is signed in to changes;
- the limit: the same as switching by hand; use only your own accounts,
sharing one is against the vendor's terms. It promises nothing about
bans: that is the vendor's call.
Only where the switch moves the sign-in. Under the gateway it moves
Claude Code's requests instead, and the "straight to Anthropic" line
would be false, so SignInMovesOf now says `routed` on a kept Claude
whose requests go through the gateway, and the hint shows for `moves`
and for `kept` without it.
The lines and mark are in autoswitchtip.js, imported when the switch is
drawn; app.js gets the one import line, paid for by cutting this branch's
own two comments: the core is 1,533,771, under 1,533,802, no raise.
Strings in zh, zh-TW, ja and de.
Run (xiaomi-gpu, Windows 11, win-run; mote refuses ssh):
- node --test sign-in-moves, keep-login, pool-ends, old-webkit, i18n-keys,
i18n-en-no-cjk, settings-hints, editor-hints: 148/152. The 4 reds are
the same at the base
|
||
|
|
8a3dbf0232 |
gui: the accounts list says what magpie does with the agent's sign-in
A user with two Claude accounts read the used-up switch as gone. Their "Keep Claude Code signed in to" box was ticked, which turns the switch off, and nothing on the page said so. Under the accounts of a Claude Code or Codex with more than one account, a line now says what the switch does, as NextLogin decides it: - kept: switching is off, the agent stays on the first account (or the one picked) even once it runs out; - gateway: Claude Code's requests go through magpie, which picks an account per request; its own sign-in stays put; - moves: the share it moves at (98%, or used up for In order / Until used up), and whether it comes back to the first (returnsToFirst). provider.SignInMovesOf gives the mode from the same checks NextLogin makes (leftAlone, keep, ClaudeThroughMagpie && !SwitchOnly, SpentShareOf, returnsToFirst). /api/providers carries it as signInMoves on the agent's own provider row. The Routing tab's sign-in note says the gateway case too. Strings in zh, zh-TW, ja and de. Run (mote, through mote-run): - go test -run 'TestSignInMoves|TestClaudeRouted|TestKeepLogin| TestClaudeSwitched|TestNextLogin|TestCodexLogin' ./internal/provider: ok - go test -timeout 45m ./internal/gui ./internal/provider: ok (script size budgets included) - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on provider and gui: ok - GUI: sign-in-moves, keep-login, i18n-keys, i18n-en-no-cjk, routing-signin, account-return in chromium and webkit: 60 pass - whole GUI suite (make test-ui): see below - screenshots in WebKit, en and zh: the line sits inside the list at the rows' inset; zh sentences join with no space Broken by hand: dropping NextLogin's keep case from SignInMovesOf turns TestSignInMovesSaysWhatSwitchDoes red; not appending the line turns sign-in-moves.test.cjs red 4 of 4. Not tried: the real app with the owner's accounts; the user's own keepLogin is left as it is. |
||
|
|
58fb070953 |
settings: named proxies, chosen as inherit, direct or a saved one anywhere a proxy is (@tsingchao on X)
Settings > Network keeps named proxies (name, address, optional login)
with a Test that says reachable and the latency. Everywhere a proxy can be
chosen (global, plugin downloads, a provider, a key, a Claude account) now
has a Saved mode beside the others; the value is "@<id>". Addresses typed
before are read exactly as before, nothing is migrated or overridden.
netproxy.Parse/Resolve/Redact/EnvWith/Dispatch resolve a reference at the
lowest layer, so a proxy edited once reaches the gateway, usage reads,
sign-ins and the plugin host at the next request; Claude Code's
settings.json env (a snapshot) is rewritten by provider.ProxyEdited.
A reference this computer lacks fails closed (DeadProxy), says the proxy's
name in the request error and as "Proxy missing: {name}" on the provider
row, and never goes direct. The password lives in settings.json (0600), is
never read back by the page, logged, or put in Settings sync. The list
rides with the providers part of a sync (Bundle.Proxies, MergeProxies by
id, passwords only with keys). A proxy in use can't be deleted (409).
The saved list's page code is in proxies.js, loaded when Settings draws it;
app.js grew by Saved-mode helpers only, paid for by 16 long comments cut
(core budget unchanged, no raise).
Run (mote refused ssh all session, so Go and GUI went through win-run on
xiaomi-gpu, Windows 11; gofmt and darwin/linux-nogui/windows go vet were
clean on mote before it went down, at the pre-sync tree):
- go test settings, netproxy, backup, settingsapi, davsync: ok on Windows
(earlier on mote: also gui, provider, plugin with real Bun, gateway).
- saved-proxies.test.cjs 20 of 20 (chromium+webkit, en zh zh-TW ja de,
420px) twice more on Windows; provider-proxy-missing.test.cjs 20 of 20.
One webkit de 420px run of saved-proxies failed once under 4-way
concurrency and passed 3 of 3 alone; not reproduced.
- TestCoreScriptBudget ok after the move (it was 3.4KB over before).
Red on this tree and on origin/main alike (Windows run, not mine):
settings TestSharedCheckedReadsOnceAndKnowsUnknown; provider
Codex keychain/Git tests; plugin TestHostRunsAsMagpieBun, TestPiPackage;
gui TestGatewayHeldByAContainer and others; old-webkit "compat.js is the
first" (headerpresets.js) and ":has() (Safari 15.4)" on origin/main
|
||
|
|
7476328901 |
settings: one longest context for every model (WJaunita45604 on X)
Settings > Models > Routing has a Longest context field (magpie model context-cap [<size>|off], POST /api/settings/context-cap). It lowers every model's window to it, so a user need not set each model. A window the user set on a model, or on its provider with "*", wins and is not capped; a model whose window is unknown stays unknown. It is applied where the window is derived, provider.windowIn, so /v1/models, every agent's catalog, group windows and the compaction thresholds that follow the window all agree. Codex's own models take it through CodexNativeWindow, CodexWindow and codexcat.Cap on the list the gateway serves; the list's ETag carries the cap so Codex asks again. The provider editor's Listed value stays the vendor's. Run (mote): provider, codexcat, cli, settings, settingsapi, gateway tests; GUI context-cap, model-load, settings-places, i18n-keys, settings-general in chromium and webkit (en, zh); TestCoreScriptBudget; gofmt; vet on darwin, linux nogui and windows. Broken by hand: windowIn without the cap turns TestContextCapHoldsEveryModelButTheOnesTheUserSet and TestModelsListContextCap red. Not tried: the whole GUI suite (one row added to an existing list, no new API read on page load), a real Codex reading the capped list, Windows run. Not covered: Claude Code's own [1m] choice (claudeRunName) and agent/claude.go's fallback when a ref has no window. |
||
|
|
1f99f6f0b5 |
provider, gateway: a backend that only streams is tested and served (Cyrus_4433 on X: claude-relay-service "400 · Stream must be set to true")
A CRS Responses endpoint, like Codex's own backend, turns away a request that doesn't ask for stream:true. The editor's Test models and protocol detection send one small body, so every model of such a relay was red; an agent that sent stream:false got the same 400 through the gateway. Probe: probeAt asks once more with stream:true when a 400/422 says the stream must be set (provider.StreamRequired, WithStream). Chosen over streaming every probe so a vendor that takes one body keeps being asked for one; every probe (model test, per-model check, detect, key check) goes through probeAt. Gateway: passthrough marks the model stream-only on that 400 for a request asking one body and returns done=false; attempt then translates on the same API (always streamed upstream, whole reply to the client), and asks so at once from then on, as a refused custom tool is. Run (mote): new tests built from the reporter's literal error, red on the old code (TestProbeStreamsWhereTheBackendOnlyStreams, TestDetectFindsAStreamOnlyBackend, TestWholeReplyFromAStreamOnlyBackend), green on the new; go vet darwin, windows, linux nogui; go test ./internal/provider ./internal/gateway ok. Each fix broken by hand (probe retry stashed, gateway hook stashed): red. Not tried: a real CRS relay; the rest of ./... (started after the tag). |
||
|
|
9cd4ef6a19 |
sessions: an aliased range is named once per change, not on every 10 s read
While the Sessions page is open, the GUI reads the 7, 30 and all-days
ranges again every 10 s. Those ranges are kept (keptStats), so a read
with nothing changed costs almost nothing, except when a model is
counted under another name (a usage alias, or a shared group's spelled
name). Then aliasStats copied every day's usage and every session's
summary of each range on each read: ~5 MB a read for the owner's real
history, which was then thrown away because nothing had changed.
aliasKept keeps each range's aliased Stats with the kept Stats it came
from and the names (provider.UsageNamesKey). When the kept Stats are the
same slices and the names haven't changed, it returns the same answer.
Kept Stats are never written, and MergeExternalStats copies before it
writes, so the answer can be shared. The memo is dropped with the kept
ranges (forgetKeptStats), so it never outlives them. UsageAliasKeyed
reads settings once for both the alias and its key.
Run: TestAliasedRangeMadeOncePerNames (new) passes. With the memo
skipped it fails at "named again with nothing changed". With the key
and source check removed it fails at "the old names' range given after
the names changed". go test ./internal/sessions ./internal/provider
./internal/gui and GOOS=windows / GOOS=linux -tags nogui vet: ok at
|
||
|
|
296a9292c7 |
claude usage: a first reading that failed is tried again after the wait (@simonzyzy on X)
Run at the pushed head (rebased on origin/main): go test internal/sessions, internal/usage, internal/provider ok; gofmt clean; go vet darwin, linux, windows ok. Test red on the old code by stash. Not tried: a real Claude Code with a failing /usage; the full suite. |
||
|
|
328dc97e28 |
dirent: Each lists a folder with nothing made an entry; Codex's idle check uses it
|
||
|
|
68d1fda92b |
providers: GPUStack, a self-hosted model server, in the Add sheet (tayedexuanfeng on X)
tayedexuanfeng asked for GPUStack so locally deployed models import quickly.
GPUStack (github.com/gpustack/gpustack, read at 26b4af6) serves its
OpenAI-compatible API at <server>/v1 (/v1-openai is the legacy path), takes
the key as a Bearer (docs/user-guide/api-key-management.md), and lists the
ready models at GET /v1/models as {"object":"list","data":[{"id",
"object":"model","created","owned_by":"gpustack"}]} (routes/openai.py).
A KindLocal preset, so the Add sheet's Server address field, the CLI's
address=, the TUI's ask and AtAddress all apply as for Ollama; unlike
Ollama it is not NoKey, so its key is asked for. Default http://localhost/v1
(port 80). Logo: the project's own docs/assets/logo.png (Apache-2.0), 96px,
in pngIcons as mlx-serve's is (lobehub has none). Note translated in zh,
zh-TW, ja, de.
Run on mote: go test -count=1 of internal/provider, gui, cli, tui (ok);
go vet on darwin, windows and linux nogui for provider and gui (ok);
GUI i18n-keys, i18n-en-no-cjk, models-add-and-icons, local-address and the
new gpustack-add (56 of 56 in chromium and webkit; gpustack-add also in en,
zh, zh-TW, ja, de at 900 and 440px). The new Go tests use a fake server in
GPUStack's documented shape and never reach the network.
Broken by hand: NoKey true on the preset turns TestGPUStackPreset red;
dropping gpustack from pngIcons turns gpustack-add red (11 failed).
Not tried: a real GPUStack server (none on the LAN), the Linux WebKitGTK
app, the Windows box. Not built: GPUStack's /v1/responses and /v1/messages
(chat only).
|
||
|
|
f4873c8f65 |
provider: WorkBuddy's plugin min 0.2.27, check-in rewards say when they lapse (cdredfox on X)
Raises the WorkBuddy and WorkBuddy AI mover's min to 0.2.27 (npm has it, `npm view --prefer-online` printed 0.2.27). The plugin's runsOutOf now also counts check-in rewards that only the detail lists have, so the Credits and Total windows give the soonest lapse of all of an account's credits and Smart routing (Allowance.Renewal via Limit.RunsOut) spends that account first. Run: mote-run go test ./internal/provider -run 'Moved|Mover|WorkBuddy' ok; go vet for darwin, linux nogui and windows ok; gofmt clean. The plugin's own test (bun test packages/workbuddy, 336 pass) was red on the old code. Not tried: the full suite before the tag (started after it), a real account (the desktop sign-in here was stale). |
||
|
|
b5adaa8bd9 |
provider: Codex's idle check reads a sessions folder in one listing
While Codex is idle each look of KeepOnAnAccountWithRoom asks whether a session was written in the last 30 minutes, and the answer walked every session file of the history: a directory read, a joined path and an lstat() each. With a real-account HOME that walk was the largest thing an idle magpie allocated once dsh's model build went (readdir 3.5 MB, paths and lstat names 2.5 MB of 15 MB in 4 minutes), and a long history (~20k rollouts) is as many syscalls a look. codexSessionsQuietListed reads each folder with dirent.Stats (getattrlistbulk on macOS, Lstat's own times), and the walk stays where there is no bulk listing (Linux, Windows) or a folder can't be read so. The listings are not kept between looks. Run: - mote: go test -count=1 ./internal/provider ok (148s); GOOS=windows and GOOS=linux (-tags nogui) go vet ./internal/provider ok; gofmt clean - xiaomi-gpu (Windows): go test -run TestCodexSessionsQuiet ok (walk path) Broken by hand: the listed path never counting a file new, both TestCodexSessionsQuietFor and TestCodexSessionsQuietListed are red. Not tried: Linux (WSL box down); its path is the unchanged walk. |
||
|
|
bf0a1252fa |
codex: the chat open in the Codex app follows a provider switch (hubo31377762 on X)
Switching Codex between magpie and OpenAI left the chat that was open unusable. The Codex app holds the writer lock of every chat it has loaded, so no move touched that chat's row, and Codex 0.167 refuses to resume a chat whose provider isn't the configured one (modelProviderMismatch openai to magpie, modelProviderNotConfigured magpie to openai). Reopening it did not help. Just before magpie ends the Codex app's app-server for the route change, the held chats are now moved to the provider Codex is on: a paginated one by its row, a legacy plain rollout in place at equal id length (openai and magpie), packed legacy rollouts and other lengths left to the next sync (provider.CodexBeforeAppEnd, agent.codexRetagOpenThreads, sessions.RetagLoadedCodexThreads). The end is a clean SIGTERM and Codex writes nothing back. Run (mote-run): gofmt -l on the three packages; go vet for darwin, windows and linux with nogui over ./internal/...; go test internal/sessions, provider and agent. Real codex 0.167.1 app-server in a sandbox CODEX_HOME, both ways: no retag gives modelProviderMismatch (openai to magpie) and modelProviderNotConfigured (magpie to openai); with the row retagged and the app-server SIGTERMed, thread/resume succeeds on the new provider in both. Broken by hand: the hook call removed and the retag call emptied; both new tests go red (open chat stays on the old provider, order is [end] only). Not tried: the Codex app GUI itself, Windows runs, a packed legacy thread held open (left to the next sync). A resumed thread's sandbox falling back to config.toml's default happens with no provider change and is #6028. |
||
|
|
d401c25951 |
usage: the found-group names hold the catalog, so a usage ask no longer builds it again (#5978)
|
||
|
|
9522288b13 |
groups: WorkBuddy AI's deepseek-v4.1-flash-sg merges with WorkBuddy's deepseek-v4.1-flash (Kts6M2fwWN43967 on X)
Qoder, Qoder CN and Trae merge by one model id: a found group is every model more than one provider serves under the same id (autoGroups, mergeKey), with no pairing of editions anywhere. WorkBuddy AI's account lists deepseek-v4.1-flash under its paid id, deepseek-v4.1-flash-sg (the owner's plugin-providers.json has only that one), so the two editions' one model stayed two rows. mergeKey now reads a small table of editions' twins (editionTwins) after the user's own same-as; it holds that one pair. Run: TestAutoGroupsEditionTwins (red with the table entry removed, green with it), TestAutoGroups*, TestGroupImages* through mote-run. Not tried: a real WorkBuddy AI account's picker. The other id gaps in the owner's lists (WorkBuddy kimi-k3-1 vs AI kimi-k3, auto vs default-model) are not known to be one model and are left. |
||
|
|
a68f114d9e |
lazyre: the plugin name and export file name regexps compile on first use (#6020)
|
||
|
|
5068e46fb6 |
provider: raise ZCode's plugin min to 0.1.58; a coding plan's 1310 leaves the trials (plugins#438)
takomitkm (plugins#438) hit two problems. The busy hold armed with one account and one agent. A GLM Coding Plan model's weekly or monthly limit (1310) also rested the whole account, so its -Trial models got the cached 1310 without being asked. zcode 0.1.58 (ea3573bf in the plugins repo, on npm) fixes the first in the plugin and lists the -Trial entries free. magpie's PaidBesideFree then rests only the refused coding-plan model. Raising the min brings every moved user up to 0.1.58. TestZCodeCodingPlanLimitLeavesTrials holds both sides. With the trials free, the 1310 rests GLM-5.3 alone and GLM-5.3-Trial is still sent. With no free entries, or with another vendor, the same refusal still rests the account. The fake plugin's $FAKE_ZCODE_FREE marks the trials free, as 0.1.58 does. Run (mote): go test ./internal/gateway -run 'TestZCode' -count=1, ok; go test ./internal/provider ./internal/plugin -count=1, ok; go vet of the three packages on mote, in WSL (magpie-desktop) and on Windows (xiaomi-gpu), ok; gofmt -l is clean. All of this at this head, rebased on origin/main. A whole-tree Linux vet in WSL stops at Wails' cgo (webkitgtk-6.0 and gtk4 aren't installed there), so it doesn't cover the GUI. Broken by hand: with the fake's free mark dropped, the zcode 0.1.58 subtest fails, because the 1310 rests the account key. Not tried: a real dual ZCode account that has reached its weekly limit. Reported-by: takomitkm |
||
|
|
5d6935b11a |
provider: the catalog the last request built goes once its time is past
What a request held (heldFor) and what was kept across requests (keptFor:
the catalog, the switched-off providers' models, the groups) were dropped
only when the next request looked. With no request after it they stayed
for the life of the process: with a copy of the real accounts, an idle
magpie's end heap held 7.5 MB of catalog built at start by RenameLegacy
(catalogKept and entriesOf, through piOffered), 16.8% of a 47 MB heap,
for nothing that would read it again.
Now a request that holds or keeps something arms a sweep for when the
first of it is past its time; the sweep drops what is past and arms again
for the next of the rest, or stops when nothing is left. It reads the
durations as the arm read them, so a test setting heldFor meanwhile is
not raced, and a sooner time arms a sooner sweep than one already armed.
TestHeldAndKeptGoWithNoRequestAfter is red with the arm removed (6 held
and 1 kept 10s after the request).
-race on internal/provider: TestSignInDoneOnceTheAccountIsBack (#3100)
and TestPluginCheckinAsksAgainAtUntil (#6014, filed now) race the same
way on origin/main 72f2deebe; the new test passes under -race -count=3.
Ran on mote: go test ./internal/gateway ./internal/agent ./internal/gui
ok at the base 72f2deebe; ./internal/provider ok alone there (in the
four-package run TestCodexListTagNotKeptOverAFreshFile was red under load,
#4216; it passes -count=20 alone). Rebased on
|
||
|
|
b9f8548d22 |
accounts: export ChatGPT and Claude accounts as Sub2API or CLIProxyAPI files (heyiwei5 and Rk1ngggg on X)
WIP commit before the full checks; body rewritten at ship. |
||
|
|
696556e26c |
provider: Google Vertex AI takes an API key (express mode) and a base URL (Langanpaibian on X)
Vertex AI could only be signed with gcloud credentials and a project id. A provider now takes one API key instead: a Key with no project is Vertex express mode, asked at https://aiplatform.googleapis.com/v1/publishers/ google/models/<model>:streamGenerateContent with the key in x-goog-api-key (Google's docs), no project, no token minted. Express serves Gemini models only, so Base(Chat)/Base(Anthropic) are empty and the models list drops partner and Claude models. A key with a project is asked at the project's address, signed by the key. Vertex.BaseURL (optional, /v1 stripped) replaces Google's host for a keyed provider, such as a proxy. Security: a Google token or gcloud credentials go only to Google's own address. A BaseURL is honoured only with a key, and the key is the only credential sent there; without a key Save refuses it and a providers.json holding one has it dropped on load. Wired through: provider.Save/normalize/Sign/Base/planModels, `magpie provider add google-vertex <key>`, `provider key`, `provider set ... url=`, `provider <id>` and the list, the editor's API key and Base URL fields (app.js, 4 translations each), the Providers row pill, and the providers-accounts subsystem page. Run (mote-run): gofmt -l clean; go vet for darwin, linux -tags nogui and windows over ./...; go test -run Vertex for provider, cli, gui, gateway and tui, all green, with new tests TestVertexExpressKey, TestVertexExpressBaseURL, TestVertexExpressEditor (fake server) and the gateway's TestVertexExpressStreams (chat, streamed and whole, asks /v1/publishers/google/models/... with the key header, no token minted); vertex-editor, i18n-keys and ledger-protocol GUI files in chromium and webkit (en and zh editor flows; the i18n check covers zh, zh-TW, ja, de). Broken by hand: Sign without x-goog-api-key turns the provider, gui and gateway express tests red. The existing tests that pinned "a key is refused" now pin the new rules. Not tried: a real Vertex AI key (no account on hand; the endpoint and header are from Google's express-mode docs, the tests use fakes), the full GUI suite in webkit, Windows and Linux runs of the tests. |
||
|
|
71c4ef2d07 |
gui: Bark push target for every alert, and a daily spend summary (EV_John_Liu on X)
Settings > Usage has a Bark row: a server (default https://api.day.app, or
a self-hosted one) and the device key, then Test and Remove. Every alert
that goes through notifier.sendAs (allowance, balance, reset reminder, task
done, masking, sign-in) is also pushed to Bark when a key is set, whether or
not the system lets this computer notify. A second row, once a key is set,
turns on a daily summary at a time of day: today's cost and request count,
and each window or balance near its cap (the Allowance alert's share, else
80%), capped at 8 lines. It is pushed once a day (a restart does not resend;
a failed push is retried every 15 minutes; one more than 6 hours late is
left), in the page's language (en, zh, zh-TW, ja, de).
The device key is a key: the page only gets barkKeySet, never the key; it has
its own route (POST /api/settings/bark, key omitted keeps it, "" removes it),
a Settings save carries it (settingsapi.Merge), and a backup or sync without
keys leaves it out and keeps this machine's. No log line or error names it
(the Bark client replaces it with "..." in what the server or client says).
bark.js is a lazy module so app.js (budget) gains one line.
Run (mote, at the pushed tree before the rebase onto
|
||
|
|
72f2deebee |
provider: raise Grok's plugin min to 0.2.7, speech to text through xAI's /v1/stt (CoderCCz on X)
opencode-grok-auth 0.2.7 (npm, confirmed with npm view --prefer-online) sends /v1/audio/transcriptions to api.x.ai/v1/stt, the route Grok Build's voice dictation uses, so a moved user gets it through keepMovedCurrent. Images already reach Grok: a real 64x64 PNG through the plugin's fetch answered "Red", and the models declare image input. Run: gofmt -l clean; go vet darwin, linux nogui, windows on internal/provider; go test -run TestMovedBuiltins|Mover|Grok on internal/provider; the plugin's own bun suite (112 pass) in the plugins repo with a real ~/.grok sign-in transcribing a wav. Broke by hand: the plugin's transcription branch removed, 4 of its 5 new tests red. Not tried: a built magpie gateway end to end; the full suite before the tag (started after). |
||
|
|
5df062f0f2 |
provider, gui: a Claude account with its provider switched off shows its last reading, or says it is switched off, not "No allowance reported" (Kunlin03 on X)
Kunlin03 (Pro subscription, "Claude Code" switch off): the account's card
said "暂无额度数据". LoginUsage returns nothing for a provider magpie leaves
alone (switched off or removed, leftAlone), so /api/login/usage answered {}
and the card had neither a reading nor an error, although left_alone.go says
what was last known is still shown. Pro versus Max is not the cause: the
read itself (Claude Code's /usage) is the same for both.
LoginUsageShown, used by /api/login/usage and `magpie accounts`, answers such
an account from keepLast (its last reading, readDeferred, "not refreshed this
time") and, with none kept, errLeftAlone, which the card words as "Switched
off, so no allowance is read — switch it on and refresh" (4 languages).
LoginUsage itself is unchanged: warm-ups and switching act on it and must
not take a kept reading for a fresh one. Nothing is requested for a provider
left alone.
Not changed: the Usage page and a card refresh for an off provider (they
read through loginReading as before). Not tried with a real Claude Pro
account; the sandbox has none.
Run (mote): TestLoginUsageShownOfSwitchedOffClaude (red without errLeftAlone
in readDeferred), claude-off-usage-card.test.cjs in chromium and webkit, 5
languages, 2 widths (red with the quotaError branch removed), gofmt, vet
darwin/linux nogui/windows, the provider, cli and gui packages, i18n and
account/usage GUI files.
|
||
|
|
418bb6c9e1 |
codex: Show Codex's own models off leaves them out of Codex's own picker (iiiiiimone on X)
The switch (#1642) only narrowed the Agents page's pickers. Codex's own list, which the gateway hands it beside its sign-in and as the Codex app's list file, kept every model of the ChatGPT account, also with the Codex provider switched off. codexMerged now leaves the sign-in's visible models out when the switch is off (provider.CodexOwnLeftOut); the model Codex is set to, models magpie serves on a ChatGPT account and hidden jobs stay, and the list's ETag carries the switch so Codex asks again. Codex has one openai_base_url for every model, so one it is still set to goes through the gateway to OpenAI on its own sign-in; a model of it can't be sent direct beside magpie's models. Run: TestCodexListWithOwnModelsOff, red with the filter turned off (own models all listed, ETag unchanged); gateway, provider tests at this tree. Not tried: a real Codex app against the list. |
||
|
|
6c3f113cee |
routing: a rule's hours over give the conversation back; looser times (MinglunZhu on X)
MinglunZhu asked twice for a provider by time of day and said the time setting in Routing rules is awkward. Three causes: - A conversation a night rule sent to its member stayed there after the hours: no rule matched the new turn, so Auto affinity kept it on the night's member by its cache (Smart and every routing but In order). ruleFor now sets RuleHit.Ended when the last turn's rule had hours that are over, and affine lets the conversation go (Affinity.Why "hours"); the trace says so in en, zh, zh-TW, ja, de. Tool rounds of a turn begun inside the hours stay put; Session, Strict and In turn keep their own way. - The time boxes took only ASCII "HH:MM", while their numeric keypad on a phone has no colon and a Chinese IME types ":". clockOf (GUI) and clockMinutes (CLI, saved files) now read "22", "2200", "930", "22:00", "22.00", "22点30" and full-width digits; "9:5" is still no time. time=22~08 takes ~ and ~ for the dash. - A new rule starts with an intent box; hours took an × and a +. Adding another condition now drops the intent box while it is empty. A time rule in a nested group doesn't give its conversation back yet: #5977. Run (mote): go test ./internal/provider (ok); go test -run 'TestRuleHoursOver|TestRuleTime|TestRule|Affinity|StandIn|Session|TestParse|Clock' ./internal/gateway (ok); go vet darwin, GOOS=linux -tags nogui, GOOS=windows for gateway and provider; gofmt. GUI, chromium and webkit: routing-time (8/8 after the new trace test's fix), and 28 rule/affinity/ i18n files (routing-rule-*, routing-time*, routing-intent-entry, routing-folder, routing-pause*, routing-smart-intent, routing-save*, routing-rules-line, routing-affinity-*, routing-behind-why, routing-kept-again, routing-session-folder, i18n-keys, i18n-en-no-cjk): 477/481, the 4 reds the new trace test's first wording, fixed and rerun. Broken by hand: affine's "hours" case off -> TestRuleHoursOverGiveThe ConversationBack red (Smart stays on kb by cache); origin's grouprule.go/ruleparse.go -> TestRuleTimeTypedLoosely red; client.js's "hours" case and the intent give-way off -> routing-time 0/4 in chromium; the old clockOf -> routing-time red on "9:00". Not tried: the real app with a real night/day pair of providers; the full gateway package and full GUI suite (the full Go suite runs after the tag); Windows run of the touched packages (vet only). |
||
|
|
72e804d2b5 |
gateway: a provider set Never a fallback takes no other model's request (sonnnnnnnnnnnna on X)
sonnnnnnnnnnnna asked that a request a local uncensored model was given
never falls back to an online provider (Anthropic, OpenAI) when the local
model is full (kv slots) or down, where it could get the account banned.
A provider now has Never a fallback (NoStandIn), off by default: the
Providers page's right-click, under Use first, ticks it; the CLI's
`magpie provider set <id> fallback-for-others=no` sets it. Its keys and
accounts are dropped from a request's plan once a candidate of an
unmarked provider was planned before them (standInsOut, run in planPaused
and in planGroup before restLast and sinkPlanned, so a local model that
failed and is resting still counts as first; a primary with nothing
planned counts too). A request that goes to a marked provider first still
moves on as before, and a weighed group (Smart, Cheapest) that picks a
marked member first sends it there. The dropped rows go to the trace's
left-out list as StandIn; the Routing page says why ("it is set never to
be a fallback for another model"), and the cap, held and barred refusal
checks ignore them so a refusal keeps its old status.
No classifier was built: the model that would judge the request is the
local one that is down, and any other would send the text somewhere the
user didn't choose.
Run on mote (macOS 27) at this tree on
|
||
|
|
065ca02c28 |
provider: Fireworks Nexus preset, Nexus Auto on all three APIs (CNSA0422 on X)
Fireworks Nexus is an account and plan of its own (nexus.fireworks.ai, Pro $8, Team, Enterprise) on the platform's /inference endpoints, which speak chat completions, Responses and Anthropic messages (docs.fireworks.ai/nexus/apis-and-sdks). Its keys are made at nexus.fireworks.ai/settings/api-keys; a platform key carries no Nexus plan. The new preset fireworks-nexus (Add sheet tile "Nexus", the Fireworks logo) sets all three endpoints and lists only `auto`: Pro and Team refuse an open model named directly with a 403 (nexus/open-models), so the platform's /models would offer models the plan refuses, and no list is asked for. Enterprise users type their open models in, or set a models URL. The editor offers x-anthropic-api-key and x-openai-api-key, the headers Nexus Auto takes the user's own Claude and OpenAI keys in. No usage API is documented (only the nexus.fireworks.ai/usage dashboard), so there is no usage card. READMEs (en, zh) and docs/reference.md list it. Run (mote): go test -run 'TestFireworksNexus|Preset' ./internal/provider ok at the pushed head; go test -count=1 -timeout 45m ./internal/provider ./internal/gui ./internal/catalog at the pre-rebase base: provider and catalog ok, gui red only in the real-window AppKit tests killed at their deadline under mote's load (TestCoveredWindowStaysUp, TestClosingWindowMarksPageOutOfSight, TestPanelHiddenByWailsMarksPageOutOfSight; #2645, #4924, #4125). gofmt clean; go vet darwin, linux (nogui) and windows of internal/provider. Broken by hand: without NoList TestFireworksNexusPreset goes red, the fake platform list's accounts/fireworks/models/glm-5p3 listed and its /models asked. Not tried: a real Nexus key (none here), so neither `auto` on each API, the header passthrough, nor what /models answers for a Nexus key; the `auto` context window is left to the catalog (Nexus CLI writes 1M/131K). GUI suite not run: presets reach the Add sheet as data and no GUI file names a preset list. |
||
|
|
7e1858515b |
remote magpie: name its models by the provider serving them there (lcc580 on X)
lcc580 asked for a pass-through on the Remote magpie provider: show the
upstream magpie's own provider beside each model, so an agent can tell the
same model from two of its providers apart. Before, the names followed
both magpies' Provider in model names: with either one Off, both relays'
DeepSeek Chat reached the agents as "DeepSeek Chat · Office" (or plain
"DeepSeek Chat").
- The list a magpie gives another magpie (X-Magpie-Drawers) now names,
as magpie_by, the provider serving each model there (Entry.ServedBy):
"routing group" for a group, and for a model of its own Remote magpie
the provider at the start of that chain. The fetch keeps it as the
model's By (catalog/live.go).
- A Remote magpie provider gets upstreamProviders: the editor's "Model
names" tick ("With the provider serving it there"), or
`magpie provider set <id> upstream-providers=on`. With it on, each of
its models is labelled "DeepSeek Chat · Office › Relay A" in every
agent's list, whatever either magpie's Provider in model names says,
unless the user named the model themselves under Own
(Entry.Label/upstream, LabelsFor). Model settings' "Agents' lists show"
line follows the tick at once.
- Ids are unchanged, so a request still goes by office/relay-b/model.
Off (the default) names everything as before. A remote older than
magpie_by has nothing to add, so its names stay as before.
- The core's scripts stay in budget: four long comments in app.js were
cut to pay for it, no raise.
Run:
- Tests that fail on the old code: TestRemoteMagpieUpstreamNames
(gateway: an httptest remote with two relays' DeepSeek Chat and a
group, every Provider in model names mode, on and off, the third
magpie's magpie_by, ids kept), TestServedByAndUpstreamLabel (provider),
and name-suffix-remote.test.cjs's new case (tick, hint, save body).
- Broken by hand: upstream() returning "" and the magpie_by line removed;
both Go tests went red with the plain labels, then restored.
- Two real gateways, built -tags nogui on the Linux box (WSL) under
sandbox HOMEs: B with Relay A and Relay B both serving deepseek-chat,
A with B as Remote magpie "Office". A's /v1/models before:
"DeepSeek Chat · Relay A · Office"; after
`provider set office upstream-providers=on`:
"DeepSeek Chat · Office › Relay A" / "› Relay B" / "› routing group".
A request for office/relay-b/deepseek-chat reached relay-b on B.
- gofmt -l clean; go vet darwin, linux (nogui), windows on the touched
packages; go test catalog, provider, gateway, cli, gui on mote
(macOS) at the rebased head: ok (catalog 2.6s, provider 165s, gateway 948s, cli 56s, gui 149s).
- GUI on mote, chromium and webkit: name-suffix-remote, remote-magpie,
remote-self, i18n-keys, i18n-en-no-cjk, gui-ja, gui-de, gui-zh-tw,
provider-detect-draft, provider-unmasked, routing-remote-windows,
usage-remote-cards: all green except reds that fail the same on origin/main
|
||
|
|
b9a1b4aa1d |
copilot: each account's own models, listed together and routed only to the accounts that have them (applemacssma on X)
"支持多个ghcp账号轮换和平均负载均衡吗,每个ghcp账号有的模型不一样。"
Several Copilot accounts and the Routing strategies (In turn, by usage)
worked already. What didn't: the copilot provider's list was the first
account's /models alone, so a model only another account's plan has was
nowhere to pick, and the gateway took every account to have every model.
Now each Copilot account's /models is kept as its own (accountModels,
read by Account.Lists), and the provider's list is their union
(copilotPoolModels over poolModels, the body codexPoolModels had). A
fetch of the first account's list also asks the other accounts on: one
with no list at once, of the rest the stalest once its list is a day
old, one per fetch. Only a failed ask is remembered (retried after an
hour). A model Copilot refused one account (model_not_supported) stays
in the list while another account on lists it (copilotOthersList).
Run (WSL magpie-desktop at 425195bf3; mote refused SSH all session):
- go test ./internal/provider/ ./internal/gateway/ -timeout 45m: ok
- go vet linux, GOOS=windows, GOOS=darwin CGO_ENABLED=0 for both: ok
- gofmt -l: clean
- TestCopilotAccountsWithOtherModels: octocat lists gpt-4.1 and
claude-opus-9, hubot gpt-4.1 and gemini-9-pro; the list is the union,
each model goes only to its account under In turn, gpt-4.1 to both.
- TestCopilotRefusedModelGoesToTheAccountServedIt: octocat's list has
gemini-9-pro but Copilot refuses it; it then goes to hubot alone and
stays listed.
Broken by hand:
- copilotPoolModels call removed: the first test red ("lists [gpt-4.1
claude-opus-9 auto], without gemini-9-pro").
- models.go's union check dropped: the second test red (gemini-9-pro
left the list).
- A refusal check in Account.Lists made no difference (the gateway
already keeps a refused account off that model), so it isn't in.
Not tried: real Copilot accounts on two different plans; the full
suite (runs after the tag).
|
||
|
|
71075af726 |
codex: "subagents on any model" tells Codex V1 for a relay of the ChatGPT backend too (brethhbbm on X)
brethhbbm on X: lead on relay/gpt-6-astra, subagent model set to
relay/gpt-6.1-terra, "Codex subagents on any model" on. A new session's
subagents still ran on Astra, and Routing said the task was sealed and
only a ChatGPT account could read it. The model's catalog entry still
said multi_agent_version "v2".
Cause: the setting (settings.CodexAgentsV1) stamped V1 only on the
ChatGPT account's own models (codex/) and the groups one is in (Fast).
The relay lists Codex's own entry for gpt-6-astra (a sub2api asked with
Codex's client_version), "v2" included, and a relay offering Ultra is
given "v2" (AgentsV2) besides. In V2 Codex hands the lead the
collaboration namespace (spawn_agent etc.), whose arguments a relay of
the ChatGPT backend seals as the backend does (#1109), so
codexSubagentPick kept the subagent on the lead's model (sealedKept).
Fix: catalog.Model.Seals (provider.CodexSeals) marks a model whose
provider is of no sign-in on the Responses API, as the gateway's
canSeal, or a group with such a member. With the setting on, its entry
says V1 like the ChatGPT account's, listed by its relay or made by
magpie, so the task goes as text and the model set for subagents takes
it. Seals is in the list's tag, so Codex asks for the list again. A
model of an account that seals nothing (Copilot's Ultra, #656) keeps
V2, and with the setting off every entry is as before. No prompt text
or instructions change.
Real Codex (0.165.0, sandbox HOME/CODEX_HOME, fake Responses server,
model_catalog_json with the user's gpt-6-astra entry as
relay/gpt-6-astra): with "v2" the first request carries the
collaboration namespace (spawn_agent, send_message, followup_task,
wait_agent, ...); with "v1" it has none.
Run (Linux box via wsl-run; mote refused SSH for the whole session):
- go vet -tags nogui (linux), GOOS=windows go vet, GOOS=darwin
CGO_ENABLED=0 go vet -tags nogui on codexcat, provider, agent,
catalog, settings: ok; gofmt -l clean
- go test -tags nogui -count=1 ./internal/codexcat ./internal/catalog
./internal/settings ./internal/provider: ok
- ./internal/agent, and -run 'Codex|Ultra|Subagent|Sealed|Collab|AgentsV1'
./internal/gateway, were still running when this was pushed; their
results go on the release's issue thread if red
- at the pushed head (rebased on
|
||
|
|
10bef5fe09 |
codex: every account shares one list of the Codex app's projects, removals remembered (Michael25651150 on X)
The reporter wants the Codex app's projects kept however magpie switches
ChatGPT accounts. v0.1.3559 (
|
||
|
|
016763f237 |
plugins: host.js passes a usage window's pool and family on, so Antigravity's card shows its pools (plugins#935)
mk311 (plugins#935): the Antigravity plugin's Usage card listed every
model's own window (13 rows, each Gemini one at 85.1%, Claude and
GPT-OSS at 100%), then a bare "7 days" and "5 hours" twice. The plugin
(0.1.0) already groups them as the built-in did: each model's window
carries its family and its pool ("Gemini", "Claude & GPT"), each pool's
own 5 hours and 7 days carry the pool.
|
||
|
|
6886da1ca9 |
provider: Antigravity moves onto @magpie-community/opencode-antigravity-auth
The plugin (plugins e35aa928, 0.1.0 on the dist branch) ports the
built-in's sign-in, project set-up, models and levels, request shaping,
errors and usage pools. This adds its mover, so the hourly MoveRetiring
moves every Antigravity account onto it, with no way back:
- out: each saved antigravity login becomes an oauth sign-in, refresh
"<refresh token>|<project>", access, expires and the email.
- back: splits the refresh again and writes token, expiry and project
into the built-in login, clearing Lapsed and Refused.
- antigravity_pool.go says PLUGIN-SERVED. The built-in code stays until
every account has gone over; Gemini CLI and the agy agent stay built in.
- AGENTS.md lists Antigravity in the moved table.
Run:
- Real move (WSL magpie-desktop, sandbox HOME holding only a copy of the
owner's live Antigravity login, nogui build of this tree):
`magpie plugins move antigravity` installed the plugin, wrote state
"plugin" with the backup; `serve` on 127.0.0.1:3476 listed 11
antigravity models; gemini-3-flash and claude-sonnet-4-6 answered
"pong" through the plugin; /v1/magpie/quotas read the plan
("Antigravity Starter Quota") and each model's window plus both 7-day
pools. The copied login was deleted after.
- TestAntigravityMover (out and back, lapsed and own accounts),
TestMovedBuiltinsSayTheirPlugin: pass on WSL. The test's b-account
check was red until back cleared Refused.
- go vet -tags nogui ./... and GOOS=windows go vet ./... clean;
go test -tags nogui -timeout 45m ./... on WSL (no gtk4 there) at this
head: 92 packages ok, provider/plugin/gateway's own tests included.
Three reds, none on a path this touches:
- internal/agent TestGrokInstalled: WSL binfmt interop, red alone at
|
||
|
|
f92c0a2bdd |
plugins: a plugin is told the effort asked, and its usage windows keep their pool and family
What a ported Antigravity needs from the host, kept generic:
- The gateway puts the request's reasoning effort on a plugin's fetch as
X-Magpie-Effort (provider.EffortHeader), so a plugin that serves one
model at several levels can pick the level. host.js strips it with the
other magpie-only headers, so the vendor never sees it.
- A plugin's usage window may name a Pool and a Family; quotaOfPlugin
passes them through, so PooledWindows names a shared pool
("Gemini · 7 days") as it does for the built-in.
Run (WSL magpie-desktop; mote unreachable, kex reset):
- TestPluginToldTheEffort: xhigh, low and none reach the plugin; the
vendor gets no X-Magpie-Effort. Red with the MAGPIE_ONLY entry removed
by hand (the vendor saw the header).
- TestPluginWindowsKeepPoolAndFamily, TestPluginToldTheSession: pass.
- Full suite: in the next commit's body (run at the head of both).
|
||
|
|
e115b96411 |
plugin: an api sign-in whose prompts ask the key asks no second key
An OpenCode plugin's "api" auth method with its own prompts and an authorize (inkstone's API key ways, Devin's session token in magpie-community/plugins#928) asks the key in its prompts and returns it from authorize(inputs). The GUI asked those prompts and then always showed a key field of its own, so the user typed the same token twice and the second entry went nowhere. The host's save() also copied every answer into the account's metadata, so the token sat there a second time in plain text. - host.js marks such a method keyAsked (type api, prompts, authorize). The GUI's startPluginSignIn signs in with no key field for it, as for keyless, and a rejected answer asks the prompts again on Try again. PluginAPIKey and `magpie plugin` login skip the empty-key check for it (Method.NoKey). - save() keeps only select answers (choices, never secrets) beside the authorize result's own metadata. A method with no authorize still keeps every answer, as OpenCode does. - An authorize that gives no key, with no key typed, is now an error instead of an "ok" that saved nothing. OpenCode itself differs: its v1 CLI (providers.ts) asks the prompts, then always asks "Enter your API key", saves result.key ?? the typed key, and merges the answers into metadata; its TUI never calls authorize for api methods. magpie-community plugins are written for magpie's flow and read the key from inputs, so this follows them. Plugins that read prompt answers back from metadata (grep of magpie-community/plugins packages): zcode (site, a select), joycode (tenant) and agnes (keyProfile, consoleToken). None has an authorize, so none changes. Every api+authorize plugin (inkstone, cloudflare-workers-ai, sensenova, agnes-code, astudio, sap-aicore, Devin #928) puts what it needs in its result's metadata itself; sensenova's apiKey: undefined workaround is now moot. Run on mote (macOS 27, Go 1.26.8, Playwright 1.62.0) at this change on origin/main |
||
|
|
07af9f86a6 |
providers: mark a provider and a routing group on a plan or pay as you go (EV_John_Liu on X)
EV_John_Liu on X asked for pay-as-you-go and token plans to be marked on providers and routing groups. A provider row now carries a quiet grey badge, Plan, Pay as you go, or Plan + pay as you go when its keys are on both (Volcengine's Coding Plan beside a pay-as-you-go key). It is read from what magpie knows: a signed-in subscription is a plan; a plan preset (Kimi Code, Qwen/Bailian token plans, OpenCode Go, ClinePass) is a plan; a preset region's own name (Coding Plan, Token Plan, Pay as you go) decides; other vendor and relay presets are pay as you go. Presets whose billing magpie can't tell (MiniMax, Ollama Cloud, ModelScope and others) and custom endpoints show nothing until the user says: the provider editor's Advanced has Billing (Auto / Plan / Pay as you go), and `magpie providers set <id> billing=plan|payg|auto`. The user's word always wins. A routing group gets the same tag when every on member is known; its title lists each member. Run on mote with these changes on origin/main ccc96b4a7; pushed rebased on |
||
|
|
99b080e2ee |
agents: an agent can have its own Provider in model names (KillTry27355 on X)
"希望 可以在不同的 agent中选择是否显示供应商名字,现在只能统一开关":
Provider in model names was one switch for every agent. An agent's
Details on the Agents page now has a Provider in model names row: As in
Settings · <mode> (the default, kept for everyone), On, Not on names I
set, or Off, for that agent alone. The CLI has the same thing:
`magpie model suffix <agent> [on|own|off|every]`.
- settings.AgentSuffix keeps the agent's own mode by the id its lists are
kept by (Agent.ListsFor, lower-cased, without @wsl: or #profile). An
agent with none follows PlainNames/PlainOwnNames as before, so nothing
a user already set changes.
- provider.LabelsFor(agent, es) reads that agent's mode. Every place
that named models with Labels for an agent now passes the agent: Codex's
catalog, the agents' written lists (route.go, Pi's extension), the
gateway's /v1/models (by agentOf(r)), Muse, Antigravity, Ollama, Claude
Desktop's catalog and descriptions, Claude Science. Labels is
LabelsFor("").
- POST /api/settings/agent-suffix sets it and rewrites the agents'
configs (catalog.Touched), as Settings' switch does.
- docs/subsystems/agent-wiring.md says where the mode is kept and read.
- The picker is in agentsuffix.js, imported when an agent's Details open,
so the core grows by the one line that loads it (1,529,335 of its
1,533,802 budget, after the previous commit's move). An agent whose
list takes no names of magpie's (noNames) has no row.
Tests, each red on the old code: TestAgentSuffix (provider: modes, keys
with @wsl and #profile, reset, bad input), TestAgentSuffixReachesItsFileAlone
(agent: Pi's file follows its own mode while Codex's follows Settings'),
TestModelsListFollowsAgentSuffix (gateway /v1/models per agent),
TestModelSuffixAgentCmd (cli), settings_keep (AgentSuffix survives a
Settings save), agent-suffix.test.cjs (5 languages x 1180/390 x chromium
and webkit, and a noNames agent has no row).
Broken by hand (a copy with LabelsFor ignoring the agent and the picker
reading no own mode): TestAgentSuffix, TestAgentSuffixReachesItsFileAlone,
TestModelsListFollowsAgentSuffix and every agent-suffix GUI case went red.
TestModelSuffixAgentCmd stayed green; it checks what is saved, not the
names.
Run on mote at this change on top of
|
||
|
|
82962db79a |
routing: a rule can match the system prompt or the last user message, by words or a regex, with no model asked (SucroseMoE on X)
SucroseMoE asked for routing on plain string and regex matches instead
of an intent model: `system[0] matches /^你是对话标题命名/` → model A,
`user[-1] matches /^正在上下文压缩/` → model B, so any harness's title
and compaction calls can be routed without a classifier.
Two new rule condition fields, beside message/effort/subagent/agent:
- system: any block of the system prompt as the agent sent it (Anthropic
system blocks, Chat system/developer messages, Responses instructions
and system/developer items, Gemini systemInstruction). Any block, not
only the first, because Claude Code's first block is its billing
header.
- last: any text of the request's last user message as sent, reminders
the agent adds included, so an anchored ^ still meets a compaction ask.
Ops for both: contains, doesn't contain, starts with, matches (regex,
case-insensitive; a value written /…/ has its slashes dropped). The
gateway reads system and last only when a rule asks (RulesRead), and
decodes raw system JSON lazily then. Like every rule, the decision is
made as a turn starts and its tool rounds keep it.
GUI: Routing → group → Rules, "+" on a rule row offers "System prompt text"
and "Last user message" pills (no modal), with tooltips, placeholders
and the bad-regex mark; zh, zh-TW, ja, de. CLI: `--when "system matches
^You are"`, with aliases system[0], user[-1], last-user. TUI hint, docs
(gateway-routing.md, site start pages) say the same.
Ran, on mote (macOS) until its sshd began refusing connections: gofmt
-l internal/ clean, go vet of provider/gateway/cli/tui, the rule tests;
the routing GUI files (routing-rule*, routing-rules-line,
routing-pause*, group-*, i18n-*, routing-compact, routing-intent-*,
routing-smart-intent) in chromium and webkit: 751 of 781, the 30 reds
being "System prompt" taken by a core word (now "System prompt text"),
routing-rules-line's + menu count (now with system and last), and
routing-intent-entry, red on main since
|
||
|
|
248268ce4c |
codex: a switch of the preferred account leaves the Codex app running unless asked (Michael25651150 and ykj5353 on X)
After v0.1.3562 a switch of Codex's ChatGPT account made by hand in
magpie, between accounts that both had room, still ended the Codex
app's app-server with "Restart the Codex app when magpie switches its
account back" off. The app shows that as an error, relaunches, and
signs in as the new identity. ChatGPT.app 26.1103+ keeps its sidebar
projects per ChatGPT identity (electron-account-renderer-state-v1), so
on an identity that never had them it shows "没有项目" and every thread
under Recent: ykj5353's screenshot is the Codex app's sidebar, not
magpie's Sessions page.
codexAppStep no longer counts c.switched && !c.auto as by hand. Such a
switch is left running, logged, and the account rows' "still signed in
as" notice with its Restart is the way to follow, as for magpie's own
switch back. Still restarted with the tick off: a switch off a used-up
account (needed, the app greys Send there), Connect/Disconnect, the
takeover in and the takeover turned off by hand. RestartApp on restarts
on every switch as before.
Run (mote, at base 40ca0c88d; rebased onto
|
||
|
|
980a4b981f |
provider: an answer naming only five_hour keeps the week kept on disk (ifccod7391564 on X)
On a cold start nothing of a Claude account was in claudeUsage, so the first rate_limit_event, which often names five_hour alone, became the account's whole reading: withHeardClaude laid that one window over the card read from quotas.json, and the 7-day ring, not renewed yet, was gone. NoteClaudeLimits now merges what an answer tells into what is kept, and with nothing in memory into the windows quotas.json kept that haven't renewed since (keptClaudeWindows). A renewed week isn't brought back. quotas.json is read before claudeUsage is held: lastQuotas has its own lock. Run (wsl-run, magpie-desktop; mote refused SSH the whole time): - go test -count=1 -timeout 45m ./internal/provider ./internal/agent: provider ok; agent ok but TestGrokInstalled, the known WSL2 binfmt red (#3548), unrelated - TestNoteClaudeLimitsKeepsTheWeekOnDisk on Windows (win-run): ok - GOOS=linux go vet -tags nogui ./internal/..., GOOS=windows and GOOS=darwin (nogui) go vet of agent/provider/gateway: ok; gofmt -l clean Broken by hand: NoteClaudeLimits ignoring the disk (kept = onDisk[:0]): the new test is red with the card holding only "5 hours", as reported. Not tried: a real cold start against a real account's rate_limit_event; the macOS run (mote down). |
||
|
|
0f94acc994 |
provider: Kiro's mover min is 0.1.36, the overage against its own cap (wizcheu on X)
wizcheu on X, Kiro Power (10000 credits) with overage on: magpie showed 12589.24 / 37500 where the Kiro IDE shows 10000 / 10000 in plan and 2589.24 post-paid. The plugin took the overage cap for the month's whole limit. Kiro plugin 0.1.36 (plugins 5292fc9f, on npm) shows the plan's credits (shown only) and an "Overage" window against the cap, which counts the overage alone; that window stops the account. This raises the mover's min so every moved Kiro user gets it, and gives the new window name "Overage" its zh, zh-TW, ja and de words. Run (mote, macOS, at this commit): - go test -count=1 ./internal/provider: ok. - go vet ./internal/provider for darwin, linux (nogui) and windows: ok. gofmt -l: clean. - node --test i18n-keys and i18n-en-no-cjk: 8 pass, 0 fail. - npm view --prefer-online @magpie-community/opencode-kiro-auth version: 0.1.36. Plugin side: bun test packages/kiro 172 pass; origin/main's index.mjs under the new tests is 6 red, a region used up by its plan instead of its overage is 1 red. Not tried: a real Kiro account with overage on, nor the GUI card with the new windows in a browser; the full suite starts after the tag. |
||
|
|
617200a320 |
providers: Vercel AI Gateway is a preset (Archie627 on X)
Archie627 said magpie has no Vercel AI Gateway. It is now a preset in Add: Chat Completions and Responses at https://ai-gateway.vercel.sh/v1, Anthropic Messages at https://ai-gateway.vercel.sh (Vercel takes the key as Bearer there too), models.dev's "vercel" catalog, the vercel icon the vercel-jev decision preset already used, and its API keys page. An OpenCode or URL import at that host becomes the preset. READMEs and the site's import pages (en, zh, ja) list it. Its /v1/models (public, 505 rows today) marks each row's "type". Read as before, the decision models (liquid/d1, typesafe-ai/jev) and realtime voices showed as chat models, ElevenLabs voices were dropped, and transcribers (elevenlabs/scribe-v2) showed as chat. At Vercel's host alone (catalog.VercelGateway) the type now decides: evaluation and realtime rows are left out, speech, transcription, embedding and reranking rows get their Serves, image rows draw and video rows film. The 48 "-batch" ids are left out: Vercel's docs say "Synchronous requests don't accept -batch IDs". context_window gives the window. Another host's "type" is read as before. Run: TestVercelPreset and TestVercelLiveList (real rows from Vercel's list in testdata, served through an httptest server, no network); go test ./internal/catalog ./internal/provider on Linux (wsl-run) and macOS (mote, -run Vercel|Preset|Import before mote stopped taking SSH); gofmt; go vet linux, windows, darwin (CGO off). Broken by hand: VercelGateway returning false turns TestVercelLiveList red (decision, realtime, batch and transcriber rows back in chat); the -batch skip alone turned off turns it red too. Not tried: no Vercel key, so no real chat, Responses or Messages call; only the public GET /v1/models. No GUI file reads the preset list by name (the Add sheet is built from /api/presets), so no GUI run. |
||
|
|
2fbead7983 |
provider: a relay URL typed without its /v1 (CRS's …/openai) is tested, detected and listed under it (Cyrus_4433 on X)
Cyrus_4433 added a claude-relay-service provider as OpenAI compatible at
http://<ip>:55088/openai. The list couldn't be fetched and Test models
said "gpt-6.1-sol: 404 · Not Found". From CRS's src/app.js and routes:
/openai mounts unifiedRoutes (POST /v1/chat/completions) and
openaiRoutes (/responses, /v1/responses); /api mounts GET /v1/models.
There is no /openai/chat/completions or /openai/models, and anything
unrouted is 404 {"error":"Not Found",...}. magpie asked base +
/chat/completions, i.e. /openai/chat/completions.
- probe: a Chat/Responses 404 at an unversioned base equal to the
provider's URL is asked once more at base/v1/... (missingV1; not
accounts, Azure, Bedrock, Vertex). Answered OK there, the saved URL
takes /v1 (setV1) and the result carries it (Result.V1); Detect uses
it as the base; the editor's URL field follows (draft.onV1) so Save
doesn't undo it. A 404 at both stays the first 404.
- catalog: an unversioned …/openai base is also listed at
<origin>/api/v1/models (RelayOpenAIList), and fixV1 adds /v1 when the
list answered there.
Run (WSL magpie-desktop via wsl-run; mote's sshd reset every
connection this session):
- at 630b0de98 (this change on
|
||
|
|
f1996e7e5d |
gateway: a provider named past its usage cap is not sent on to a group (Anotiaww on X)
Anotiaww on X: magpie on server B asked magpie on server A for claude/claude-opus-5-5. A's Claude account was past its usage cap (the trace: "a usage window at 98%, over the account's 98% cap"), and the Claude provider had no fallback set. The request was answered by a WorkBuddy member of the user's routing group claude-opus-5.5 (the trace row marked Fallback), with nothing said. They expect the cap's refusal. Cause: |
||
|
|
6b92824ff5 |
usage: a window's whole also at base rates, without long-context premiums (#5861, Norethcy on X)
A window's whole (WindowHolds) is priced at API list prices, which charge
GPT-6.1 Sol's input above 272K at a premium a subscription's own use
doesn't pay. A cycle with more long calls then reads as a larger
allowance: NorethSea's previous week came to $76.56, $53.52 without the
premium, against $56.99 for the current one.
Each priced call is now also costed at its model's base rates, the
long-context tiers left out and a peak hour's price kept (baseRates), and
the window's whole sent as BaseCost beside Cost, only when the two differ.
Past cycles get it too (HistoricalWindowHolds goes through windowHolds).
On the card the figure then says which it is ("≈ $76.56 API") and is a
button: a click switches every card, past cycles too, to the base figure
("≈ $53.52 base") and back, moves nothing, and is kept in the browser.
Its tooltip names both and says neither is an official dollar allowance
or a fixed quota. A window that paid no premium is drawn as before. The
ledger's and the API's real cost are unchanged. #4181 (auto-review calls
counted in the whole) is not part of this.
app.js and the core stay in their budgets with holdsLine's and holdsWhy's comments cut, no raise.
Run (mote's sshd reset every connection, so on the Linux box through
wsl-run; the package run at base
|
||
|
|
4921bf5a97 |
usage, sessions: one model option for a found routing group's two ids (#5892, Norethcy on X)
A found routing group is called by its public id (auto/<model>) and is kept as group/auto-<slug>; calls recorded under either were counted as two models, so Usage › Sessions' model filter listed the same group twice and the ledger, summaries and session lists split its calls. Ported from NorethSea's 30d6261cd on their fork: UsageAlias names a found group by its public id before the user's alias (both spellings, old session files too), sessions' lists, the ledger keyer, the summary cache's key and Codex's model/effort read through it, and a cache keyed on the group names (UsageNamesKey) is read again when a group is renamed. A user's own provider named "auto" keeps auto/<model> (autoRefsOn). Changed in review: the patch's ledger filter compared every record with provider.SameRef, which reads the providers (customIDs, a stat of providers.json) for each record a filter passes over. FilterOf, the one place a Filter is made from a query, now canonicalizes the model once, and keepsRecord asks the providers only for an auto/ record under a group/ filter (sameGroupModel). Run (mote's sshd reset every connection all afternoon, so on the Linux box through wsl-run; the package run at base |