Commit Graph
319 Commits
Author SHA1 Message Date
yetone c08231ee25 usage: a window reads as how much is used or, as the vendors' own apps show it, how much is left — Used / Left on the Usage page, or a click on the figure, flips every meter and its bar, kept for next time; the label says which (64% used, 36% left). A window with the vendor's own count shows the percentage too (345 / 28000 · 1% used, issue #90). The terminal's usage page shows the accounts too — subscriptions' and plans' windows as meters, keys' balances — asked of the vendors when it opens and on r, u to flip used / left 2026-09-26 23:03:41 +08:00
yetone 1d064efe4d provider: TestContextSetByUser gives the config dir a place, so the Devin CLI a saved group asks writes its config there, not into internal/provider/devin 2026-09-26 23:02:05 +08:00
yetone 97d4b3154e gateway: a model's id without a provider in it that names a routing group is served by the group — gpt-6-sol goes where group/gpt-6-sol goes, its cheapest member first and the next when one fails, where it went to the first provider that serves it with no failover; and a found group is named however a vendor spells its model, so grok-4-7 (the group of grok-4.7) is served rather than unknown. With no group it is one provider's as before, a provider/model id is always that provider's, and the Routing view shows the group it went to. Asked on Discord 2026-09-26 23:01:53 +08:00
796dac8de9 agent(pi): a magpie model tells Pi how long a reply may be — maxTokens from the model's output limit, where Pi otherwise capped every reply at 16384 tokens (#91)
* agent(pi): a model through magpie tells Pi how long a reply may be — Pi's models.json got contextWindow but no maxTokens, so Pi capped every reply at its default 16384 tokens, Claude Opus and GPT groups that can write 128K included; each model now carries maxTokens when its output is known (a group's is the smallest of its members'), as DSH and OpenCode's limit.output already do

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* drop internal/provider/devin/config.json, a file a provider test leaves behind

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: yetone <kumw95ya25@gmail.com>
2026-09-26 22:57:15 +08:00
yetone cd3222d213 intent: a turn that only carries on from the one before — 继续, 好的就这么做, fix that — is of the kind that one was; the classifier is told what it said of the conversation's turn before, as it only saw the new message and put 继续 after a 复杂任务 among the simple ones. A message that asks for something of its own is still classed by itself (你是谁 after a 复杂任务 is 简单任务), and the Routing view says what it was told 2026-09-26 22:51:17 +08:00
yetone 13aa2049a4 intent: a group whose intents are levels — 简单任务 and 复杂任务, how hard a request is — has every message in one of them; the classifier was asked which kind of request a message is, with 0 for none, and put 你是谁 and 你好 in neither, so those turns matched no rule and went to the group's usual route (Claude Opus) rather than the simple one. It now picks the kind that fits best, answering 0 only when a message is plainly none of them: groups by topic still get 0 for a greeting or a poem 2026-09-26 22:39:30 +08:00
yetone ea5d089b4a gui: the Agents and Providers pages open at once again — the Providers page worked out each agent's model and routing group again for every provider (every provider's models read again each time, Alma asked over HTTP each time), so it took 25s with many providers; now once per page. What is parsed from a file is kept until the file changes (Codex's models cache, the vendors' model lists, ~/.claude.json's account, and an agent's TOML config — Codex's can run to megabytes of trusted projects, and was parsed again for every field); and what Alma answers when magpie only shows what it is on is reused for five seconds, as its providers take most of a second each time, while a change and what it reads first still ask Alma. /api/providers 25s → 0.02s, /api/state 7s → 0.1s 2026-09-26 22:25:28 +08:00
yetone dc10604f8e usage: gofmt the #90 test 2026-09-26 22:22:30 +08:00
yetone 6584fdd132 usage: the plans left out as ZCode's own are left out of a copy, not of PlanQuotas' cache, which a later ask within the minute would have found shifted and emptied. Issue #90 2026-09-26 22:22:18 +08:00
yetone f02d37bba9 usage: a GLM Coding plan read with a Zhipu or Z.ai key is shown once when ZCode is signed in to the same account — the plan's card is left out when ZCode's card has its windows resetting at the same moments (the account's own), ZCode's card, which counts the calls, kept; another account's plan still has its card. Issue #90 2026-09-26 22:21:31 +08:00
yetone 0218eeb5ca rtk: an agent left with the hook of an rtk that isn't installed (never was, or removed since) is shown with RTK missing — its shell commands fail — and can still be switched off: magpie takes out just what rtk's installer put in (the hook in settings.json / hooks.json, RTK.md and the @RTK.md line, Gemini's hook script, Copilot's instructions block, the OpenCode / Pi / OMP extension, Hermes' plugin) itself, needing no rtk, the files kept aside first; rtk's own uninstaller is no longer used, which deleted Gemini's GEMINI.md whole and took Claude Code, OpenCode and Cursor away together. Gemini is given rtk hook-only, so the user's GEMINI.md isn't written over. Install RTK on the page (and magpie library rtk install) installs rtk with Homebrew, winget on Windows, or rtk's own script into ~/.local/bin, only when clicked 2026-09-26 21:53:05 +08:00
yetone 2eb5015df3 accounts: Codex is signed in to its next ChatGPT account when the one it is on has used its allowance up — the Codex app, knowing its account is out, may not send at all, so magpie's failover never saw the turn: now the magpie serving the gateway looks every five minutes and, with another of Codex's accounts on in magpie that has room, switches Codex to the first of those as the Accounts page would (the one out stays on, next in line); a Codex started after that is on it. An account rests by its user, so the one Codex is switched to doesn't take over the rest of the one it left. Asked on Discord 2026-09-26 21:32:42 +08:00
Zhizhen HeandClaude Code f2a30647d0 edit: a table's name is the parser's own key path, so [ a . b ] is the table a.b — space or tab around the dots of a header (both valid TOML) is not part of the name; a provider table a user wrote that way is reused in place, edited and taken away again as if magpie had written it, where before it was invisible and magpie appended a duplicate, refused as invalid TOML
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-26 21:12:32 +08:00
yetone 0f0b8fc87e gateway: Codex on one of its own models moves on to the next ChatGPT account when the one it is signed in to has used its allowance up — with more of Codex's accounts on in magpie, Codex's requests go through magpie even for its own models (openai_base_url kept, and put back or taken out as accounts are switched on or off) and are served as the codex subscription's, which fails over as its other models do; the account out of allowance rests until ChatGPT says it resets (resets_at), up to an hour at a time. Asked on Discord 2026-09-26 21:11:42 +08:00
yetone 04a189b863 update: a version downloaded and waiting for the restart no longer stops magpie looking for newer ones — the check every six hours still runs, and clicking Update asks the feed again first: a newer release out since is downloaded in its place (the badge shows the download, then restarts), so the restart goes straight to the latest instead of one release at a time. Asked on Discord 2026-09-26 21:00:33 +08:00
yetone 06dddf7f68 update: magpie update in a Homebrew install (brew install magpie, from the new tap in magpie-releases) says to brew upgrade magpie instead of replacing the binary in brew's Cellar, which would leave brew thinking the old version is there 2026-09-26 20:50:26 +08:00
yetone c4268e524f providers: a provider's id can change — its editor has an ID field (magpie provider set <id> id=<new> in the CLI), and renaming it moves what named it by the old one: the agents on its models (each spelled its own way, recorded as magpie's), the routing groups' members, rules and classifier, other providers' fallbacks, which agents are shown it, and the vendor's fetched list. The old id stays with it, so an agent still running on the old config reaches it, a profile saved before applies to the new id, and its usage so far is counted under the new one. Asked on Discord 2026-09-26 20:22:30 +08:00
yetone 87fb06d2f9 tui: a library page (5) — the shared instructions, MCP servers and skills magpie gives the agents, and RTK: ↵ lists the agents that can have one, each switched on or off in place; e edits the instructions in $EDITOR; the servers and skills found in the agents are listed too, i brings one into the library; d twice takes one out. The same data as the app's Library. Asked on Discord 2026-09-26 19:40:58 +08:00
yetone 631e4c3096 library: RTK (rtk-ai.app) can be switched on per agent — a Library tab lists the agents RTK has a hook for (Claude Code, Codex, Gemini CLI, OpenCode, Cursor, Copilot, Pi, OMP, Hermes), each with a switch that runs RTK's own installer (rtk init -g …) for it, keeping the files it edits aside first; which have it is read from their files, and the tab says RTK's version and the tokens it saved. RTK's installers for OpenCode and Cursor give it to Claude Code too, and its uninstaller for Claude Code or OpenCode takes all three: magpie keeps each switch to its own agent. magpie library rtk [on|off <agent>] does it from the CLI. Asked on X 2026-09-26 19:25:23 +08:00
yetone 7a3c434610 agents: Alma — magpie wires it through Alma's local API (localhost:23001, while Alma runs): choosing one of magpie's models for Alma adds a provider named magpie there (OpenAI type, the gateway's /v1, key magpie), offers magpie's models in it and makes the model Alma's default chat model, the rest of Alma's settings and its other providers left as they are; the list is kept current as magpie's catalog changes, and going back to Alma's own takes magpie's provider out. Asked on Discord 2026-09-26 19:18:51 +08:00
yetone 0e07ebd1b2 providers: the context window can be set in the app — a provider's editor has a Context window field, 128k for all its models or gpt-6=1m for one, comma separated, which agents are told over what the vendor or models.dev says (as magpie provider set … context= already did); empty leaves it to them again. Asked on X 2026-09-26 19:16:37 +08:00
yetone 4790c06b02 usage: each call keeps where it went — the provider's host, or the account it was — so a provider id later pointed somewhere else no longer puts the earlier place's tokens and cost under the new one: a model's usage is told apart by host (provider/model @ host) when its provider went to more than one place in the period, or to somewhere other than where it goes now. Asked on Discord 2026-09-26 19:03:14 +08:00
Jeremy Levartovsky 48071e9ab9 gateway: a Claude reply cut off by the context window says it was cut off (#88)
Claude 4.5 and later stop with model_context_window_exceeded when the
reply runs into the context window before max_tokens. It was read as a
normal end, so a Chat Completions client got finish_reason "stop" and a
Responses client status "completed" for a truncated reply; it now
reads as length, as max_tokens does.
2026-09-26 18:59:26 +08:00
yetone d05763a5dc opencode: each model of magpie's carries its window (limit.context), a group's context= with it, so OpenCode compacts when the model needs it and not at its own guess; and magpie sync puts magpie's provider back into opencode.json when a model of magpie's is chosen there but the provider is gone. /v1/models says each model's window too (context_window, context_length, max_input_tokens, max_output_tokens). Asked on Discord 2026-09-26 18:50:04 +08:00
yetone 5dbd28c39e zcode: what you choose in ZCode for magpie stays — the provider turned off stays off, its rule stays where you moved it, and a rule you removed isn't put back on the next sync. gateway: a model that always thinks (GLM-5.3 answers 1210 to thinking turned off) is asked again with thinking left to it, rather than failing. Asked on Discord 2026-09-26 18:45:49 +08:00
yetone 9b06c30790 balance: a custom provider's balance field can name several amounts, each with a label, apart by ";" — Command Code's credits reply is 5h: windowLimits.fiveHour.used / windowLimits.fiveHour.cap %; week: windowLimits.weekly.used / windowLimits.weekly.cap %; $credits.monthlyCredits, shown as "5h 0% · week 3.4% · $70.00" wherever the balance is (Usage, magpie provider, magpie quota). Asked on Discord 2026-09-26 18:41:01 +08:00
yetone a1dd2b1222 routing: a turn on one of Codex's own models (gpt-5.5 and the rest, which go to ChatGPT with Codex's own sign-in) shows in the Routing view's live trace as those on magpie's models do — before, only magpie's were traced, so Codex on its own models showed nothing going on. Asked on Discord 2026-09-26 18:31:46 +08:00
yetone a77f7c1fcc gateway: a test that when a rule's vision model fails, the text-only member that answers is sent the conversation without its older images (#87) 2026-09-26 18:25:16 +08:00
Charan RathoreandCharan Rathore d583acaf46 fix: avoid sending group images to text-only fallbacks (#87)
Co-authored-by: Charan Rathore <charan-rathore@users.noreply.github.com>
2026-09-26 18:25:34 +08:00
yetone d2da93ef11 group: an unlisted text-only model still keeps images out of its group — whether a group takes images was asked of the listed models only, so an image went to a member kept out of the pickers that can't see it; now every member counts, as for the context since #86 2026-09-26 17:52:54 +08:00
Charan RathoreandCharan Rathore 70a37c63f1 fix: count unlisted group members when routing long turns (#86)
Co-authored-by: Charan Rathore <charan-rathore@users.noreply.github.com>
2026-09-26 17:52:49 +08:00
yetone f0bd9fac87 cursor: its models have a context window — 1M for the ones Cursor names 1M, else 200K (less where the model's own is smaller), so Codex, Pi, OpenCode, Crush and the rest no longer take them for a small or unknown window; and Claude Code is given a 1M model as <id>[1m], its mark for one, so it no longer compacts at 200K (it drops the mark before asking, and magpie takes a value with it too). Asked on X 2026-09-26 17:49:06 +08:00
yetone 7b69b22a76 quota: what is left of every subscription, plan and key balance, for scripts and agents — magpie quota [<provider>] [--json] prints each window's use and remaining percent and when it starts again, and each key's balance; the gateway answers the same at GET /v1/magpie/quotas (only to this machine, as it names the accounts), so an agent can pick where to send its work (#85) 2026-09-26 17:22:00 +08:00
yetone c0e6d985de library: ZCode gets the library — its instructions go to ~/.zcode/AGENTS.md, its skills to ~/.zcode/skills and its MCP servers to ~/.zcode/cli/config.json's mcp.servers, where ZCode's own MCP settings keep them (a server of the user's there, and the file's other keys, stay as they are). magpie library … agents no longer takes an agent it has no place in for that: an unknown one, or one without MCP (omp) or instructions (Cursor), is refused with why, instead of recorded and given nothing (asked on Discord) 2026-09-26 16:18:56 +08:00
yetone ef26a21da9 tui: providers, groups and usage have pages in magpie tui — 1–4 (or [ ]) goes between agents, providers, groups and usage. Providers: ↵ turns its models on and off, e its key, a adds one of the presets, f its family, u unlisted, t tests it, b its balance, d removes it. Groups: ↵ opens one to add (a), move (J/K) and take out (d) its models, o its routing, f its family; n makes a new one, d removes it. Usage: today, 7 days, 30 days or all time (←→ t w m A), its tokens, calls, cost and errors, a bar a day, and by agent and by model. Asked for on Discord 2026-09-26 16:15:46 +08:00
yetone 73be42eca8 models: each agent can be shown only some of them — a provider or group gets a family (magpie provider set relay-x family=relay), and magpie visible zcode relay shows zcode only that family's models (or named providers and groups): in the files magpie writes for it and in what /v1/models answers it, told apart by its User-Agent; magpie models zcode lists what it is shown and what is kept from it, and magpie visible zcode all shows it everything again. A model kept from an agent is still served when asked for by name. Asked for on Discord 2026-09-26 16:02:29 +08:00
yetone 99fc679e38 sync: a passphrase that is the WebDAV password is refused — the server is sent the password, so with it the server could open the file it is only meant to hold sealed; pick a passphrase of its own 2026-09-26 15:54:16 +08:00
yetone 1c960ac62e claude: a turn in which Claude answered with two tool calls no longer gets stuck — Claude Code makes its MCP calls one after another, so the second was made only once the first had its result, while the agent ran both and sent both results back at once; the second result, for a call not made yet, was dropped, and Claude waited for it while the agent waited for Claude. A result sent before its call is now kept and handed over as the call is made, and only the results sent since the last answer are looked at (#84) 2026-09-26 15:51:13 +08:00
yetone 189c8949ed codex: one of Codex's own models picked while Codex is signed in with an API key OpenAI refuses (one a relay issued, left in ~/.codex/auth.json) failed with OpenAI's bare 401 "Incorrect API key provided" on every turn; the refusal now says it is Codex's own sign-in that was refused and to pick one of magpie's models in Codex or sign Codex in again 2026-09-26 15:14:33 +08:00
yetone c83e03d5c7 provider: how long a request a model takes can be set — magpie provider set <id> context=272k (all its models) or context.<model>=1m, and magpie group set <id> context=… for a group, which otherwise takes its shortest model's; agents are told it (Pi's contextWindow, ZCode, Codex's catalog, Grok, omp, dsh) over what the vendor or models.dev says, and the Providers and Routing views keep it when saved. An empty value clears it 2026-09-26 14:39:55 +08:00
yetone 0f9d60db07 library: the MCP servers an agent's app writes into its config itself (Codex's node_repl and cua_repl, run from inside its install) are told apart — not offered to bring in, shown as the agent's own and left as they are; magpie library lists what agents have that the library doesn't 2026-09-26 14:34:53 +08:00
yetone 5f839eae99 provider: saved Claude or Codex accounts that are not offered say why — under a HOME where the agent is not signed in (a magpie serve with its own HOME, no ~/.codex/auth.json or ~/.claude/.credentials.json there) they went missing without a word; magpie serve, magpie providers and the Providers view now tell 2026-09-26 14:32:48 +08:00
yetone cb609d2cb4 update: after an update on Windows one magpie is left, not two — a magpie running when another updated the binary (it runs on from magpie.exe.old) no longer downloads the update again to magpie.exe.new and swaps it in when it quits; it says a restart is all that is left. A magpie.exe.new that is magpie.exe over again is removed at start. The tray that found the gateway taken serves it once the magpie that had it is gone, checked every 15 s 2026-09-26 14:30:16 +08:00
yetone 6b39a69bf4 provider: a balance field can be a sum — paths into the reply and numbers with + - * / and brackets, "(1 - credits.monthlyCredits / 70) %" for what is left of a plan, a "%" after it showing a percent of 1; "data.total / 500000" and "$data.x" read as before 2026-09-26 14:26:28 +08:00
yetone 6bc43d5dab gui: on Windows, Open folder finds Explorer where Windows keeps it — it was looked for on PATH, and a magpie started without the Windows folder on its PATH said exec: "explorer.exe": executable file not found in %PATH%; now %SystemRoot%\explorer.exe. A PATH taken up from the registry after an install had %SystemRoot%\system32 made C:\Windows$\system32; it is expanded as Windows does 2026-09-26 14:22:47 +08:00
yetone 67c539d5da gateway: secrets can stay on the machine — with Settings › Privacy › Mask secrets on, API keys, private keys, tokens, JWTs and the passwords of connection strings and assignments in what an agent sends go to the vendor as placeholders like {{API_KEY_k3v9x2mq}}, and what the vendor answers has them back, streams included (a placeholder split between two events is put back whole, a tool call's arguments get the value escaped); personal data (emails, phone numbers, ID and bank card numbers, checksum-checked) and the user's own words can be masked too. A placeholder is the same for the same value every time, so a conversation's history and what the vendor cached of it stay the same turn after turn, and the request log shows what the vendor saw. Suggested on X as maskit's idea; written from scratch 2026-09-26 14:21:14 +08:00
yetone cdd1e8e7a4 group: a group's id can change — a group magpie found is group/auto-<model>, and agents could only pick it by that; now its id (any group's) is changed in the editor or with magpie group set auto-gpt-6-astra id=gpt-6-astra: the found one stays removed under the old id, the groups that have it in them and their rules follow, and an agent set to the old id is told it needs setting again (#83). magpie groups no longer says a group in a group is not served 2026-09-26 14:14:26 +08:00
yetone 0849cce8a1 gui: on Linux the window has no system title bar over its own header — GNOME drew one (the name and a ×) stacked on the tabs; the window now keeps GNOME's shadow and resize edges but shows no bar, and the page's header is the title bar: the icon and name, dragged to move, double-clicked to maximise, and a round × that hides the window to the tray. Reproduced and checked on Fedora 44 GNOME 50 (Wayland) 2026-09-26 14:06:45 +08:00
yetone fa9f018a93 gui: on Windows, Open folder starts Explorer and leaves it to open — Wails' way ran it on the thread the windows are drawn on, waited for it and killed it after ten seconds, and the buttons did nothing there; a folder that can't be opened now says why instead of nothing happening 2026-09-26 13:59:02 +08:00
yetone 67056512e0 codex: back on one of Codex's own models after another vendor's, the conversation goes on — another vendor's reasoning (an rs_… id with nothing sealed in it, as Volcengine writes it) went on to OpenAI, which keeps nothing (store is false), looked the id up and answered 404 "Item with id 'rs_…' not found" on every turn and compaction; it now stays out, and an item OpenAI still refuses (sealed content it can't verify, an id it doesn't have) is taken out and the rest asked again instead of the session stuck on it 2026-09-26 13:59:01 +08:00