Commit Graph
653 Commits
Author SHA1 Message Date
yetone d924802de5 usage: a streamed reply's time to its first token is kept, and its first text's (#196: usage 记录首字延迟(TTFT),用于计算模型的真实生成速度) — usage.jsonl had only a call's whole ms and its out tokens, so how fast a model writes couldn't be told from how long it waited or thought. The reply is now read as it goes to the agent, in the agent's protocol whatever the vendor spoke (Anthropic content_block_delta text/thinking/input_json and a tool_use's start, Chat content/reasoning_content/reasoning/tool_calls, Responses output_text/reasoning/function_call_arguments deltas and a function call's start, Gemini parts), and each record gets ttft_ms to the first content and first_text_ms to the first text, counted from the request as ms is, so ms − ttft_ms is the writing time; a reply that isn't streamed gets neither, and omitempty leaves old records as they were. Only the stream's events up to its first text are read (a JSON reply, or past 8 MB, not at all). Each try in the routing trace keeps its own from when it was sent, so a group that fails over shows which member was slow, and the route, the request log and the Codex backend's relay keep them too. Shown on the Routing page (TTFT in the list, first token / first text / tok/s in a try's story), in the Gateway's request log, and on the Usage page and in magpie usage per model as the mean TTFT and tok/s = out ÷ (ms − ttft) over the answered streamed calls. Tested with fake vendors streaming a gap apart for Anthropic, Chat and Responses, as they came and translated (Chat from Anthropic, Responses from Chat), the ChatGPT backend without a Content-Type, a whole reply, a group whose first member fails (its try untimed, the second's timed from its own start, the request's including the failed try), each protocol's events and split writes, and the summary's sums; the GUI's browser tests pass 2026-09-29 16:40:03 +08:00
yetone 30300c40d0 providers: NVIDIA and ModelScope are presets (#197: 增加 NVIDIA NIM 和魔搭 ModelScope 作为供应商预设) — NVIDIA NIM at integrate.api.nvidia.com/v1 with a key from build.nvidia.com, and 魔搭's API-Inference at api-inference.modelscope.cn/v1 with a ModelScope access token (not DashScope, which the Qwen presets are), each with its models.dev catalog (nvidia, modelscope) and its logo. NVIDIA's /v1/responses answers 404 for its models but a few, so it has chat completions only; ModelScope's /v1/responses is served (401 without a token, 404 for a path it doesn't know), so it has both. Neither has an Anthropic endpoint here. An entry imported at either base URL is the preset, and the import link pages and README list them. Tested: the presets' endpoints, catalogs and import, a /v1/models answer shaped as each sends it (NVIDIA's embedding models left out, ModelScope's object "" rows kept), and catalog.FetchAt against the live integrate.api.nvidia.com (74 models) and api-inference.modelscope.cn (35) lists 2026-09-29 16:40:02 +08:00
yetone 95d71138bf bedrock: Claude Code's betas are fitted to what Bedrock takes (#176: API Error: 400 Amazon Bedrock: Unexpected value(s) advanced-tool-use-2025-11-20, prompt-caching-scope-2026-01-05, redact-thinking-2026-02-12 for the anthropic-beta header) — Bedrock's runtime checks anthropic-beta by name and turns the whole request away for one it doesn't know, and magpie passed Claude Code's betas on as it sent them. Now, at Bedrock, tool search is asked by Bedrock's name for it (tool-search-tool-2025-10-19, as Claude Code asks Bedrock itself) and the two it refused are left out; and at any provider, a 400 naming betas as unexpected is asked again once without them, and they're not sent to that provider again, so a beta Claude Code adds later costs one retry, not a failed turn. An anthropic_beta list in the body (how Bedrock's InvokeModel takes betas) is fitted alike. Tested against a fake Bedrock runtime that refuses unknown betas as the real one does: the issue's betas plus an unknown one go through on the first turn with one retry and straight on the next, and body betas (fails on main) 2026-09-29 16:40:01 +08:00
Ethan Xu 81736b2fb2 subscription: Qoder is a subscription you sign in to and route throug… (#162)
* subscription: Qoder is a subscription you sign in to and route through — Qoder lists no public API, so magpie speaks the endpoint its own desktop client uses: api3.qoder.sh's agent_chat_generation SSE, wrapped in the COSY envelope the client signs with (an RSA-encrypted key and a signed request line), the body through the client's own base64 codec, and the account reached by Qoder's OAuth device flow (qoder.com -> a dt- device token -> a jt- job token that serves models and rotates from its refresh token). The protocol lives in internal/qoder (endpoints, codec, cosy, oauth, models, a credential store, and /api/v1/userinfo, asked with the device token at sign-in so the account is labelled by its email and name rather than a bare uid); provider/qoder.go is who is signed in, its models, and the sign-in; gateway/qoder.go turns a request into a Qoder body and reads the SSE back, folding tool calls and results the way the client does. It is offered as a single, risky subscription in the Providers page: Qoder has no public API for this, and may treat a request that isn't its own client's as third-party use — the tile says so and points at an account you can afford to lose. Tested: the codec, the COSY signing, the model list, the request body and a served round-trip against stubs, and live — a signed-in account answered a Pi request for qfmodel end to end. Not tested: the userinfo email/name path against a fresh real sign-in (the device token is short-lived), and multi-turn tool use against the real client's exact framing.

* subscription: Qoder uses the chosen model and keeps rotating tokens consistent

Qoder used qfmodel regardless of the caller's model, refreshed the same rotating token concurrently, and could return upstream failures as empty successful replies. Requests now use the selected account's enabled model key and complete model_config; unknown or disabled models are refused. Token checking, rotation and atomic persistence are serialized, each caller receives a separate credential, and a rotated pair is retained for a persistence retry if its disk write fails.

Accounts are kept in logins.json with multiple accounts, selection, secondary-account toggles, usage and removal, including the last account. The old qoder.json is migrated after a successful write. A sign-in generates one machine ID that the account keeps for subsequent requests; the OS and architecture follow the running platform. Login polling expires after 15 minutes.

Qoder's response path maps non-200 SSE envelope statuses to HTTP errors before output and terminal error events after streaming begins, including requests using magpie's search rounds. Tool-result headings stay beside their own results; normal EOF flushes pending text and emits a stop event even after tool calls. Thinking, effort and context settings follow the selected model (low/medium/high is the fallback when no effort levels are declared). Corrected the Chinese risk wording and account plan label, removed unused protocol fields and the unsupported China-client claim, and included ufec/CLIProxyAPI's MIT copyright and license. Codec and signature tests now have fixed expected answers instead of relying only on round trips or an absolute Windows capture path.

The shared relay in claude_subscription.go is unchanged. Its error-status propagation and handling of failures after partial non-streaming output are existing upstream issues outside this change; Qoder handles these failures in its own relayQoder response path.

Tested: Qoder, codec, COSY and shared stream-error regressions passed 20 consecutive runs, including eight concurrent requests refreshing once, persistence failure recovery, account migration and removal, sign-in and usage against local HTTP stubs, and error handling across Chat, Responses, Anthropic and Gemini. go vet ./..., the production build, JavaScript syntax checks and git diff --check pass. The complete Windows test run has the same 72 failing tests/subtests as HEAD, with no new failures; the existing Claude shell-client test still times out. Not tested against a live Qoder account. The race detector could not build because gcc is unavailable.

* subscription: Qoder keeps its rotating tokens, speaks tools in its own
API's way, and thinks at the effort each model declares

An aborted request could sign the account out. A refresh ran on the
request's own context, so one cancelled after Qoder had rotated the pair
but before its reply arrived dropped the new pair and left the spent one
saved: every later call failed with "qoder job token refresh: status 401"
until the account was signed in again. The failure wasn't recorded
either, so the account looked healthy in the app while every request
failed. Refreshing now runs on context.WithoutCancel with its own 20s
timeout, in provider/qoder.go and the device-token refresh in
qoder_usage.go, and a refresh Qoder refuses (401 or 403, either token)
marks the account lapsed: Qoder's job-token refresh returns a
JobTokenRefreshHTTPError with its status, as the device one did. Side
logins don't carry Lapsed out, so qoderLogins passes it on.

A refresh blocked every other subscription. Both held qoderMu and the
global loginsMu across the HTTP call, up to 20s — with a 2s refresh in
flight, Logins("workbuddy") blocked 1.9s. qoderMu still serializes read,
rotate and write-back so one pair is rotated once; loginsMu is taken only
to read (qoderLookup) and to write back (qoderPersist), and the write-back
re-reads logins.json, so a change made meanwhile is kept. migrateQoder
takes no lock when there's no legacy file to move, or listing Qoder's own
accounts would wait behind a refresh too.

Tool calls were carried as XML in the text with values magpie HTML-
escaped, so an argument reached the model as "x", the model took
to imitating the escaping, and a value it meant literally — "< b &&"
— was unescaped on the way back and corrupted. A call had no id while
its result said "Function result for call A". Qoder's endpoint serves
OpenAI's own tool calls: asked with a tools array it answers with
tool_calls carrying ids, and accepts assistant tool_calls plus a role:tool
turn named by tool_call_id. So they are sent and read that way now: no
XML contract in the prompt, no escaping on either side, and a result
paired with its call by the id Qoder sent. The XML splitter stays as a
fallback for a model that still writes a call in its text.

Effort was chosen from reasoning_efforts, a field no model lists, so
every model got the low/medium/high fallback: gfmodel, which offers only
high and max, was asked for medium and refused with "该模型始终思考,
不支持关闭思考", and xhigh was clamped to high. The levels and the
default come from thinking_config now — asked for nothing, or for a
level Qoder doesn't name, a model thinks at its own default; a model
that can't stop thinking thinks at its lowest when asked for none; one
that declares no levels is sent none. A model whose only thinking_config
is enabled now thinks, as it does in Qoder's own client. Upstream
failures carry the vendor's reason from details, which had been dropped.

Tested: go test ./... and go vet on the changed packages, and the darwin
and windows builds. New regressions cover a refresh outliving an aborted
request, a refused refresh lapsing the account, logins and a concurrent
write-back during a refresh in flight, tool turns paired by id, native
tools and streamed tool_calls, and effort defaults. Live, against a
signed-in account: two parallel calls and a follow-up call each got
their own result; a file written with "< b &&" kept them; gfmodel,
asked for nothing, answered at max; qfmodel's xhigh reached Qoder as
xhigh. Not tested: a refresh the upstream refuses for real, and models
the account isn't offered.
2026-09-29 16:40:20 +08:00
yetone e4404dbd6b agents: Kimi Code, Moonshot's kimi CLI, is an agent magpie sets up (agent求个kimi code支持) — it keeps its settings in ~/.kimi/config.toml ($KIMI_SHARE_DIR's), its default_model a key of its [models."…"] tables, each naming a [providers.…] one. Picking a model through magpie adds the provider "magpie" (the gateway, as Kimi's own chat completions type, so the thinking goes out as reasoning_effort and comes back, and is sent back, as reasoning_content) and a table per catalog model keyed "magpie/<provider>/<model>", with its context (128K when not known) and thinking/image_in capabilities, so the catalog is in Kimi's /model picker and kept up to date as providers change; the Kimi Code sign-in's default is stashed and put back on reset, and the tables go in and out in the order Kimi's own check wants (a default or a provider it can't find makes it refuse the file). Its requests are Kimi Code's in usage (KimiCLI/…). The gateway also drops Kimi's thinking: {type: …} on a request relayed to api.openai.com, as it does Qwen's enable_thinking. Tested: the config in the shape a Kimi Code sign-in leaves it (set, sync, a moved base_url, reset, its own model, no config at all), and the real kimi 1.24.0 --print against a sandbox gateway and a fake upstream: reply and thinking shown, reasoning_effort high on a thinking model, reasoning_content sent back on the next turn, usage under Kimi Code; not with a real vendor behind it 2026-09-29 16:36:35 +08:00
yetone b95dab91d8 agents: "Show 7 more" unrolls the rows downwards (Image #22: 点击这里为什么是向上展开) — a click holds what was clicked where it is on the screen (v0.1.377), and the button sits under the rows it opens, so as they grew above it the view scrolled to keep it put and the page rode up past them. A control marked data-unrolls is held by the part it is in instead: the rows open down and the button goes down with them. click-scroll.test.cjs checks it in Chromium and WebKit (it fails without the change) 2026-09-29 16:29:33 +08:00
yetone 9e9c2ce96c providers: StepFun and StepFun (China) show the Step Plan's 5-hour, weekly and credit windows on the Usage page (StepFun 国外版跟国内版这两个provider都应该支持显示额度) — the platform tells them only to a sign-in on platform.stepfun.ai or .com, never to a key ("api key not permitted for this method"), and its session cookie is HttpOnly with no way back to an app, so the user signs in in their own browser and brings the session over: the provider's editor has a bookmarklet that, on the signed-in platform page, asks the platform to renew the session as the page does and copies it, and a box to paste it into (the Oasis-Token cookie from developer tools is taken too). magpie keeps it in stepfun-auth.json (0600), one per site, renews it before it runs out and once more when it is refused, and asks QueryStepPlanRateLimit and GetStepPlanStatus for a card with the plan, its windows and when it ends; an anonymous session, another site's, or one renewed as someone else (past the refresh token's 30 days) is not kept or shown. Tested with a fake StepFun platform (renewal, early expiry, another account, pastes of each kind), the bookmarklet run against a stubbed page, and the field in a sandbox magpie web (signed out, a bad paste, signed in, sign out); not with a real StepFun sign-in 2026-09-29 16:04:47 +08:00
yetone f770ad2aef gateway: a conversation moved from Grok to Codex's GPT on a ChatGPT sign-in goes on (waroy: The encrypted content for item rs_ could not be verified … routing grok > codex GPT) — the ChatGPT backend streams its refusal of Grok's sealed reasoning as response.failed, after a codex.rate_limits event of its own; magpie held a stream only through the events it knew come before a reply, took codex.rate_limits for content and let the stream through, so the refusal went to Codex rather than being asked again without the sealed reasoning, and nothing was noted to leave it out of later turns. codex.* events now count as coming before the reply, so the refusal is caught, the member asked again without the reasoning, and what it refused left out up front on later turns. (The id reads rs_ as magpie sends the ChatGPT backend no item ids.) Tested with a fake Grok member and a fake ChatGPT backend in a group, refusing as a 400 and in the stream after codex.rate_limits (the stream case fails on main) 2026-09-29 15:28:08 +08:00
yetone 4216d2b338 redact: a gateway's key in "key": "oc_sk_…" is masked, and Settings → Privacy takes the user's own masking rules (#195) — an OpenCode Go key in providers.json went to the vendor as it was: the API key rules wanted sk- with a hyphen, and a field called key alone was none of the secret field's names. Now a key of a gateway or relay, two to four letters and _sk_ (oc_sk_, or_sk_) with digits in it, is an API_KEY wherever it is, and a field named key and nothing more (not sort_key, monkey or obj.key) is a SECRET when its value is 16 or more letters and digits both, so a map's "key": "value" and key = "someIdentifier" are left alone; \"key\": \"…\" in JSON inside a string is found too. The secret field's names and its markers come from one list, so they can't drift apart, and of two rules finding the same value the first keeps it, so its placeholder no longer changes between an API_KEY and a SECRET from one request to the next. Masking rules, next to 脱敏词: a name for the placeholders (upper case letters, digits and _, 24 at most) and a prefix (then 8 or more key characters) or an RE2 regular expression, group 1 the value if it has one, masked with the secrets while 脱敏密钥 is on and put back as the others are, the user's name winning where one of magpie's finds the same value. They are set on their own: a pattern that doesn't compile, matches nothing at all, or is too long (300), a prefix under 3 or over 64, both at once, or more than 32 rules, is refused with the reason under the add row and what was typed kept. Tested: every row of the issue's table and the false positives, the rules' tidying, errors, stable placeholders, restore, overlaps, and kinds with digits in a stream; the settings file and the gateway's count_tokens with a rule; the page in a stub magpie web (add, a bad regex, remove, zh dark) 2026-09-29 15:26:01 +08:00
yetone 04fb5cbf92 providers: StepFun and StepFun (China) show what is left on the account (StepFun 国外版跟国内版这两个provider都应该支持显示额度) — both answer a key, a Step Plan one too, with the account at /v1/accounts (api.stepfun.ai in dollars, api.stepfun.com in yuan), whose balance is what is left to spend, vouchers included; it is now a card on the Usage page beside the others. Checked against the live api.stepfun.ai with a Step Plan key, on the plan and the pay-as-you-go address. The Step Plan windows are told only to a platform sign-in, not to a key 2026-09-29 15:23:14 +08:00
yetone 4f5699aae5 providers: Kiro and Devin keep several accounts, as the other subscriptions do (Kiro要支持增加多个账号…Devin也要能够增加多个账号) — both only borrowed their CLI's one sign-in (Devin wrote devin's credentials.toml, Kiro kept one kiro-auth-token.json), so signing in again replaced the account. The CLI's or IDE's own account is now read as it is and each further account gets a home of magpie's: Kiro's token file is kept and refreshed there, and Devin's credentials.toml sits in a data folder the devin CLI is run with (XDG_DATA_HOME / APPDATA), so devin auth status and models list answer for it. They are listed, switched, ticked on and forgotten like the others, and the gateway moves on to the next when one is out; the single Kiro sign-in kept before is moved into a home of its own. Tested with a fake Kiro and a fake devin CLI (second account, signing in again, switching, forgetting); not with real accounts 2026-09-29 15:20:22 +08:00
yetone 31f2fc8ed4 bedrock: GPT models are asked a reply's length as max_completion_tokens, and Claude Code's metadata is left out (#176: 400 Unsupported parameter: 'max_tokens' is not supported with this model; Request metadata contains a value that violates the regular expression) — Bedrock's OpenAI endpoint turns max_tokens away for its GPT models, so the endpoint test and every chat request to it (sent on as it came or built from another API) now ask max_completion_tokens; and Claude Code's metadata.user_id, a JSON string now, is not the plain id Bedrock's Anthropic endpoint checks it against, so it is dropped there. Tested against a fake Bedrock runtime (both fail on main) 2026-09-29 15:12:44 +08:00
yetone 12d79dd9f5 providers: Baidu Qianfan Token Plan lists no kimi-k2.6 (#193 follow-up) — Baidu's Token Plan 个人版 page takes Kimi-K2.6 (and DeepSeek-V4-Flash, already left out) offline 2026-09-29, the day the preset landed, so it was dropped from the models the preset lists; it can still be typed in by hand while it answers. gofmt on the preset and its gateway test 2026-09-29 14:38:54 +08:00
yetone a284b61bb1 providers: an image model's Test models draws one small picture on the images API, as the gateway draws with it (mamba: 图像模型点测试模型是不是发送的请求不对啊,总是提示响应异常) — every model picked was sent a chat completion ("hi", max_tokens 16), so gpt-image, flux, seedream and the like, which a vendor serves only at /images/generations, were turned away and always showed as not answering. Now a model the gateway draws with on an images API (catalog.ImagesAPI, the list viaFor used, shared) is asked there for one picture of "a dot", n=1, at gpt-image's low quality and the vendor's default size, waiting up to two minutes (the request up to three); a 404 or 405 there is tried in chat as the gateway does. Chat models and gemini-*-image / gpt-5-image (which draw in chat) are asked as before, and the vendor-wide Test asks a chat model ahead of one that draws. Tested with a fake vendor that serves images only at /images/generations and chat only at /chat/completions 2026-09-29 14:37:09 +08:00
Austie 6ba83dbbbb providers: add the Baidu Qianfan Token Plan (个人版) preset (#193) 2026-09-29 14:37:24 +08:00
Ns2Kracy 62ded971c0 codex: retry unused 5-hour windows after warm-up (#192)
* codex: retry warm-ups for unused five-hour windows

Keep the idle retry schedule when Codex reports zero usage and a reset a full window away. A successful warm-up request can leave the window unstarted, and a fresh reset_after_seconds on each read otherwise makes the saved reset drift indefinitely. Retry with the existing backoff until the reset begins counting down.\n\nCover the relative reset field, retries at 15 and 45 minutes, stopping once the window runs, and warming the next reset.

* test: cover a used window after Codex warm-up

Confirm the retry schedule stops both when an unused window starts counting down and when subsequent usage becomes nonzero, before the next reset triggers another warm-up.
2026-09-29 14:29:06 +08:00
yetone 3c02cbd5c9 routing: Stop replay and the speed answer a click in the app, and the clock's fast-forward reads as that (Discord: willz — 停止重放无效, 1× 速度一会儿 4x 一会儿 8x) — the replay's bar wrote its buttons' text every frame, and WebKit sends no click to a button whose text was replaced between the press and the release, so in magpie's window Stop and the speed did nothing and the replay ran to its end. Now each is written only when it changes. The N× beside them was the clock running fast through a quiet stretch cut short, not the speed: it now says so (跳过空闲时段 · 时钟 N×). Checked in WebKit against a sandbox magpie web: before, mousedown and mouseup reach Stop but no click and the replay goes on; after, it stops 2026-09-29 14:24:18 +08:00
yetone bd71a587ef routing: a failed try shows what its vendor said, and the errors count opens the newest failed request (Discord: 蓝猫, Devin 502 — Agent 收到的错误 did nothing when clicked) — the trace kept each try's error word for word, but the page only told magpie's reading of it (403 · failed), so the vendor's own reason was nowhere to be seen. Now it is under that try, and clicking the errors count picks the latest request whose agent got an error. Checked in a sandbox magpie web with a fake vendor answering 403 2026-09-29 14:08:03 +08:00
yetone 17ad8f9332 agent: a goose on PATH that is pressly's migration tool isn't taken for Goose (Discord: Jun, Goose listed with no ~/.config/goose) — any goose on PATH counted as the agent, and the Go database migration tool of that name is common among Go developers. Now a goose on PATH counts only when it isn't a Go program (Block's goose is Rust); goose's config dir still counts as before 2026-09-29 14:04:32 +08:00
yetone 38cbbaaf01 devin: fast runs are one model with an effort, and the Devin agent's own picker is families + effort too (蓝猫 on Discord: Fast 模型还是存在同样的问题,给 Agent 选择模型的时候还是同样显示) — v0.1.371 made each family one model with its efforts, but a variant with a tier after its effort (claude-opus-5-5-high-fast, gpt-6-sol-high-priority) still stood alone, one per level, and the Devin agent's model field still listed every variant flat. Now a family's fast (and priority) variants are one model, claude-opus-5-5-fast, whose effort the gateway turns into the variant at it (nearest level; the family's default with none asked), and ids ending -none join their family at none. The Devin agent offers the same families with an effort field beside the model; Devin's config has only agent.model, so the pair is written as the variant at the effort (the family's own id with none, so it keeps following the family) and read back apart. Ids an agent was set to before, and one typed in, go to Devin as they are; with Devin's list unreadable the id is read and written as it is. Checked against the real devin models list (85 models, the Opus fast runs low–max) and with tests of the agent's get/set on a temp config 2026-09-29 13:55:56 +08:00
yetone ba9f0c610d routing: a group's member may be a model at an effort of its own, provider/model:low (#189, @luw2007: model + effort 才是完整的组合项) — a member was only a model, reasoning as the agent asked or as the group's classifier picked, so "the same model, cheap and quick" and "the same model, thinking hard" could not both be in a group, nor could a rule send to one of them. A member now may carry an effort (none … max): a request routed to it is asked for that much reasoning whatever the agent asked or effort=auto picked, at the level the model has nearest, while the vendor is asked for the model's own id. The same model at two efforts is two members that rules (use=m:high), stickiness and the trace tell apart; an id whose own last part is a colon (a :free, :7b, :0) stays the model's. The group's reasoning levels are those of its members that follow the agent, and the editor has a reasoning button on each member. Tested with a fake provider through a sandbox magpie: the upstream bodies carry the fixed effort in Chat, Responses and Anthropic shapes, and the routing view shows m1:low / m1:high as two seats, light and dark 2026-09-29 13:45:29 +08:00
xuyang2 74242b9d11 workbuddy: an unfinished chunk's empty finish_reason reaches the agent as null, and a repeated empty tool-call name no longer rides along — CodeBuddy CN (copilot.tencent.com) says "finish_reason": "" on every chunk that hasn't finished, where the OpenAI contract has null, and a strict client (the AI SDK) rejects the chunk for the empty value; it also repeats "function": {"name": ""} on every tool-call argument fragment after the first, and a client that merges a delta by overwriting any field it carries (the grok CLI) assembles a tool call named "" and fails it with "Tool not found". chatTidy, which already drops the empty reasoning_content of that stream, now sets the empty finish_reason to null and drops the empty duplicate, so the real name is only sent once. Tested against a fake WorkBuddy stream: both shapes mended, and a last-wins merge of the mended fragments assembles the call as it was meant (#190) 2026-09-29 13:43:58 +08:00
yetone a3d59eee01 cursor: a model's name no longer says its context, a grey 1M beside it does (Leo on Discord: Cursor 模型的展示名仍保留上游文本中的 1M) — Cursor names its large models "Claude Opus 5.5 1M", and magpie showed that as the name while it already kept the 1M as the model's context. The name now leaves it out ("(1M)" too); a name that would then be another model's ("GPT-5.5 Mini (1M)" beside "GPT-5.5 Mini") keeps it, as that is what tells them apart. Ids, efforts and the Cursor id each request goes to are unchanged, and a name the user gave still wins. So the context still shows, a model holding a million tokens or more has a small grey 1M by its name in the provider's models, the gateway's list and the model picker. Tested with a fake Cursor list in a sandbox magpie web, dark and light 2026-09-29 13:26:16 +08:00
yetone 73af4c282c gui: a click never moves the page, held for every view in one place (为什么点击一个控件总会滚到页面顶部,能否从根上解决) — picking Live after a day emptied the requests' list, the page got shorter than where the reader was, and the browser pulled it up; any code could also call scrollOnPurpose() and scroll on a redraw, a tab switch or a filter. Now what the reader clicks stays where it is on the screen for the next 4s: the element clicked, or once it's drawn again its nearest neighbour or parent, is held in place against content above it changing, and when content below it shrinks, room is kept at the view's foot (a .view-room spacer, gone once the reader scrolls back up) so the page isn't clamped. Code scrolls only with scrollOnPurpose(e) given the reader's own event, and without one the scroll is refused. The wheel, touch, keys and dragging are the reader's and scroll as before. The Routing page's days stay reachable with no live requests, and the library tabs no longer reset to the top. New click-scroll.test.cjs (Live/day switching with the view scrolled to its end, a jump, growth, redraws and helpers with no event, a scroll asked for, the room kept and removed, the wheel) passes 12/12 on Chromium and WebKit; the old code fails it (picking Live moved the page 294px); menu-scroll 22/22 2026-09-29 13:22:00 +08:00
yetone 58b676663b claude: its sign-in is read from the keychain under its account, as Claude Code reads it (@taresky: claude auth status loggedIn, the keychain item there, magpie still said not signed in) — magpie asked for "Claude Code-credentials" by service alone, and with more than one item for it (one an earlier sign-in left, say) the keychain may hand back one that isn't the sign-in in use; now it asks under $USER first, as Claude Code does, and by service alone only when that finds none that reads 2026-09-29 13:08:36 +08:00
Zhaofeng 89d8a59f15 codex: guide sealed subagent handoffs to supported models (#188) 2026-09-29 13:06:14 +08:00
yetone 21cc3d7647 providers: Kiro is a subscription added in magpie, signed in on Kiro's own page (Image #21: 为什么在订阅列表里看不到Kiro订阅) — Kiro was used through kiro-cli's or the Kiro IDE's sign-in, or a key, so it had no card among the subscriptions and no way to sign in from magpie. It now has a card, and signing in opens app.kiro.dev as the IDE does: Google and GitHub are exchanged with Kiro's auth service, Builder ID and Identity Center go on to AWS with a client registered for magpie, and the sign-in is kept in magpie's own kiro-auth-token.json, refreshed there, and used ahead of kiro-cli's and the IDE's, which are left as they were. A company's own identity provider is still kiro-cli's (kiro-cli login), and the sign-in says so. Tested with a fake Kiro and AWS (Google, Builder ID, a stale answer, an external IdP) and against the live page, token and register endpoints; not yet with a real Kiro account 2026-09-29 13:01:09 +08:00
yetone 1d6b415a68 providers: a saved Claude account left out says which check found no sign-in (@taresky: Claude 账号不显示, cc cli works) — on a Mac the note named only ~/.claude/.credentials.json, where Claude Code never keeps its sign-in there, so every cause read the same. Now it says whether no "Claude Code-credentials" could be read from the keychain (and nothing at that file), the credentials are there but claude auth status says no one is signed in, or neither ~/.claude.json nor the CLI names the account 2026-09-29 12:56:58 +08:00
yetone b1d4bca90f routing: picking Live or a day keeps the page where it is, and a list with no requests says what it is for (Image #59) — a day or Live picked in the requests' bar picked its first request as a click on a request does, which brings the stage at the top into view, so every switch sent the reader up to the top and back down; the stage now comes into view only for a request picked in the list. With no requests, the list is a quiet note (none since magpie started: each request an agent sends shows who answered it, why and each try; earlier ones are under the days) in place of an empty box, and the accounts and keys column, tallying nothing, is left out. Checked in a stub magpie web with the day's history: scroll stays put over five switches (it moved before), dark 2026-09-29 12:43:50 +08:00
yetone 233b463d3a devin: Devin's models are offered as their families, with the effort picked as any model's is (蓝猫 on Discord: 能不能让 devin 也走 model + effort) — Devin writes the effort into its ids (54 families, 625 ids, most swe-2-high, …_MEDIUM), and magpie listed them all. Each family is now one model with the efforts its variants are at, lowest first, and the gateway asks Devin for the variant at the effort asked for, or the nearest the family has; a variant that is no effort (a 1M window, -high-fast) stays a model of its own. A variant already picked stays offered and goes to Devin as it is, and its effort is the one its id says, so the trace shows medium for a Medium variant rather than the max the request asked. Tested with a fake Devin list: families, picked variants, the variant chosen, the efforts and windows offered 2026-09-29 12:35:34 +08:00
yetone 15aef1c584 providers: Bedrock's Anthropic endpoint is sent its key as x-api-key alone, and GPT-6 is in its models (#176: Endpoint test failed) — magpie sent a Bedrock key on /anthropic/v1/messages as both x-api-key and a Bearer, as it does for compatible vendors, and Bedrock turns away a request with both; it now gets x-api-key alone, as AWS's own Messages sample sends it, and chat completions keep the Bearer. The preset's models gain GPT-6 Astra, Sol and Luna as their global. inference profiles, which every commercial region routes (they have no in-region id on bedrock-runtime); gpt-oss stays in-region, which ap-southeast-1 doesn't serve. Tested with a fake Bedrock through the gateway and the endpoint test: without the change both headers arrive; not yet against a real Bedrock key 2026-09-29 12:17:34 +08:00
yetone e4375ce967 gateway: a tool's schema reaches Antigravity with only the keywords it takes (#187: Unknown name "exclusiveMinimum") — Antigravity refuses a request whose function declarations carry a JSON Schema keyword outside its subset, and magpie cut out only the ones it knew of, so zcode's and dsh's tools, whose numbers have exclusiveMinimum, were refused with 400 on every turn. Now each schema keeps only type, description, nullable, enum, properties, required, items, the bounds and pattern, and propertyOrdering, anything else left out; an exclusive bound given as a number becomes the inclusive one when there is none. Tested on a schema with exclusive bounds, format, title, uniqueItems, contains, dependentRequired and not 2026-09-29 12:12:45 +08:00
yetone 03dbde12d0 accounts: after a Codex switch, magpie says when Codex's background service is still on the account before, and restarts it when asked (vincentzhang on Discord) — Codex CLI can keep an app-server running (codex app-server --managed-daemon) that reads the sign-in once, when it starts, so sessions opened after a switch still ran on the account before. When a switch changes the account while such a daemon runs, Codex's account list shows that it is still signed in as the one before, with Later and Restart; Restart runs codex app-server daemon restart for the Codex home magpie signs in through, which ends the Codex sessions on it, so magpie never does it unasked. magpie accounts switch codex prints the same hint and the command. The notice goes when the daemon restarts or stops, or Codex is switched back. Only a codex program's app-server with --managed-daemon counts: the ChatGPT app's codex and other apps' app-servers don't. Tested with a fake codex and a fake daemon in a sandbox magpie web; the real codex 0.155 has the restart command 2026-09-29 11:59:57 +08:00
yetone 3bc3de79d9 usage: the panel says whether its rings are used or left, and a model named free is marked free (#184, #185) — the panel's usage groups carry a USED/LEFT (已用/剩余) pill on their header that turns every ring as a click on a ring does, and lights a moment when it turns, so the turn is seen; a model whose id or name has "free" as a word (OpenRouter's foo/bar:free, free-model, Qwen3 Free, not freedom-7b) gets the green FREE badge in the provider's model chips, the model picker, the Gateway's model rows and the import preview, titled "free: so its name says". Checked in a sandbox magpie web, light and dark, English and Chinese 2026-09-29 11:57:06 +08:00
yetone 976ae3f45b gateway: Claude Code's body reaches a relay as it sent it, but for the model's name (#179: packy: 您的请求体疑似被篡改) — swapping the model re-encoded the whole body, so its fields went out sorted and its <, > and & as \u003c escapes, and a Claude model's request without thinking gained thinking off; a relay that only lets Claude Code in (packy) took that for a body tampered with. The model is now replaced where it stands and nothing else is touched, a Claude model's request is not given thinking off (Anthropic's models think only when asked), and a model that thinks by default (DeepSeek) has it added at the end with the rest left as sent; other rewrites no longer escape <, > and &. Tested with two requests captured from Claude Code 2.1.284 in a sandbox (85 KB with its tools and system prompt): through the gateway to a keyed Anthropic provider they arrive byte for byte as Claude Code sent them; not yet against packy 2026-09-29 11:47:43 +08:00
yetone c348903159 workbuddy: a chat with no system prompt is sent with one (Jerry lee on Discord: 没有 system 消息时报 first message is not system prompt) — WorkBuddy refuses a chat whose first message isn't the system prompt, which scripts and plain chat clients often send; such a chat now starts with a neutral "You are a helpful assistant.", the rest of the body kept as it was, and one that already starts with a system prompt goes as it is. The comment on WorkBuddy AI's client headers no longer says they fixed "unapproved channel": that answer comes from Claude Code's and Codex's own system prompts (#182). Tested on the account's request body, through the provider as signed in 2026-09-29 11:40:00 +08:00
yetone d287a05161 providers: Amazon Bedrock, with a Bedrock API key (#176: 增加 AWS Bedrock 作为 model provider) — Bedrock's runtime serves Claude on Anthropic's messages at /anthropic/v1/messages and the other models on chat completions at /openai/v1, both taking a Bedrock API key (AWS_BEARER_TOKEN_BEDROCK) with no SigV4, so a vendor preset reaches it: pick one of ten regions and paste the key. Claude ids (anthropic.claude…) go on messages only, the rest on chat only, for the preset and for any provider at a bedrock-runtime host; the runtime has no /models, so the preset's list (Claude as global. inference profiles, plus gpt-oss, Qwen3 Coder, DeepSeek, Kimi, GLM and MiniMax) is it, and a profile kept in one geography (apac., us., eu.…) is typed in by hand and takes its context size from the model it names. The region selector scrolls where its regions don't fit. Tested against a fake Bedrock through the gateway (apac.anthropic.claude-opus-5-5 on /anthropic/v1/messages with x-api-key, gpt-oss on /openai/v1/chat/completions with the Bearer key) and in a sandbox magpie web; not yet against real AWS 2026-09-29 11:29:43 +08:00
yetone 6b546aa81d gemini: 3.8 Flash asked of an account it isn't rolled out to goes as that account's Flash (蒙面人 on Discord: 502 错误 for gemini/gemini-3.8-flash) — the list magpie falls back on has 3.8 Flash and 3.5 Flash Lite, and a model picked from it went to Code Assist under that id whatever the account's experiments said; now, as Gemini CLI would, 3.8 Flash goes as gemini-3-flash and 3.5 Flash Lite as gemini-3.1-flash-lite where they aren't rolled out. Tested against a fake Code Assist 2026-09-29 11:04:46 +08:00
yetone 63b131c1d7 tray: a reset next week shows its date, and the panel keeps one height across its tabs (#181: 重置次数那个地方现在是固定显示周一,但实际不是本周一; #124: 从方案切换到用量,一下子面板就变大了) — a reset time or reset credit's expiry within 7 days showed a bare weekday, so on a Tuesday next Monday read as this week's; now a weekday is shown only for later this week (Monday to Sunday), else the date (10月5日 12:21). The tray panel was as tall as the tab showing; it is now as tall as its tallest tab (capped as before), so switching tabs doesn't resize it, and a short tab leaves room. Checked with Playwright in Chromium and WebKit with the clock on Tuesday 09-29: 10月5日 12:21前有效, and one height on every tab with one account and with five 2026-09-29 11:04:46 +08:00
yetone 6e7546337b grok: Grok Build is found on Windows where its installer puts it (#180: the Grok Build installer finished, but magpie can't find it) — magpie looked for ~/.grok/bin/grok, without .exe, and then only at the first grok on PATH, which on Windows may be another (an npm grok.cmd). Now it looks at GROK_BIN_DIR, the grok home's bin and ~/.grok/bin (grok.exe on Windows), then every folder on PATH and on the registry's PATH, which has what was installed since magpie started, taking a grok there only under a .grok folder; the install-first error gives the PowerShell command on Windows. Tested the order and names of the places looked at, and which grok is taken, in a fake home 2026-09-29 11:04:46 +08:00
yetone 57bcccc980 gateway: Claude Code's own headers reach a key+URL Anthropic provider (#179: 403 packy: This API endpoint is only accessible via the official Claude CLI) — magpie sent Claude Code's request on with only anthropic-version and anthropic-beta and its own User-Agent, so a relay that serves only Claude Code, telling it by claude-cli/ and x-app, refused it. Now a request from Claude Code to a provider without an account goes on with its User-Agent, x-app, anthropic-*, X-Stainless-* and x-claude-code-* headers and ?beta=true as it sent them; its key to magpie never does, the provider's own is set. Tested against a fake upstream: the headers and query arrive, the provider's key and not magpie's, another agent still goes as magpie 2026-09-29 11:04:45 +08:00
yetone 207042dd78 claude: the signed-in account is one account, and one out of quota hands over to the next (#177) — the account Claude Code is signed in to was named one way as a provider and another as a saved login, so it was served twice and its limits weren't found under its name; and claude auth status was asked with magpie's own ANTHROPIC_BASE_URL/token in the environment, telling of those rather than the sign-in. Now both go by ~/.claude.json's email (with the org), the CLI's email when that has none, and the status is asked without magpie's wiring. A turn the CLI ends with an error result (out of quota, rate limited) ends the reply there instead of waiting on, and a non-streamed one answers 429 for quota words, so another account takes over as in a stream. Tested: the account named as its login, the quota result ending the reply, another account taking over 2026-09-29 10:50:39 +08:00
yetone 69a14800d9 warmup: a window that hasn't started is started, and started again after a try that didn't take (#178) — the warm-up only acted on a window with a reset time, so a Codex or Claude account whose 5-hour window had never started (no reset time, nothing used) was never warmed. Now a window the usage reads as not started, or one the agent's windows should have but the reading lacks, is due at once when idle; a try that leaves it unstarted is tried again after 15 minutes, doubling to 4 hours; reading the usage and seeing a window not started kicks the warm-up rather than waiting its 10-minute round, and a warm-up forgets the cached usage so the new window shows. Tested with the repro of the issue, the backoff, and the kick 2026-09-29 10:50:39 +08:00
yetone 7047716de6 gemini: a Gemini CLI account lists the models Gemini CLI 0.61 offers it, Gemini 3.8 Flash among them (蒙面人 on Discord: 请问,这个不显示 Gemini 3.8 吗??) — magpie's list was Gemini CLI's of some versions ago, and the models it fetched were the account's quota buckets, which name models by Code Assist's ids (gemini-3-flash) and never 3.8 Flash. Now, as the CLI does, magpie asks Code Assist which experiments the account is in (listExperiments, at most hourly) and offers what the CLI's /model would: 3.1 Pro Preview or 3 Pro Preview, 3 Flash Preview (previews only with quota for one), 3.8 Flash where Google has rolled it out and 3.5 Flash where not, 3.5 or 3.1 Flash Lite likewise, 2.5 Pro and 2.5 Flash Lite; a request goes out under the id the CLI sends (3.5 Flash as gemini-3-flash, or as gemini-3.8-flash once rolled out), and quota buckets are shown under the models listed. The list magpie falls back on has 3.8 Flash, 3.5 Flash and 3.5 Flash Lite, and no longer the retired 3.1 Flash Lite Preview; magpie says it is Gemini CLI 0.61.0. Tested against a fake Code Assist with the experiments off, rolled out, and without Pro or preview access 2026-09-29 10:43:23 +08:00
yetone 2715696138 workbuddy: WorkBuddy AI chats carry the rest of the headers its own client sends (lightyear, Jerry lee on Discord: deepseek flash 提示 API error:400 workbuddy AI : illegal API invocation from an unapproved channel) — on the international build deepseek-v4.1-flash was refused as "from an unapproved channel" while GPT and Claude answered. WorkBuddy AI's desktop app lists what its /v2/chat/completions gateway needs ("x-requested-with 是网关的准入约定"), and its CLI sends the same on every chat: X-Requested-With: XMLHttpRequest, X-Agent-Intent: craft, X-Agent-Type: main, X-IDE-Name and X-IDE-Version, and conversation, message and request ids; magpie sent none of them. WorkBuddy AI chats now carry them; the China build, which serves that model already, is left as it was. Tested against a fake gateway that the headers and ids go out; not yet checked against WorkBuddy AI itself 2026-09-29 10:43:22 +08:00
yetone c286c218e3 routing: a group's intent classifier can be a routing group, failing over as any request to it does (lantern2077 on Discord: 意图分类模型能否也选择路由组?现在只能选择单个模型,缺乏回退保障) — the classifier was one model, and when it was down no intent matched. It can now be group/<id>, asked through magpie as before, so its first model failing the next is asked. A group can't be its own classifier, one that classifies for another can't be removed until that one chooses another, a rename carries over, and a classifier's own call asks no classifier in turn, so two groups classifying with each other don't loop. The GUI and TUI pickers list the other groups. Tested: the classifier group's first model 500s and the next answers and the rule matches; two groups set to classify with each other finish at once; checked in a sandbox magpie web that the picker lists Cls and not the group being edited, and via the CLI that self-classifying and removing a classifier group are refused 2026-09-29 10:25:41 +08:00
yetone 1963f7f262 providers: a provider's editor lists its image models under its models (Raven on Discord: 同样的 baseurl 和 key,识别不出来里面的 image 生图模型,cc 那边可以) — an image model isn't one an agent chats with, so it was never among a provider's Models chips, and nothing in the editor said magpie had seen gpt-image-1 in the vendor's list. Under Models an Image models row now lists them, as chips that can't be picked, saying the one that draws is chosen in Settings → Images. Tested with a fake vendor listing gpt-5.5, gpt-image-1 and flux-1-schnell; checked in a sandbox magpie web that the editor shows gpt-5.5 under Models and the other two under Image models 2026-09-29 10:17:30 +08:00
yetone 40fc5a8d87 panel: the tray panel stops at 560 points tall, not 720, and the rest scrolls in it (#124: 托盘图标这里 体验优化~用量这里 一下子弹出来多大一个框) — with several subscription accounts the Usage tab grew the panel to 720 points, most of a 1080p screen, dropping down from the tray as a big box; the panel now stops at 560 and the accounts scroll under the tabs, the footer staying put, as they already did past 720 2026-09-29 10:15:13 +08:00
yetone 034da2b693 providers: one that only draws images says how many image models it has, not "no models exposed" (#124: 供应商里面img模型读不出来,只有在设置里面可以看到) — an image model isn't one an agent picks, so a provider whose list had only image models read "no models exposed" under Providers although Settings → Image generation drew with them. Its row now reads 2 image models. Checked in a sandbox magpie web with a custom provider whose /v1/models lists gpt-image-1 and flux-1-schnell 2026-09-29 10:04:30 +08:00
yetone 93d74d2b81 workbuddy: requests are streamed to it, Test's too (#124: 测试 400 · Non-stream chat request is currently not supported, 对话正常的) — WorkBuddy refuses any request that doesn't stream, so its Test, a small non-streaming request, failed with 400 while agents, which stream, answered. A WorkBuddy account is now a backend that only streams: Test sends it stream:true, and the gateway streams it a client's non-streaming request and gives the client one answer, as it does Codex's and Google's. Tested: Test's request to such a backend streams on each endpoint, and a non-streaming chat request through the gateway to a fake upstream that refuses one comes back as one chat.completion 2026-09-29 10:01:21 +08:00