Commit Graph
439 Commits
Author SHA1 Message Date
yetone b1fa0c5dfa gateway: to the key magpie-claude-desktop, /v1/models lists every model by an id Claude Desktop takes — anthropic/<id> for one that doesn't say claude, sonnet, opus, haiku or anthropic — so its Test connection passes and its models can be picked from the list 2026-09-28 10:24:56 +08:00
yetone c887c041f9 devin: a pinned variant has its family's window — claude-opus-5-5-high and the rest were listed with none, so Claude Code, not seeing 1M, took them for 200K and magpie gave them no [1m] mark; a list fetched before is read with the windows too 2026-09-28 10:24:55 +08:00
yetone e1f784430b gateway: Claude Desktop's third-party gateway reaches any of magpie's models — it takes only ids that say claude, sonnet, opus, haiku or anthropic, so a model asked for as anthropic/<its id> is served as <its id> when nothing answers to the id as it stands; count_tokens and /v1/models/<id> read it the same, an id with a slash in it is found at /v1/models/<id>, and GET/HEAD /api/hello answers the gateway's probe 2026-09-28 10:17:05 +08:00
yetone ddf2ef83f5 panel: a meter in the tray's panel turns used or left when clicked, as the Usage page's do, and says so when pointed at — the one setting for every meter and the menu bar (#124) 2026-09-28 10:11:42 +08:00
yetone c6dc08e105 sync: an address at OpenList's or Alist's /dav/ says to go into one of its storages, naming them — the list of storages there takes no folder (MKCOL 405, as if it were there) and no file (PUT 404), so a first sync failed with a bare HTTP 404; a folder in the address that isn't there says so. Tried on OpenList 4.2.6 2026-09-28 10:10:03 +08:00
yetone 920bc04d48 sync: a WebDAV 403 says why rather than blaming the password — a folder in the address the server hasn't got (a Synology answers 403 for a shared folder not made), one the account may only read, or one it may not use, told apart by looking at that folder; only a 401 is the user name or password 2026-09-28 09:31:10 +08:00
yetone e31a6a15b0 usage: the menu bar's usage is refreshed as often as asked — every 1, 3, 5, 10 or 30 minutes, 3 as before — and reads as used or left as the Usage page does; that choice is a setting now rather than the browser's, so the page, the panel and the menu bar agree, and Settings has it too; a browser's choice from before is carried over once (#122) 2026-09-28 09:27:49 +08:00
yetone 0686bdffa7 accounts: a magpie just started no longer holds every page and request for cursor-agent and devin — who their CLIs say is signed in is kept on disk (cli-identity.json), served at once on the next start and asked again behind it; only a first look ever, or one after a sign-in or out, waits for the CLI. The window's first read went from ~4s to ~0.15s here with both signed in, and the gateway page shows its skeleton, not blank cards, while the state loads (#123) 2026-09-28 09:21:24 +08:00
yetone 316803e260 warm-up: Claude accounts too — a Claude window, the 5-hour one and the weekly one, starts at the account's first request after it resets, so with Claude Code warm-up on (Settings: off, weekly, or weekly and 5-hour) the magpie serving the gateway sends each account one "hi" as its window starts over, through Claude Code itself (Haiku, none of its tools, settings or MCP servers, nothing kept on disk), a saved account with its own sign-in; once per reset, kept in claude-warmup.json, as Codex's is 2026-09-28 06:31:40 +08:00
yetone 1324b61fac quota: a relay's balance can be told by a sub2api panel, and one that tells none says so — a balance token that is a JWT (a sub2api panel's login token, for GET /api/v1/user/profile) is sent as a Bearer, a new-api access token still as it is, and the editor says which goes there; magpie quota <provider> on one with no balance endpoint gives a line saying it isn't configured and how, --json included, rather than an empty list, and an unknown name is an error 2026-09-28 03:28:17 +08:00
yetone c547e29fae accounts: a Claude or Codex account removed from magpie is left alone — its sign-ins are no longer saved from the agent nor kept renewed in the background, until it's brought back; before, removing it only kept it out of the providers while magpie went on copying and refreshing the sign-in (#121) 2026-09-28 02:27:36 +08:00
yetone 4778cd021c claude subscription: the bridge's runs keep no sessions on disk — Claude Code is started with --no-session-persistence, as each run's conversation lives in its process and is never resumed from a file, so its throwaway magpie-claude- folders no longer pile up among the user's projects (or get imported from there by other agents); the ones left before are swept once from Claude Code's projects folder, only those named after a magpie-claude-<digits> folder in the temp directory (#121) 2026-09-28 02:25:19 +08:00
yetone 2d0058b9b9 providers: the context window field offers its usual sizes under it, one click each — 128K, 200K, 256K, 1M — and, where models take more than they are said to, each one's own most: Codex's GPT-6 and GPT-5.6 are said to hold 272K and take 872K when asked, a size nobody remembers, so one chip sets it for every such model (#120). The most is read from max_context_window in the list ChatGPT gives and in Codex CLI's cache 2026-09-28 01:53:08 +08:00
yetone de59782fba providers: Jev through Vercel's AI Gateway and Cloudflare's Workers AI — two presets, Jev · Vercel AI Gateway and Jev · Cloudflare Workers AI, route groups and pick their effort as TypeSafe's own does, each asked its own way: Vercel's evaluation-model with the model in a header, a noul asked as a boolean and a confidence taken from the probabilities; Workers AI's run of typesafe/jev at the account its API token works in, found once, out of Cloudflare's envelope. A key is checked by the gateway's free call (Vercel's credits, Cloudflare's accounts) 2026-09-28 01:43:09 +08:00
yetone 74cbac06ec gateway: the page is left as it is when nothing on it changed — coming back to the window no longer wipes it to placeholders and redraws, which put the reader back at the top; a reload draws again only what changed (the calls alone when only they did) and keeps where the reader was. The model list folds away under its heading, with its count, so Recent calls sits under Connect; the fold is remembered. Asked on Discord 2026-09-28 01:21:26 +08:00
yetone 6c9a0aa4d7 agents: OpenHanako — magpie is a provider there, chat completions at the gateway's /v1 under the key magpie-hanako with every model it serves, their windows, output, images and reasoning said; picking one makes it the primary agent's chat model, and default puts back the one it had and removes the provider, marked deleted as OpenHanako marks one it removes. While OpenHanako runs it goes through its local API (server-info.json's port and token), which reloads at once; otherwise into provider-catalog.json and agents/<id>/config.yaml for its next start. Asked on Discord; checked with OpenHanako's own provider registry and model manager, which list magpie's models and resolve the chat model to the gateway 2026-09-28 01:12:46 +08:00
yetone 24a57f8c69 providers: a subscription's editor has the Context window field too (#120) — only an API provider's editor had it, so the 872K a Codex account's models take couldn't be set where the account is edited; it saves with the account, and the agents are told it over the 272K Codex's backend reports 2026-09-28 00:47:18 +08:00
yetone 8b8a9e5a7a gateway: a passed-through request's reasoning effort is fitted to the model's levels, and one asking "none" that the upstream refuses with the levels it takes is asked again at low — Qoder's permission check asks "none", which Command Code turned away 2026-09-28 00:39:22 +08:00
yetone aee0d1c221 claude subscription: a parked Claude Code run is let go once its conversation moves on — a turn answered by another provider, or on another model, changes the conversation, so the run it left idle never matched again and sat for twenty minutes, one more with every switch back; now a turn that finds no run to resume retires the owner's idle runs whose conversation it has carried past 2026-09-28 00:39:21 +08:00
yetone 315a19b6e2 providers: test that a subscription's context window set in its editor reaches the models agents are told of (#120) — Codex's 272K from the ChatGPT backend gives way to the 872K a user sets on the Codex account, through the account's save 2026-09-28 00:28:53 +08:00
yetone 98efe400b5 gateway: Add to Cindy — Cindy (makecindy/cindy) takes a provider only through its import link, confirmed in Cindy, so the Gateway view's connect card has a button that opens cindy://provider/import with magpie as a custom provider: the gateway for Claude Code on Messages, Codex on Responses and Pi on Chat Completions, each listing the gateway's models, under the key magpie-cindy so Cindy's calls are known as Cindy's. Checked against Cindy's own parser (all three engines in its preview) and its model fetcher (the sandbox gateway's 30 models on each endpoint) 2026-09-28 00:26:04 +08:00
yetone eb0d4418fe claude subscription: a one-off ask — a lone message and no tools, as an agent's title or topic or the router's classifier sends — lets its Claude Code go once answered, rather than keeping it 20 minutes for a next turn that doesn't come; up to six such ~150 MB processes sat idle beside an agent that only used another provider for its own turns 2026-09-28 00:13:24 +08:00
yetone 521747465a usage: every window says when it starts again, on the clock — "resets 14:30 · in 3h", "tomorrow 09:00", "Fri 00:06" or "Oct 13 00:06" — under its bar on the Usage page, under its meter in the panel, and in the TUI whatever its use (not only once nearly spent) and magpie quota, rather than only in a tooltip 2026-09-28 00:07:47 +08:00
Zhizhen HeandClaude Code 3fe606e4b3 providers: account usage no longer writes its map from two goroutines at once — an account fetched less than a minute ago went into the map the other accounts' fetches were still writing to, which Go answers with a fatal concurrent map writes, not a panic anything recovers from; LoginUsage and Grok's copy of it now write that hit under the lock their fetches use (#119)
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-27 23:32:15 +08:00
yetone d8200dfe54 usage: a plan says when its paid time ends — a ChatGPT account the date its sign-in names (only while it is ahead: a token not refreshed since says nothing of now), a GLM Coding plan (ZCode, or a Zhipu or Z.ai key) its renewal or end from the account's subscriptions as ZCode reads them — beside the plan on the Usage page, under the account in the panel, and in the TUI and magpie quota 2026-09-27 23:23:56 +08:00
herrkaefer fb21a7fbc5 gateway: read complete request bodies (#118) 2026-09-27 23:11:32 +08:00
yetone 8dae6aa25b usage: each call is kept with the session it was part of — the X-Magpie-Session header when the caller sends one, else the session its agent names itself (Claude Code's x-claude-code-session-id, Codex's session_id, OpenCode's) — as "session" in usage.jsonl, and magpie usage lists the sessions that used the most, so several sessions on one model can be told apart 2026-09-27 23:02:36 +08:00
yetone 8f34b6d37e icon: macOS 26 draws magpie's icon light or dark — AppIcon.icon (the bird on a pale tile, or in white on a dark one) compiled into Assets.car beside the .icns, where the .icns alone was darkened whole in dark mode, the black bird lost on a black tile (#117); the app no longer sets a light picture over it in the Dock 2026-09-27 22:55:20 +08:00
yetone 36a93974b3 ui: a subscription's window count stays inside its card at every width — each window's one column is its own width rather than its count's, so a long count like ZCode's 74217 / 140000 · 已用 53% no longer runs past the card's right edge, and a count too long for its window breaks at its · with the share on a second line; widening the window puts the counts back beside their names, as the check now measures a count's own parts, not the stacked box that spans the row (#90) 2026-09-27 22:18:37 +08:00
yetone 926362db4a providers: a removed account's Add it back line can be dismissed for good — Don't remind me beside it hides the line across restarts, and the Add sheet offers the account back under Removed from magpie, one click, for when it's wanted again; removing it again brings the line back (#116) 2026-09-27 22:16:15 +08:00
yetone c76af6822f ui: a subscription's windows side by side put every count under its name once one's doesn't fit beside it, not one up by its name and the next a line below (#90); a provider's models can be picked all at once (those the filter shows) or none, and their list scrolls on its own, not the editor with it (#115); DeepSeek Harness's own models are listed under its name, apart from magpie's DeepSeek provider, which read as DeepSeek twice (#115); Hide emails says when it is on — a struck eye, 邮箱已打码 and the accent, an open eye while emails show 2026-09-27 21:38:25 +08:00
yetone 115f0cbd9d sync: 坚果云 (Nutstore) syncs from the first time — it answers a read in a folder not made yet with a 409 where other WebDAV servers say 404, which magpie took for a failure (#114); a 409 is now no backup yet, and the first sync makes the folder and puts it 2026-09-27 21:01:18 +08:00
yetone b87a3ce360 agents: Qoder is known as Qoder, not Bun — Qoder CLI is a Bun single-file build whose requests carry Bun's User-Agent and nothing of Qoder's, so magpie's provider in Qoder (and Qoder CN) now carries the key magpie-qoder (magpie-qoder-cn), which the gateway knows an agent by before its User-Agent: usage, the routing view and the models it is shown say Qoder. A Qoder wired before with the key magpie is still magpie's and gets the new key on the next sync, as magpie starts 2026-09-27 20:59:38 +08:00
yetone 6c89759239 ui: an outcome told while a dialog is open (Test models in a provider's editor) floats over the dialog's scrim at the bottom of the window — in the footer it sat under the scrim, dimmed and blurred out of sight 2026-09-27 20:50:06 +08:00
yetone 3d4ae0db47 routing: a Claude account is known once it answers — Claude Code's rate_limit_event (Anthropic's anthropic-ratelimit-unified-* headers: the five hours and the week, used and when they renew) is kept as the account's allowance, standing an hour for a usage endpoint that turns magpie away; and one not known yet goes before those known in smart routing, not after them, where it never answered and so was never known 2026-09-27 20:46:39 +08:00
yetone d6c3baa0b8 cursor: served straight through Cursor's agent API, not cursor-agent over ACP — each request is a Run on AgentService, the stream cursor-agent itself opens, with its sign-in (the keychain's or auth.json's token, renewed by cursor-agent near its end): the conversation goes whole as AI SDK messages the server reads as blobs, the caller's tools as MCP tools the model calls through CallDynamicTool, and the reply streams back text, thinking and calls, the Run closed once the step's calls are all made. None of Cursor's own tools run. Tested live from a sandbox: Claude Code and OpenCode on Sonnet 5 and GPT-5.4 mini read and write files through several tool rounds; parallel calls, a continuation and an image answered 2026-09-27 20:41:29 +08:00
yetone ef13e07e79 ui: an outcome in the footer (Refresh, Test models, a save) is a solid pill in its colour, larger, and an error stays 8 seconds — a result in the window's corner was faint over a desktop showing through, told only by its colour 2026-09-27 20:31:22 +08:00
yetone 261f0594de web: magpie web's usage tells of MAGPIE_WEB_KEY, which keeps one key across runs and browsers signed in for 400 days (#113) 2026-09-27 20:28:39 +08:00
yetone 73b650b281 routing: a request a group's rule sent to a member that can't take it fails over to the members the rules after it that match too name, in their order, before the group's others (#112) — two rules for images, the first's model out of quota, now go on to the second's vision model rather than the group's text-only first; and while the first's rests, the second's goes first. The trace names who comes next, and says a turn stays with whoever took it, not the model the rule named 2026-09-27 20:28:38 +08:00
yetone aa08863d12 grok: Codex works on a Grok subscription — the tools Grok's backend turns a request away for (Codex's custom apply_patch, its namespace of agent tools) are left out, and so are web_search's external_web_access and a null content on reasoning handed back, which the backend couldn't decode the encrypted reasoning beside. Tested live: the Codex CLI through magpie counts a file's lines, writes the number and reads it back over several rounds 2026-09-27 20:10:08 +08:00
yetone 1d0c9ccf27 settings: a choice's buttons keep their names on one line in a narrow window — the row's description gives way instead, so the Dock's 跟随窗口 and Codex warm-up's 每周和 5 小时 no longer broke a character to a line 2026-09-27 19:50:43 +08:00
yetone 2bb10bca6f providers: Command Code's balance is asked for with its key, as DeepSeek's and OpenRouter's are — how much of the plan's 5-hour and weekly windows is used, then the dollars left on it; and a model list's context_length (Command Code, OpenRouter) is kept as the model's context window, so the agents are told each one's real size 2026-09-27 19:45:18 +08:00
yetone 90fd780eef grok: served straight through the Responses API the grok CLI talks to, not the CLI run behind the gateway — each request goes to cli-chat-proxy.grok.com with the CLI's sign-in and version, as the CLI's own do: the conversation as it is, the caller's tools, images and all, relayed to a Responses client and translated for the rest. The models are the backend's own list, with each one's context window and efforts, and Grok searches the web by itself. A further account signs with its own home. Tested live from a sandbox: Claude Code and OpenCode on grok-4.7 list, read and write files through several tool rounds; an image and a web search answered 2026-09-27 19:41:12 +08:00
yetone 4e83dc6be8 web: magpie web knows its version and updates itself as the app does — the badge's restart puts the new version in and runs it in the old one's place with the same arguments and key, so the open page reloads onto it (#111); routing: a gateway served by magpie serve, which has no window, is told apart from another magpie's window, and the routing view says to stop it so this magpie serves the gateway and shows routing live (#110) 2026-09-27 19:39:45 +08:00
yetone a7dd920e8a tray: the terminal-only build builds again — the menu bar's usage watcher, which needs the tray, is in a file of its own left out of nogui builds; 9cbcb68 had it beside the card's text, which every build has 2026-09-27 19:33:03 +08:00
yetone 9cbcb681dd tray: a subscription's use can sit beside the icon in the menu bar — Settings → Usage in the menu bar picks one of the Usage page's cards, and its windows' use shows there ("42% · 18%", the shortest window first; a key's balance as it reads), with each window and when it starts again in the tooltip, brought up to date every few minutes from the page's own caches, so the vendors are asked no more often. Windows' tray has no room for text and shows the tooltip only. Asked for on Discord 2026-09-27 19:10:27 +08:00
yetone 86a0b90580 providers: Command Code's Provider API is a preset — one key reaches its Claude models on /messages and the rest on chat and Responses at api.commandcode.ai/provider, each request sent where the model list's supported_endpoints say it is served (#93); asked for on Discord 2026-09-27 19:04:04 +08:00
Zhizhen HeandClaude Code 41de0d87eb gateway: count_tokens counts the masked prompt, and a count that cannot be had is told apart — the count Claude Code asks for before every turn went to the vendor as the conversation was written, so Mask secrets was defeated on every one; it now goes masked, the same prompt the turn it counts sends. An endpoint that doesn't implement counting (404/405/501, or a 400 that says so, in English or Chinese) falls back to the local estimate as before; a limited key or a broken connection yields to the next checked key and rests the one that failed, as a generation would, while a client's own cancellation rests nothing; and a real error — a wrong key, a prompt past the model's context, an image it won't take — reaches the agent. The gateway tests are isolated from the machine now (a temp HOME, inert stubs for the sign-in CLIs and the keychain) so a cache that outlives a test can't reach a real login, and the redaction tests' cold starts run in parallel. (#103)
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-27 18:58:23 +08:00
yetone ebdf44821f sessions: Terminal is opened through proc.Command, as every command magpie runs is — os/exec there failed TestNoCommandBypassesProc and kept main's CI red since 78fe45d (spotted by @hezhizhen in #103) 2026-09-27 18:54:09 +08:00
yetone ab76cce91b providers: a custom provider's icon can come from its website (#12) — From the website, beside Choose a picture, finds the site behind the base URL (its host, then the domains it sits under: api.deepseek.com, then deepseek.com) and keeps the icon its home page names (an SVG first, then the apple-touch-icon, data: URIs too) or its /favicon.ico, like a picture picked by hand; only public https hosts are reached. Icons are fetched as magpie, since deepseek.com turns Go's own User-Agent away 2026-09-27 18:52:49 +08:00