Commit Graph
70 Commits
Author SHA1 Message Date
yetone 20948e596f gateway: a Grok subscription (SuperGrok, X Premium+) works like a Cursor one — magpie runs the signed-in Grok Build CLI in a home of its own (none of the user's hooks, skills, rules or MCP servers; only search_tool/use_tool, reaching magpie's MCP tools), borrowing the user's token through magpie grok-token without touching their sign-in; the add sheet has a Grok tile that signs in with grok login's device code 2026-09-24 17:35:36 +08:00
yetone 545506e875 provider: an import link can name the vendor's own icon
magpie://import now takes icon=<https picture>: the vendor's logo, PNG,
JPEG, GIF, WebP, ICO or SVG. It is fetched once, when the user opens the
confirm dialog — never at parse time — into magpie's icons folder, and
falls back to the catalog's logo or a plain mark when the fetch fails.
An explicit icon= wins over whatever catalog or preset gave.

The fetch is guarded on the way out: https only, at most 1 MB, the type
checked, and the host is resolved at connect time with loopback, private,
link-local and reserved addresses refused, so a name that points back at
the user's own machine (or a DNS-rebinding trick) never connects. The
page and the dialog never load a remote picture themselves.

IconURL is a carrier between parsing and that fetch only; Save drops it,
so it never reaches providers.json.
2026-09-24 17:13:03 +08:00
yetone ecb084aa4e window: when a newer magpie is out, an Update pill sits before the header's icons — hover says which version, a click installs it (or restarts into one already downloaded); an open window checks again every 15 minutes 2026-09-24 16:46:06 +08:00
he_sk c879d8fffe provider: normalize Codex system input messages to developer 2026-09-24 16:44:07 +08:00
yetone c8130269c6 gateway: a Cursor subscription works like a Claude one — magpie runs the signed-in cursor-agent in a home of its own (no user hooks, only magpie's MCP tools allowed), streams its thinking and text, hands tool calls to the client one answer at a time, and a slow tool is collected with magpie_wait; the add sheet has a Cursor tile that signs in through cursor-agent login 2026-09-24 15:49:47 +08:00
yetone 4445d94042 window: the tabs and buttons in the header are plain clicks — only the header's empty space drags the window, instead of a native strip that dragged from anywhere across the top 2026-09-24 15:27:35 +08:00
yetone e00083a3f7 gateway: the model list can be searched — words match the id, the name and the provider, Escape clears it 2026-09-24 15:20:57 +08:00
yetone 65fdcb1a14 update: the download shows how far along it is — percent and megabytes in Settings — a dropped connection is tried twice more, and a failure says why instead of only that it failed (#21) 2026-09-24 15:07:35 +08:00
yetone fb19c5d246 gateway: parallel tool calls turned into Responses keep their own call ids — each one took the next call's id and the last two shared one, which upstreams then refused as a duplicate tool_call_id; a thought sent under both reasoning_content and reasoning comes out once (#18) 2026-09-24 15:04:58 +08:00
yetone b9a591d22b gui: take back the update pill and import-icon hunks that went out with the last commit — they are still being worked on 2026-09-24 15:02:39 +08:00
yetone 407afee63d providers: a key's protocol is picked from a small menu that says what each choice is for, instead of the system popup; opening a provider no longer folds the add-provider gallery under it, and closing its dialog keeps the page where it was 2026-09-24 15:01:48 +08:00
yetone f3b66c4784 provider: a key can be made for one protocol — for relays that hand out one key for Anthropic and another for OpenAI; the gateway uses each key on its own endpoint only and sends Claude models to the Anthropic key, GPT models to the OpenAI one, translating when it must 2026-09-24 14:54:56 +08:00
yetone 64d3a1c23a provider: several subscription accounts in use at once, each with its usage — tick more Claude or ChatGPT accounts and the gateway moves to the next when the first is out of quota; every account row shows how much of its 5-hour and weekly allowance is used 2026-09-24 14:46:26 +08:00
yetone 6514b559aa provider: several accounts of one provider in use at once — tick every key to use; requests go to the first, and when it is out of quota or rate limited the next ticked key takes over before any fallback model 2026-09-24 14:36:39 +08:00
yetone abc5962600 provider: every provider can hold several accounts — keep more than one API key, name them, and switch which one is in use from the editor 2026-09-24 14:32:54 +08:00
yetone b19f3dbabe provider: add a Claude or ChatGPT subscription from magpie itself — it opens the vendor's sign-in, takes the account when it comes back and lists it with the others, one click from being in use; magpie accounts add <agent> on the command line (#15) 2026-09-24 14:26:37 +08:00
yetone 829d52f75a provider: a custom provider can name several catalogs (catalog=openai, deepseek) — a gateway reselling many vendors gets names and reasoning levels for all of them, prefixed ids like deepseek/deepseek-chat included (#17) 2026-09-24 14:10:53 +08:00
yetone 08c3d1ff4c gui: the refresh icon spins cleanly — on a layer of its own, so WebKit leaves no ghost arrows, and it finishes its turn instead of snapping back (#16) 2026-09-24 14:08:57 +08:00
yetone 435d65882b gateway: fallback — when a provider is out of quota, rate limited or down, a request goes to the next model you listed for it, before any of the reply is sent; set it in the provider editor or with magpie provider fallback 2026-09-24 14:04:42 +08:00
yetone 5da0d0d973 provider: several Claude Code and Codex subscriptions — magpie remembers each account it sees signed in, and switches the agent between them in the editor or with magpie accounts (#15) 2026-09-24 13:55:25 +08:00
yetone 61004668ac provider: a custom provider can have its own icon — a picture of yours (PNG, JPEG, SVG…) or any built-in one, in the editor or with magpie provider icon (#12) 2026-09-24 13:10:45 +08:00
yetone 931b16604e gui: the provider editor keeps what you typed when the window comes back (#13), and shows save errors inside itself (#14) 2026-09-24 12:55:13 +08:00
yetone 240e687ea3 gui: gofmt 2026-09-24 12:50:51 +08:00
elonnzhang 3ffebeebb6 provider: custom request headers for custom providers
Extra HTTP headers, typed by the user, ride on every request magpie makes
to a plain key+URL provider — forwarded calls, connectivity tests, and
model-list fetches — applied after the auth headers. Presets and signed-in
agent accounts ignore them. Editable in the GUI (with a JSON value mode) and
via the CLI as header.X-Foo=bar.
2026-09-24 12:50:51 +08:00
yetone 2a90ed1030 usage: the page no longer waits on subscription quotas — they load on their own, in parallel, stale-while-revalidate (#6) 2026-09-24 12:49:51 +08:00
yetone 1f72ac82f0 net: requests go through a proxy — Settings → Proxy, or the environment's, or the system's (#8) 2026-09-24 12:48:01 +08:00
yetone fa0ff18643 gui: Settings → Tray icon chooses whether a click opens the quick panel or the main window (#7) 2026-09-24 12:43:21 +08:00
yetone d77e14701b provider: a signed-out Claude Code account goes away, and any account can be removed (#9)
Logging out of Claude Code can leave its credentials behind; claude auth status
now decides. Removing a Claude, Codex or Copilot account hides it from magpie
(the agent stays signed in); Add it back, or magpie provider add <id>, restores it.
2026-09-24 12:42:14 +08:00
yetone 14663c3a65 agent: Claude Code's opus, sonnet, haiku and fable tiers can each take their own model (#3)
Through magpie, each tier follows the main model until it is given one of
its own (ANTHROPIC_DEFAULT_*_MODEL; haiku also sets ANTHROPIC_SMALL_FAST_MODEL).
The GUI shows them under one tiers menu; the CLI takes magpie claude haiku <model>.
2026-09-24 12:38:41 +08:00
yetone 4bd3f3a4b5 import: magpie://import links add a provider after the user confirms
A vendor or relay can hand out a ready-made provider as a link. The app
registers the magpie scheme (Info.plist on macOS, HKCU on Windows, a
.desktop handler on Linux), a second launch hands the link to the running
one, and the window shows what the link would add, with the hosts the
prompts and key would go to, before anything is saved. `magpie import`
does the same in a terminal.
2026-09-24 12:17:45 +08:00
yetone 084480beec provider: OpenCode Go and Zen presets, with the session header OpenCode requires (#2)
OpenCode's gateway turns away requests that do not name their conversation
in x-opencode-session ('Request is missing x-opencode-session and cannot be
routed efficiently'), and magpie never sent it. Requests to opencode.ai now
carry the agent's own session id (OpenCode's x-session-affinity, Pi's,
Codex's session_id, Claude Code's) or, when the agent sends none, an id
derived from the conversation's first user message, stable across turns;
the provider test sends one too. OpenCode's docs ask exactly this of
third-party clients, along with their own User-Agent, which magpie already
sends.
2026-09-24 11:49:06 +08:00
yetone 1786bc3c3d agent: Pi offers xhigh and max for models that have them
Pi shows xhigh and max only for models whose thinkingLevelMap names them,
and magpie wrote just "reasoning", so a model whose top level is max (GLM-5.3,
DeepSeek) stopped at high and a max setting was sent as high (#5). Checked on
the wire: --thinking max sent reasoning_effort high before, max after. Picking
the model or thinking level in magpie again rewrites Pi's models.json.
2026-09-24 11:15:59 +08:00
yetone 24f9edafa1 gateway: relay developer messages to Chat Completions backends as system
Pi sends the developer role to reasoning models; relayed unchanged, DeepSeek
rejected every request (422 unknown variant `developer`), so Pi got no reply
at any thinking level above off (#1). Every backend, OpenAI included, accepts
system.
2026-09-24 10:10:37 +08:00
yetone 2789e8ee67 gui: import sync 2026-09-24 03:37:14 +08:00
yetone 2bc760d86a gui: on Windows, show the window once its webview has loaded
Wails' 3s visibility fallback calls into WebView2 before a slow first
start has made the controller, and crashes on the nil pointer.
2026-09-24 03:36:50 +08:00
yetone 1e0d034ce5 gui: log the webview's errors
Wails exits on some WebView2 errors after handing them to the error
handler; the default one said nothing.
2026-09-24 03:31:31 +08:00
yetone 75cb192647 Desktop app for Windows and Linux
The Windows app cross-compiles (WebView2, no cgo) as a GUI program with an
icon, version info and a DPI-aware manifest; run from a terminal with a
command it borrows the console. The Linux app links GTK 3 and WebKitGTK
4.1. Off the Mac the app updates its own binary from its own build:
downloaded in the background, swapped in on restart or quit, and the
relaunched process waits for the old one before taking the gateway. The
window leaves room for traffic lights only on a Mac.
2026-09-24 03:22:02 +08:00
yetone 1fcd539f29 agents: keep the tray panel's control-sized pills
The lined-up columns only suit the wide window: in the narrow menu bar
panel a solo control spanning both columns is what keeps a long model id
readable, so scope the fill to body.window and leave the panel as it was.
2026-09-24 02:44:02 +08:00
yetone 07533b7f02 agents: line the model and setting controls up in two columns
The controls hugged their text and right-aligned, so a model pill sat in
a different place on every row and the chevrons never lined up. They now
fill a fixed two-column grid — model (or large model) on the left, the
second setting on the right — so every chip and chevron lines up down the
list. A single control keeps the left column, so the model always sits in
the same place.
2026-09-24 02:40:29 +08:00
yetone 86c7fee4d5 providers: drop the + and the agents that only could use a provider
The Agents field is now a summary of who is on the provider: point a new
agent at it from the Agent tab's picker instead. Removes the row's +, the
editor's list of capable agents, canUse, and the strings they used.
2026-09-24 02:40:29 +08:00
yetone 4115d443c1 providers: a plain edit lists only the agents actually on it
The Agents field listed every agent that could use the provider, most of
them sitting there doing nothing until clicked. A normal edit now shows
just the agents pointed at it, and hides the row when there are none; the
ones that could be added stay behind the row's +, which opens the same
editor in an add mode.
2026-09-24 02:36:06 +08:00
yetone 8a746c025b "every agent's model" in the app too, not only coding agents 2026-09-24 02:31:21 +08:00
yetone 0ecc7b6218 providers: 鱼鱼连线 with a region switch, and a ui polish pass
A relay with several endpoints is one preset now: a Region selector
(Auto / Global / China Mainland) swaps the provider's base URLs, and the
endpoints list follows the choice. AiHubMix's key page moves to
console.aihubmix.com/token.

The rest is a pass over the gateway, usage and provider views: a copy
button that answers on itself, a cache hit rate in the usage tiles, the
chart's peak and last date no longer overlap, the tabs sit level with
the logo, the provider key column holds a line, pickers opened from the
editor show above its modal, and buttons drop the native webkit look so
their labels centre.
2026-09-24 02:27:11 +08:00
yetone 9f678458b9 catalog: ask a relay for its chat models without the anthropic header
OpenRouter serves a second, namespaced catalogue from /v1/models as
soon as it sees anthropic-version, so sending that header on the chat
fetch cached ids like anthropic/xiaomi/mimo-v2.6-pro-ultraspeed[1m]
that the chat endpoint then rejected. Send it only when the fetch is
for the Anthropic protocol, where the official API requires it.
2026-09-24 02:27:06 +08:00
yetone 73ef0e5276 usemagpie.ai, and a magpie that updates itself
site/ is the website: a static page plus a worker that turns the newest
release of yetone/magpie-releases into an update feed (/api/latest, with
every file's SHA-256), stable download links and an install script.

The app asks the feed at start-up and every six hours, downloads a newer
version in the background, and installs it on Restart to Update or on
quit. A download must match its checksum and be signed by the same team
as the app it replaces. `magpie update` does the same from a terminal and
replaces a bare binary in place.
2026-09-24 01:57:50 +08:00
yetone 3b0cf9a965 logo: a round magpie in black and white, drawn from one SVG 2026-09-24 01:09:59 +08:00
yetone 702477525a Claude subscription as a provider; model lists fetched, never compiled in
A signed-in Claude Code is now offered as a provider (claude/…) like Codex
and Copilot. Anthropic classifies another agent's system prompt as
third-party traffic even over Claude Code's OAuth, so magpie drives the
real local claude binary for every generation: the caller's tools are
bridged in over MCP (magpie claude-mcp-helper), and tool results resume
the same Claude Code turn. Token counting is estimated locally so the
OAuth token takes no side path.

No model list is compiled in any more. The built-in catalog, preset
defaults and Claude Code's alias list are gone; the picker shows the
models.dev catalog (refreshed in the background when stale) layered with
each vendor's own /models answer, and signed-in accounts fetch theirs at
start-up. Whether a model rejects temperature/top_p now comes from
models.dev rather than a name prefix.

The gateway retries a Chat request on the Responses endpoint when the
model is Responses-only, and remembers that. Recent calls keep the first
256 KB of request and response bodies, viewable in the call list. The
Usage tab shows subscription allowances (Claude, Codex, Copilot) as the
vendors report them.
2026-09-24 00:20:59 +08:00
yetone 1f44812457 agent: rewrite the wiring an older dial left behind
On start-up magpie now renames what dial wrote into the agents' files: a
model spelled dial/… becomes magpie/… (which also writes the magpie
provider entry), and the dial provider entry, Codex's [model_providers.dial]
table and dial-models.json, and Claude Code's bearer token go. Once nothing
says dial it changes nothing.
2026-09-24 00:17:32 +08:00
yetone 402a96c39d Rename dial to magpie, with a magpie for a logo
The product, module path (github.com/yetone/magpie), binaries, env vars
(MAGPIE_ADDR, MAGPIE_DEV_UI, MAGPIE_THEME, MAGPIE_DEBUG), config and cache
folders (~/.config/magpie, ~/.cache/magpie), bundle id (com.yetone.magpie),
gateway provider id and token, and every UI string now say magpie.

On first run magpie copies ~/.config/dial and ~/.cache/dial to the new
folders when they don't exist yet (copy, not move, so a still-running dial
keeps working; the old folders can be deleted by hand later).

The logo is a small round magpie in profile: one path for the header and
the tray, and the app tile adds the white belly and the blue-green tail.
The header mark is drawn in ink rather than the accent colour, which
fought the text in light mode.
2026-09-23 23:55:11 +08:00
yetone 9e3e338e63 logo: a kingfisher
The gateway glyph is gone. The mark is now a kingfisher in profile, facing
the wordmark: big head, dagger beak, short tail, one line for the wing, the
eye a hole. The header draws it in ink rather than the accent, which fought
the text in light mode. The icon generator rasterizes the same SVG path
(flattened cubics, even-odd fill), and the app tile is kingfisher blue.
2026-09-23 23:25:07 +08:00