Commit Graph
137 Commits
Author SHA1 Message Date
yetone 8df77e69aa grok 0.1.7: a 429 shows a spent Rate limit window on the card until it lifts (H20 on Discord)
Grok's billing (/v1/billing?format=credits) says nothing of a plan's rate
limit: a free account read 0% used, 100 left, while its requests came back
429. The plugin now keeps an account's last 429 (by its CLI home) and
usage shows a "Rate limit" window at 100%, aside, before the period's,
until the reset the 429 named (Retry-After in seconds or as a date, or a
*ratelimit*reset* header), or, with none named, until a request goes
through or 5 minutes have passed. magpie's gateway already rests the
account; this is what the card says.
2026-10-05 20:51:52 +08:00
yetone d9236e976f middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon. 2026-10-05 20:49:42 +08:00
yetone 5d2621db88 factory 0.1.17: DeepSeek V4.1 Flash, Kimi K3 and GLM-5.2 offer none, so a request turning reasoning off stops their thinking (yetone/magpie#899, tedestar) — they offered only low/high/max (GLM-5.2 high/max), so magpie asked for low and they thought anyway. droid 0.231.0 lists off for them and sends reasoning_effort "none"; Fireworks (via OpenRouter, pinned) answered none with 0 reasoning tokens on DeepSeek V4.1 Flash (2 completion tokens, 19 at default) and Kimi K3 (8, 71 at default), and turns none away on GLM-5.3 and GLM-5.3-Flash ("Reasoning is mandatory"), whose least stays low. effort.test.mjs is new (the levels fail on 0.1.16); bun test and check.mjs pass. 2026-10-05 19:54:33 +08:00
yetone 6b13dc05e4 zcode 0.1.10: a gift-only account's spent bucket doesn't hold up a model another of its plans still has (ganlerk on Discord) — an account with both ZCode Trust Build (GLM-5.3-Flash 14.5% used) and the Start Plan (GLM-5.3-Flash all used) showed the Start Plan's spent bucket as counting GLM-5.3-Flash, so magpie read the model, and the account, as 100% used and sent Flash requests elsewhere. The server picks the bucket (ZCode sends no plan with a request), so a gift-only account's usage now counts each model on its live bucket, the least used, and sets spent siblings aside, as an account with a coding plan already did. bun scripts/check.mjs zcode and the zcode tests pass; the new gift test fails on 0.1.9. 2026-10-05 19:50:37 +08:00
如是andyetone 42783f0033 trae: one package, two realms — Trae Global folds into packages/trae (#23)
* trae: one package, two realms — Trae Global folds into packages/trae

The review asked for this and it is the right shape: the two deployments
share one implementation. 86 of the 89 top-level names were already the
same code; what differed was a table's worth of values (hosts, client,
versions, usage page, fallback models, error codes) and two realm-only
branches. A separate copy meant every request, stream and tool-call fix
had to be made twice, and it had already drifted (the 0.1.15 Max fix
came back as a bug there).

packages/trae now holds a SITES table with two entries — trae-cn and
trae-global — and makePlugin(site) builds a provider from one. Exported
as TraeCNAuthPlugin and TraeGlobalAuthPlugin. The CN values are moved
verbatim, not re-derived: same hosts, client id, app id, IDE/client
versions, plugin version, brand, functions, fallback models, credits
page, and its own check-in pages. The international entry carries what
only it has: the second (US) deployment and the region that selects it,
the dollar billing's entitlements page, its own model names, and its
extra lapse/quota codes (20101, 4011).

The CN plugin needs the stream fix too (the review's point), so the
AbortController the loader now builds per request, openai()'s abort, and
sse()'s finally are in this one implementation for both realms — as is
the wrong-function retry releasing the read it leaves behind.

fake.mjs takes a realm id, defaulting to CN so every test written before
the fold is unchanged. The global tests move to global.test.mjs, plus
new ones for what only the international realm does: the US/SG routing
of a request and of a saved sign-in, its own error codes and error name,
the dollar usage page, and its fallback model list. chatModel gains the
picker's invisible-entry filter (paygo/auto twins, search agents) and
the config hook names the realm's own provider.

The acceptance test: packages/trae/*.test.mjs' 48 CN tests are untouched
and green — that is the proof the refactor changed no CN behaviour, with
its constants verified line by line against HEAD. bun test: 63 pass
(48 CN + 15 global); bun scripts/check.mjs trae: ok.

registry.json: one entry, providers [trae-cn, trae-global]. README: both
realms, each realm's endpoints, usage page and codes; the verification
range stated honestly (CN never run live; Global on one Free SG account,
no Pro and no US account).

* trae: Trae CN's model lists stay whole; only Global hides is_invisible_to_user

The fold filtered is_invisible_to_user for both realms, which took 40 of
Trae CN's 76 models out of its list. CN is served as before; Global (a
site flag, hidesInvisible) keeps the filter. Also: the unsupported-request
error names the realm, and two duplicated/merged comments are tidied.

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-05 17:18:12 +08:00
yetone 838f6470dc cline 0.1.4: usage shows ClinePass's 5-hour, weekly and monthly limits (zRain on Discord) — ClinePass counts usage against a rolling 5 hours, the calendar week and the calendar month, but the plugin's usage showed only the credit balance. It now also reads /api/v1/users/me/plan/usage-limits, what app.cline.bot's subscription page reads ({limits: [{type: five_hour|weekly|monthly, percentUsed, resetsAt}]}), with the same bearer, as 5 hours / Weekly / Month windows with their spans and resets. An account the limits can't be read for (no ClinePass) keeps its balance and its sign-in. bun test and check.mjs pass. 2026-10-05 16:17:38 +08:00
yetone 99cac44cf8 registry: hold Trae Global back until its first version is on npm — @magpie-community/opencode-trae-global-auth is new, trusted publishing can't create it (publish run 37282007405), so magpie's Plugins page listed a plugin whose install failed. Listed again once its first version is published by hand. 2026-10-05 16:12:20 +08:00
如是 228628689f Add Trae Global (trae.ai) plugin - trae-global provider (#22)
* Add Trae Global (trae.ai) plugin — trae-global provider

Trae international (trae.ai, ByteDance's AI IDE international build) as a
provider plugin: sign in with Trae's own browser flow, free tier included,
models served through the international llm_utils_chat gateway.

Same plugin contract and request/response machinery as the Trae CN
plugin (packages/trae), a separate deployment: different domains, OAuth
client, model catalog, plus a US region (coreva) routed by the account's
AIRegion. The usage card reads the dollar billing's entitlements
(basic+bonus allowance) from the pay host, with the Free plan's /month
allowance riding it.

bun test: 41 pass; bun scripts/check.mjs trae-global: ok

* trae-global: a stream the agent walks away from closes Trae's connection

The bug: an answer whose tool call the agent acts on is cancelled mid-read,
and the read to Trae was left hanging. A generator's return cannot break a
read that is already waiting on reader.read(), so the SSE reader kept its
half of the connection open, and the host the next ask reused was one Trae
had dropped — a stream that runs, then dies, exactly around tool calls.

The fix: the answer's fetch is what gets stopped. The loader builds one
AbortController per request, follows the caller's abort signal into it, and
openai() aborts it when the stream is cancelled. sse() also lets its reader
go in a finally, for the paths that end the generator rather than the fetch.

stream.test.mjs: the agent reads, then cancels with nothing more coming, so
only aborting Trae's fetch can release the read — red before, green after.
bun test (42 pass); bun scripts/check.mjs trae-global: ok

* trae-global: the review's three blockers — planLocked, the 0.1.15 Max, usage's error code

planLocked is gone. It read display_contact_config's identity_list and
assumed every account is Free (identity 0), so a paying account lost
exactly the models it pays for — gpt-5.5, the gpt-5.6 family, gpt-6,
glm-5.2 — and could never pick them. The plugin is never told the
account's own identity (not at sign-in, not in the entitlement answer),
so nothing is filtered on identity now: the list is the account's own,
the IDE greys out what the plan locks, and a locked model answers Trae's
own 1005 when asked. The picker's invisible entries (paygo/auto twins,
search agents) stay out, as before.

maxModel takes the 0.1.15 fix: a model's Max is found across every list
that names it, not just the one entry the model is listed through —
chat_v3 can name the __max model while the SOLO list names only __dev,
and the window can be another entry's again. Without it the same
"no -max model" bug the CN plugin fixed in 0.1.15 comes back here.
maxes holds each model's Max for the models hook, as CN's does.

usage: a 200 carrying an error code (e.code !== "0") now says Trae's own
message instead of "no entitlement pack in the answer", as CN's does.

README: the verification range is stated honestly — one Free account,
SG realm, no Pro and no US account tried; paid-account behaviour is
implemented from the interface's shape, not confirmed on a live one.
registry.json marks Trae Global experimental, as Trae CN is.

usage.test.mjs: the locked-model test now asserts the paying account's
list, and a new one asks a paid account's gpt-5.5 through the gateway.
stream.test.mjs: a Max split across lists is listed and asked where its
__max model is named. Each red before its fix, green after.
bun test (46 pass); bun scripts/check.mjs trae-global: ok
2026-10-05 16:10:35 +08:00
erlinerd dbd14ccb98 zcode 0.1.9: the gift's models are trial entries the user picks, not an automatic gift-first route (#21)
Why: 0.1.8 sent every request for a gift-served model to the gift first, so a user who meant to spend the coding plan had no say, and the card hid the gift's models behind notModels. The gift is an allowance outside the plan; spending it should be a choice.

What: every model a live gift bucket serves is listed again as <model>-Trial, in the catalog's spelling (GLM-5.3-Flash-Trial), and a request for that entry goes to the gift dressed as ZCode's own; a plain model always spends the coding plan. A trial entry whose bucket is spent or blocked answers 429 without touching the coding plan, as do the gift's quota errors (1113, 1005 inside a 200); any other gift answer goes on as it came. The usage card names the gift window by its trial model, drops the plan prefix, and puts MCP - Month last.

Tests: dual.test.mjs rewritten for the new routing (a plain model to the coding plan whatever the gift holds, a trial entry to the gift), usage.test.mjs and gift.test.mjs follow the naming; bun test (65 pass in the package, 516 in the repo) and bun scripts/check.mjs zcode pass.
2026-10-05 14:24:17 +08:00
yetone a26f884820 devin 0.1.8: which models take images is what Devin tells its CLI's model picker (面条 on magpie's Discord: swe-2 takes images) — devin models list says nothing of images and models.dev doesn't know Devin's own ids, so swe-2, swe-1.7 and the like were listed as text-only and agents dropped their images. Once signed in, with the CLI or without it, the plugin asks GetCliModelConfigs (the read-only call the CLI's picker makes, as magpie's built-in does in devin_images.go) and puts each model's supports_images on it: a variant its own, a family and its fast run what all its variants say. It is cached as the list is (5 minutes, 1 after a failure). The config hook's list says what Devin said on 2026-10-05 (GLM-5.2/5.3, Inkling, Nemotron, DeepSeek V4 Flash and V4 Pro take none, every other one does); a model Devin says nothing of keeps models.dev's word. With the owner's real Devin account: swe-2-high/medium/max, swe-1-7, swe-1-7-medium and swe-1-7-lightning(-medium) described an inline PNG's colours through the plugin's fetch, and provider.models listed swe-2 with image input, with the CLI and without it. images.test.mjs (5 tests) fails on 0.1.7; bun test (31 pass) and bun scripts/check.mjs devin pass. 2026-10-05 13:18:46 +08:00
yetone 436a861e2d trae 0.1.15: a model's Max is found across the lists that name it (ARNO on magpie's Discord: no deepseek-v4.1-flash-max) — 0.1.14 looked for it only in the entry the model is asked through, which needs both a __max model and a bigger context_window_tokens.max. Trae CN lists deepseek-v4.1-flash in several functions (yetone/magpie#681) whose entries needn't agree: chat_v3 names the __max model, while the SOLO entry it is asked through names only __dev (and that is where the windows are), so no Max was listed. The __max model is now the first any of its entries names (the one asked through first), the windows the first any gives, and the Max is asked through the function that names the __max model. A __max model with no bigger window anywhere is still no Max. 1 new test fails on 0.1.14; bun test (48 pass) and bun scripts/check.mjs trae pass. Not tried with a real Trae CN account (none here). 2026-10-05 13:10:38 +08:00
yetone 98ce4a8dc0 cline 0.1.3: a pinUpstream option sends DeepSeek's models through DeepSeek's own API only, as magpie's built-in ClinePass tick does (ARNO on magpie's Discord) — with it on (the plugin's own options, or OpenCode's provider.cline.options.pinUpstream), a chat request for a DeepSeek model (cline-pass/deepseek-…, not cline-free/) carries "providerOptions":{"gateway":{"only":["deepseek"]}}, written in before the body's last } so the cached prefix is the client's byte for byte. Other models, and a request with providerOptions of its own, go as sent; off by default. README says how to turn it on in magpie and OpenCode. 5 new tests fail on 0.1.2; bun test (63 pass) and bun scripts/check.mjs cline pass. 2026-10-05 12:42:21 +08:00
yetone 4c4e91689e trae 0.1.14: GLM's own <arg_key>/<arg_value> calls are calls, answer text under unnamed events isn't lost, reasoning written into the text isn't the answer, a failed reply doesn't say stop, and a model's Max context is a model of its own (歧路亡羊 on magpie's Discord) — GLM wrote <tool_call>read<arg_key>path</arg_key><arg_value>a</arg_value></tool_call>, its own template, which wasn't read: the call went to the agent as text. It is now a call (a string argument as written, other types read as JSON, split over events or not), as is a native call whose name holds the whole call (as JSON or in that template). A call to a requested tool named but for case or punctuation (Read) goes on as the request's (read); any other name goes on as written, so the agent can tell the model it doesn't exist. Text under an event named delta, message, content… or none was skipped; it is the answer's now. A {"reasoning_content":"…"} object in the text is reasoning, and reasoning Trae sends again is sent once. done's finish_reason length/max_tokens is length; a reply that fails (an error event, or Trae's stream breaking off) ends with the error and [DONE], not a stop and its usage, and the stream is closed whatever happens (an agent going away stops the read). A config with a __max model and a bigger context_window_tokens.max (deepseek-v4.1-flash: 1M, 64K–128K out) is listed again as <id>-max, "… (Max)", with that window and output; it asks the config's __max model with max_tokens set and user_message_context.model_info.prompt_max_tokens = window − max_tokens. Reasoning effort: Trae's request takes no level, so no variants are listed (as before) and the README says a picked level does nothing. 9 new tests fail on 0.1.13; bun test (46 pass) and bun scripts/check.mjs trae pass. Not tried with a real Trae CN account (none here). 2026-10-05 11:41:17 +08:00
yetone 9d429b8663 trae 0.1.13: a <tool_call> with only DeepSeek's closing tags after it says nothing, and one wrapping DeepSeek's own invoke is the call (magpie#823 again, Dazzle-sys: Trae CN's DeepSeek V4.1 Flash in Pi showed <tool_call> </|DSML|parameter> </|DSML|invoke> </ as its reply) — the reply (17 tokens out) was our opener with no JSON in it, then DeepSeek's closes, cut short. A <tool_call> was read only for a JSON object, so with none it was held to the end and handed on as text, which the agent showed and the model read back. A <tool_call> whose content starts with a tag (or is empty at the end) now has its opener dropped and what follows read as it is: an invoke in it is a call, stray tags are dropped, and a tag cut short at the end (</) after them too. A block holding plain text stays as it was. The new test fails on 0.1.12; bun test (36 pass) and bun scripts/check.mjs trae under a temp HOME pass. Not tried with a real Trae CN account (none here). 2026-10-05 05:05:53 +08:00
yetone c172d93901 trae 0.1.12: a reply limit Trae doesn't give is none, not a made-up 32K, and a request asking more than Trae's is held to it (ARNO on magpie's Discord: Trae CN's deepseek-v4.1-flash said maxTokens 32000) — a model whose list names no __dev max_tokens (deepseek-v4.1-flash in chat_v3, kimi-k2.6, the fallback list's) was given MODEL's 32_000, which agents were told as its reply limit. It is now 0, which magpie reads as unknown and fills from models.dev (DeepSeek V4.1 Flash's 384K); one Trae gives (glm-5.2__dev's 32000, deepseek-v4.1-flash__dev's 64000 in solo_agent) is kept, and a request asking more than it is sent with Trae's. The new test fails on 0.1.11; bun test (35 pass) and bun scripts/check.mjs trae under a temp HOME pass. Not tried with a real Trae CN account (none here). 2026-10-05 04:29:12 +08:00
yetone 20cd6f1bb2 trae 0.1.11: a tool call DeepSeek closes with its own tags, or writes as its own invoke, is a call, and its tags don't reach the agent (magpie#823, Dazzle-sys: Trae CN's DeepSeek V4.1 Flash in a group, in Pi, ended the session) — DeepSeek V4.1 Flash wrote <tool_call>{"name":"bash",…}</|DSML|parameter></|DSML|invoke, closing our block with its own tags rather than </tool_call>, or its own <|DSML|invoke name="…"> with <|DSML|parameter>s: neither was read, so the call went to the agent as text. A <tool_call> block is now taken once its JSON object is whole, whatever closes it; DSML invokes (full-width or plain bars, in function_calls or not, several in a row) are calls, a string="true" parameter its text and any other its JSON; the tags and blanks left around a call are dropped, a stray tag too. The new test fails on 0.1.10; bun test (34 pass) and bun scripts/check.mjs trae under a temp HOME pass. Not tried with a real Trae CN account (none here). 2026-10-05 03:23:58 +08:00
yetone 32aaeda5a6 trae 0.1.10: a tool call written as a tagged block with a file's content raw, or with its arguments beside the name, goes on whole, and an argument piece that names no call joins the one being written (magpie#799, mintonight: pi's write went out as {} and was refused, the turn ended mid-sentence; earlier <tool_call> blocks showed up as text) — a model writing a file through <tool_call>{"name":"write","arguments":{"content":"…"}}</tool_call> puts real newlines and tabs in the JSON string, which JSON.parse refuses: the block went to the agent as text, and a call parsed with nothing under arguments went as {}. Blocks are now read leniently (raw control characters inside strings taken as escaped), a block that gives its arguments beside the name has them taken, and a string of arguments is normalised. Native calls: a piece with neither id nor name (or an index its call's first event didn't give) joins the call still being written instead of being dropped, and arguments still not JSON at the end are read the same lenient way. Three tests fail on 0.1.9; bun test (33 pass) and bun scripts/check.mjs trae under a temp HOME pass. Not tried with a real Trae CN account (none here). 2026-10-05 02:11:07 +08:00
yetone 64c9e6c34c trae 0.1.9: the daily check-in goes as it did on 0.1.6, with the chat's headers and {} (yetone/magpie#808, Hu9956 on magpie 0.1.880: TraeCN自动签到失效,中午还行来着,更新后就不行了) — 0.1.7 (published 13:12 Beijing on 10-04) sent api.trae.cn's /trae/api/v2/ug/ pages with only the JWT and the device's headers (ugHeaders: no x-uid, x-app-id, x-ide-token, x-machine-id, yet x-app-version still SOLO's 0.1.69) and {req_source:1} (ugBody); Hu9956's check-in, which went through at noon on 0.1.6, has failed since. Both are taken out: the check-in is sent as every other Trae page is (ideHeaders, the body magpie gives), and the test that checks it goes as the account with {} and x-uid is back (it fails on 0.1.8). bun test (30 pass) and bun scripts/check.mjs trae under a temp HOME pass. Not tried with a real Trae CN account (none here); the reporter's account is the check. 2026-10-05 00:34:11 +08:00
yetone b14b4d80c5 trae 0.1.8: a tool call Trae streams over several events goes on whole, not as its first event (magpie#799, mintonight: Trae CN models fail many tool calls — bash got echo "T, read got C:/Users/j, edit got {}) — Trae sends a native tool call in several output events under one id or index, each carrying the arguments so far or only the new piece; the plugin sent the first event of each id on and dropped the rest as repeats, so a call whose arguments came in more than one piece reached the agent cut short. NativeCalls now puts each call together across events (arguments that start with what came before replace it, a piece is appended, a repeat is ignored, a piece without a name joins its call by index) and sends the calls once the answer is whole. A test streaming one call cumulatively and one in pieces fails on 0.1.7; bun test (32 pass) and bun scripts/check.mjs trae pass. 2026-10-05 00:02:33 +08:00
erlinerd d22ac2039a zcode 0.1.8: spend an account's gift plans before its GLM Coding Plan, and show both on the usage card (#19)
Why: a GLM Coding Plan account can also hold gift plans from ZCode
activities (a "Trust Build" grant, say). They lapse on a fixed date, and
every request went to the coding plan, so their allowance went unspent.

What: plansOf now reads the gift's balance (per the ZCode session, kept
10 minutes) and takes the union of the models every live bucket of every
active gift plan still serves (not expired, remaining_units > 0). A
request for a model the gift serves goes to the Start Plan first, dressed
as ZCode's own client; when the gift can't serve it — any answer 400 or
over, or its quota error inside an HTTP 200 (code 1113/1005) — the
request is replayed once to the coding plan as the agent sent it. Only a
quota answer keeps that model off the gift for a minute; a 405 refusal is
asked again next request. The usage card shows the coding plan's windows
and the gift's buckets together, each bucket prefixed with its plan's
name; a gift read that fails leaves just the coding card. A pure gift
account (no coding plan) behaves as before.

Tests: dual.test.mjs, 14 tests — routing, replay, the 60s quota block,
the 200-with-quota-error case, stream passthrough, an expired ZCode
session, the cache TTLs, a multi-plan union and a gift-only account;
HOME=$(mktemp -d) bun test (37 pass) and bun scripts/check.mjs zcode pass.
2026-10-04 20:04:08 +08:00
yetone 9fefe75f15 factory 0.1.16: requests say droid 0.233.0, the current release (Discord, JL on magpie 0.1.824 with plugin 0.1.15: every model 403 "Factory: Forbidden" from pi and Claude Code, while droid itself works) — droid 0.233.0's model requests carry the same headers, paths and body shape as 0.231.0's apart from its version (X-Client-Version, User-Agent factory-cli/<ver>), and its binary reads a server-side min_cli_version; the plugin said 0.231.0, two releases behind. Whether Factory refuses an old version with a 403 is not confirmed (no Factory account to try with); this is the one difference found. bun test (79 pass) and bun scripts/check.mjs factory pass. 2026-10-04 18:26:33 +08:00
yetone c3ba3ef1ab devin 0.1.7: an account is named as Devin names its key, not as the devin CLI's own account (#17: on Windows, "Add another Devin account" labelled account B's token as A and replaced A's key with it)
success() named a key's account by `devin auth status`, run with APPDATA and XDG_DATA_HOME set to a data folder of the plugin's own; the Windows CLI ignores both and reads %APPDATA%\devin\credentials.toml whatever it is given, so every browser sign-in was named after the CLI's own account. familiesFor() had the same flaw: `devin models list` there lists the CLI's account's models for every key.

- success() asks GetUserStatus with the key (the call usage() makes, now shared as userStatus()) and names the account by its email (or name) and tier (TEAMS_TIER_DEVIN_PRO is "Devin Pro", else planName); a key Devin refuses (401) fails the sign-in. Only when Devin can't tell does it fall back to the CLI.
- identity() no longer trusts a CLI whose report names a credentials file outside the data folder it was given (the "File:" line); it can't tell then, and the account is "Devin".
- familiesFor() asks the CLI for a key's models only once the CLI answers for it: it reads the key's folder, and the account it names is the one GetUserStatus names. Otherwise (Windows) the account keeps the declared SNAPSHOT list, and the CLI isn't asked again for that key.

identity.test.mjs (a fake devin CLI always signed in as a@x.dev): key B is named b@x.dev; a refused key fails; with Devin unable to tell, a CLI reading its own folder doesn't name the account and one honouring the folder does; the models list isn't taken from a CLI that reads another folder or names another account, and is from one that answers for the key. They fail against 0.1.6. HOME=$(mktemp -d) bun test (474 pass) and bun scripts/check.mjs pass.
2026-10-04 17:02:17 +08:00
yetone 3ad0e49baf cline 0.1.2: each model says the context window Cline's catalog gives it, rather than none (Discord, ARNO on magpie v0.1.815: cline插件的模型都没有默认的上下文窗口大小) — configModel and runtimeModel wrote limit {context: m.context ?? 0, output: 0} and nothing ever set m.context, so every Cline model came to magpie and OpenCode with a window of 0. Cline's /api/v1/ai/cline/models (the cloud catalog the plugin already merges in) gives each entry OpenRouter's context_length and top_provider.{context_length, max_completion_tokens}: fetchCloudModels now keeps the window as context (tokens(): a positive count, strings read as numbers), and fetchFeed gives a recommended-feed model the catalog's window for its id, as the recommended feed has none. The reply limit stays 0: max_completion_tokens can be most of the window (kimi-k3 943718 of 1048576), and OpenCode keeps a model's output limit free of its window, so it would compact a tenth of the way in. The cline-free/… and cline-pass/… ids aren't in that catalog and still say 0; magpie takes models.dev's window for the id after the prefix there (README says so). index.test.mjs gains "the models hook gives each model the window Cline's catalog has for it, and no reply limit" (fails on 0.1.1); bun test (59 pass) and bun scripts/check.mjs cline under a temp HOME pass. Against the live api.cline.bot (no sign-in): 466 of 484 models now carry a window (claude-sonnet-5.5 1000000/128000, gpt-6.1-sol 1050000/128000, kimi-k3 1048576/943718 as Cline gives it), cline-free/mimo-v2.6-flash 0. Not tried with a signed-in Cline account. 2026-10-04 13:36:38 +08:00
yetone 709e4dc79b trae 0.1.7: the daily check-in is sent as Trae CN's IDE sends it (Discord, ARNO on magpie v0.1.813: trae-cn的签到功能会失败) — ownRequest sent api.trae.cn's check-in pages with the chat's headers (x-uid, x-app-id, X-Cloudide-Token, x-ide-token, x-machine-id, x-ide-version… as TRAE SOLO CN's ai-agent sends llm_utils_chat) and the body magpie gave ({}). Trae CN 3.3.104's own client (out/main.js, eb()/fb(), from the linux tarball the version API names) posts /trae/api/v2/ug/checkin_credits/status and /claim with {req_source: 1} (2 only for SOLO Lite/enterprise) and only Content-Type, Authorization: Cloud-IDE-JWT and the device's x-device-id, x-device-brand, x-device-type, x-os-version, x-app-version. Pages under /trae/api/v2/ug/ now go with those headers (ugHeaders) and {req_source:1} where none or {} was given (ugBody); Trae's other pages are sent as before. Trae's 9074 (当前参与用户太多) is a device-level risk control that both open-source check-in clients say trips on requests that don't look like the client's; whether that is what ARNO saw is not known (no error text, and no Trae CN account to try with). checkin.test.mjs gains "the check-in is sent as Trae CN's IDE sends it" (body and header set; fails on 0.1.6); bun test (30 pass) and bun scripts/check.mjs trae under a temp HOME pass; the plugin's fetch against the real api.trae.cn with a placeholder token answers 200 code 1001 marked expired, so the route is reached. Not tried with a real Trae CN account. 2026-10-04 13:12:51 +08:00
yetone 2caced14ef trae 0.1.6: the usage card says Trae CN's credits in the Credits row, as WorkBuddy's, not as an English balance line under it (yetone/magpie#694, Hu9956 on magpie 0.1.784: 积分显示的样式有点不一样 — WorkBuddy's cards read "积分 1,689.01 / 2,400 积分 · 剩余 70.4%", Trae CN's "积分 剩余 60.7%" with "余额 2307.42 of 3800 credits left" in large type below) — usage gave the share alone on its Credits window and the count as a balance string, "<left> of <limit> credits left", which magpie shows as a separate 余额 row (balanceRow, beside windows) in the plugin's own English and number format, and never flips with 已用/剩余. The window now carries the count as WorkBuddy's does (amount = credits used, limit = the packs' total, unit "credits", magpie#659), so magpie's quotaCount writes "2,307.42 / 3,800 积分 · 剩余 60.7%" (or "1,492.58 / 3,800 积分 · 已用 39.3%"; "credits" in English) in the row itself, and the balance is left out; an unlimited account still says "unlimited" as its balance. No magpie change needed: plugin_usage.go already passes a plugin window's amount, limit and unit to the card. usage.test.mjs now expects the window's amount/limit/unit and no balance (fails on 0.1.5); HOME=$(mktemp -d) bun test (465 pass) and bun scripts/check.mjs trae pass. Checked in magpie's Usage page (webkit, zh and en, API faked with the old and new shapes beside WorkBuddy and WorkBuddy AI cards): the Trae CN card's row reads like WorkBuddy's and the 余额 line is gone. Not tried with a real Trae CN account. 2026-10-04 13:07:10 +08:00
yetone b2ddbc5017 commandcode 0.1.8: a model of the plan takes pictures as its maker's models do, not none of them (ARNO on magpie 0.1.810, Discord: command code provider 的所有模型都没有自动勾上支持图片输入) — Command Code's /provider/v1/models gives no modalities (all 86 entries, testdata/models.json and the live list read from a moved account's plugin-providers.json alike), and runtimeModel always set capabilities.input.image to !!m.images, false for every model, which magpie's plugin host reads as the plugin's answer (host.js: imageSaid when the value is a boolean) and takes over models.dev's. So every model of a moved plan, Claude, GPT-6, Kimi K3 and Qwen 3.8 included, showed no image input, where the built-in (whose list said nothing either) answered from models.dev (catalog.SeesImages). runtimeModel now says image only when m.images is a boolean; liveModels takes the list's modalities when it gives them, else the default list's answer (which now marks Claude Sonnet 5, Opus 5.5, GPT-6 Sol, Kimi K3 and MiniMax M3, as models.dev has them; DeepSeek V4 and GLM-5.3 read text alone and say nothing), else the CLI's table's (GO_MODELS, Pixel Canary among them), else true for a Claude model, and of any other says nothing, so magpie answers from models.dev as the built-in did (DeepSeek V4, GLM-5.x, MiniMax M2.x, Hy4 and the rest models.dev calls text-only stay without). A list that gives modalities is taken at its word, an explicit text-only included (the old || undefined dropped it). Go's goModels is unchanged but no longer says false for a model the table doesn't mark. models.test.mjs gains a test (a Pro account's 86 models: known image models say true, the rest leave image unsaid, a list's own modalities win, Go keeps the table's); it fails on 0.1.7 and passes. HOME=$(mktemp -d) bun test (459 pass) and bun scripts/check.mjs commandcode pass. Not tried in a real OpenCode/magpie session with the new version; magpie needs the mover's min raised to 0.1.8 for moved users to get it. 2026-10-04 12:04:57 +08:00
yetone b5fc67f0f4 kiro 0.1.7: a Builder ID sign-in is asked with Builder ID's service profile, so its models are listed and served, as the built-in (#16, YuanZhe-99: a Kiro Student account moved to the plugin was offered no claude-opus-5.5 or claude-sonnet-5.5, which the built-in listed) — a Builder ID sign-in (kiro-cli's, the Kiro IDE's or one made here) names no profile, and Kiro won't list one for it: List-Available-Profiles answers 403 "AWS Builder ID is not supported for this operation" in both regions, so profileOf threw, provider.models fell back to Auto alone, and usage and chat failed. magpie's built-in has asked such a sign-in with the service profile kiro-cli and the IDE use (arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX) since magpie 40102f74 (yetone/magpie#422); the plugin now does as it does: kiro-cli's odic sign-in with Builder ID's start URL or none, the IDE's with provider BuilderId, and one signed in here (or moved from the built-in) with loginProvider BuilderId take it without asking, and an AWS sign-in whose profile listing is that 403 takes it too. Identity Center sign-ins still have their profile listed. builderid.test.mjs (fake management and runtime API: one signed in here lists claude-opus-5.5 and chats under the service profile, the 403 found, Identity Center unchanged, kiro-cli's with and without a start URL, the IDE's) fails 4 of 5 on 0.1.6 and passes; bun test (28 pass) and bun scripts/check.mjs kiro pass under a temp HOME. Checked for real with a Google sign-in (profile listed, models listed, claude-sonnet-4.5 answers): unchanged. Not tried with a real Builder ID or Kiro Student account (none here). 2026-10-04 12:04:57 +08:00
yetone a839119751 qoder 0.2.6: the window a request is sent holds the reply's max_tokens too (yetone/magpie#700 follow-up, kyzhouxu: a group's DeepSeek V4.1 Flash refused near 207K until Qoder's DeepSeek-Flash was taken out of it) — since 0.2.5 windowFor sends the model's default window (200K on the models context_config lists 200K/400K/1M for) while the request's estimate, a token per 3 bytes of its messages and tools, fits it, and asked for nothing of the reply: a 180K conversation with the 32000 max_tokens Qoder is sent went out with context_length 200000, which a prompt plus reply past 200K overflows, while magpie and the agents behind it are told the model takes 1M. The estimate now adds the reply's max_tokens (what qoderBody sends), so that request is sent 400K; a short one still gets the default window. Qoder's own metadata does say 1M for dfmodel: its live listing's max_input_tokens was 1000000 (the context 0.2.4 cached for it in a sandbox magpie on 2026-10-03, where MiniMax-M3 read 180000) and 0.2.5 reads 1M as its largest window, and docs.qoder.com/cli/model lists DeepSeek-V4-Flash with 200K / 400K / 1M, so the reported context stays 1M. When kyzhouxu's refusal happened isn't known: #700 itself (ynky007) was opened before 0.2.5, when every request was sent context_length 1000000, and their comment came after it (2026-10-04 03:34 UTC), so this is the way 0.2.5 can refuse a request under the window magpie reports, not shown to be what they hit. context.test.mjs gains the case (180K prompt: 200K with max_tokens 1000, 400K with 32000 and with none asked); it fails on 0.2.5 (200000) and passes; bun test (49 pass) and bun scripts/check.mjs qoder under a temp HOME pass. Not tried with a real Qoder account. 2026-10-04 12:00:17 +08:00
Mars-Sea 4a368481b0 factory 0.1.15: GPT-6.1 Sol, in droid 0.233.0's picker, reaches Factory through magpie (#15)
MODELS predated GPT-6.1 Sol, so a droid account whose policy allows the
model could not reach it through the plugin. droid's built-in picker, read
by giving "droid exec -m" an id it rejects (it prints the whole list),
names it gpt-6.1-sol — droid spells the minor with a dot, as it does
gpt-5.6-sol, not the gpt-6-1-sol other providers' plugins carry.

It goes on RESPONSES with openai as its vendor, 1050000 context and
128000 output like the rest of the GPT-6 family, images on. Factory's
docs list low, medium, high, xhigh and max for it and no none (gpt-6-sol
and gpt-6-luna have one), so it takes E5 rather than E6. The same docs
were read against the other 30 entries: their efforts are correct.

The picker also offers 19 models this list lacks: Claude Opus 4.5, 4.6
and 4.7, Claude Sonnet 4.5, GPT-5.2, GPT-5.4 Mini, GPT-5.5 Pro, Grok
4.5, DeepSeek V4 Pro, the DeepSeek V4 Flash 0731 snapshot, Inkling, and
nine -fast variants. The superseded ones were left out, and the rest
carry no context or output figure from Factory, from the picker or from
the other plugins here — writing a guessed limit would mislead. The list
stays what droid offers, not what one organization's policy allows: of
the entries already here, 21 are blocked by the account this was checked
on.

Tests: bun test (458 pass) and bun scripts/check.mjs factory pass. The id
was confirmed against droid 0.233.0's picker and passes that account's
policy and effort validation; no inference request was sent.
2026-10-04 11:52:44 +08:00
yetone d2449d53e6 trae 0.1.5: a model chat_v3 gives another model's name is named and asked as SOLO lists it (yetone/magpie#681, ChenstarMr: Trae's usage page booked magpie's DeepSeek V4.1 Flash as "DeepSeek-V4-Flash 正式版") — Trae CN's chat_v3 list names deepseek-v4.1-flash "DeepSeek-V4-Flash 正式版", the name it gives DeepSeek-V4-Flash-Official too, while solo_work_lite, solo_agent and solo_agent_lite name it DeepSeek-V4.1-Flash (the reporter's batch_get_detail_param answer). Both entries name the same upstream model, deepseek-v4.1-flash__dev, so the request reached V4.1 Flash, but the list showed two models with one name, and Trae's usage page booked the request under chat_v3's name (TraeCode), where SOLO's request was booked as DeepSeek-V4.1-Flash (TraeWork). liveModels now marks an entry misnamed when another model in the same list has its name and another list names it otherwise, and takes for each model the first function whose entry names a __dev model and isn't misnamed (else the first naming a __dev model, else the first, as before): deepseek-v4.1-flash is named DeepSeek-V4.1-Flash and asked through solo_work_lite with deepseek-v4.1-flash__dev, while DeepSeek-V4-Flash-Official, named alike everywhere, stays on chat_v3. usage.test.mjs gains the reporter's shape; it fails on 0.1.4 and passes; bun test (29 pass) and bun scripts/check.mjs trae pass. Not tried with a real Trae CN account (none here). 2026-10-04 10:26:56 +08:00
yetone a5f3321af3 qoder 0.2.5: a model's context is the largest window Qoder offers it, not max_input_tokens (yetone/magpie#722, Moody-Sin: qoder 的 qwen 3.8 flash 只有180K上下文) — modelInfo took the context from max_input_tokens, 180000 on Qwen3.8-Flash (and Qwen3.8-Max, Kimi-K3, GLM-5.3, MiniMax-M3, Sonus, Cantus), so magpie and every agent behind it were told 180K, and each request was sent context_length 180000. Qoder's client reads the windows a model offers from the listing's context_config ({name: {token_count, is_default}}; else available_context_windows / default_context_window), as qodercli's catalog does (YT/Yai in the Qoder.app 0.4.3 worker), and its Context setting offers 200K, 400K and 1M on Qwen3.8-Flash and twelve others (docs.qoder.com, model tier selector); max_input_tokens is only what a request naming no window gets. windowsOf reads them the same way; a model's context is now its largest window (max_input_tokens when it lists none), and windowFor sends the default window while the request fits it, else the smallest that holds it, else the largest — a larger window may change the rate, Qoder's docs say, so it is asked for only when the conversation needs it; the request is counted generously, a token per 3 bytes of its JSON. context.test.mjs (windows read from context_config and available_context_windows, a model without them keeping 180000, the default window sent for a short request and 400K/1M for longer ones) fails on the old code and passes; bun test (48 pass) and scripts/check.mjs qoder under a temp HOME pass. Not tried with a real Qoder account: the listing's context_config for qfmodel is read from Qoder's client code and docs, not from a live listing. 2026-10-04 06:50:17 +08:00
yetone 503ad3eed3 trae 0.1.4: the account's fetch sends Trae CN's own pages on api.trae.cn as the account, for magpie's daily check-in (yetone/magpie#694, Hu9956: TRAE cn 也有每天签到送100积分) — the loader's fetch served chat completions only (400 for anything else), so magpie had no way to ask Trae as a signed-in account. A URL on api.trae.cn under /trae/api/ (ownPage) is now sent as it is, with the IDE's headers (Authorization: Cloud-IDE-JWT, x-device-id, x-uid, x-app-id …; the token renewed first when near its end, as a chat is) and the body given ({} when none), and Trae's answer comes back as it is, X-Magpie-Sign-In expired on a 401 or code 1001, renewed or kept otherwise; any other URL that isn't a chat is still refused. magpie asks POST /trae/api/v2/ug/checkin_credits/status, then /claim, both with {} — the endpoints autumnsentiment/Trae2api-cn (whose protocol this plugin follows) and qilimixingkong/trae-checkin both call; an unauthenticated POST to /status answers 200 {code:1001, enable:false, checked_in:false}, and a made-up sibling path 404s. Code 9095 (this device is in today) is left as Trae's answer: nothing sends another device id to get round it. checkin.test.mjs (status and claim sent as the account and answered as they are; 1001 marks the sign-in; a token near its end renewed first; another path refused with nothing sent); bun test (28 pass) and scripts/check.mjs trae pass. Not run with a real Trae CN account: none was signed in to try with. README gains a Daily check-in section. 2026-10-04 03:44:28 +08:00
yetone 6596a31c84 trae 0.1.3: the model lists are asked as TRAE SOLO CN asks them, in one batch, as client 0.1.69 (yetone/magpie#681)
0.1.2 still showed no DeepSeek V4.1 Flash: its lists came from get_detail_param, one function at a time, sent as the Trae CN IDE 3.3.65 (version code 20260401). The reporter's TRAE SOLO CN 0.1.69 (version code 20260917, same app id) asks POST /api/ide/v1/batch_get_detail_param on trae-api-cn.mchost.guru (its ai-agent log, get_model_list -> batch_get_model_detail_param; 290 configs cached), and picks deepseek-v4.1-flash from it; two other open tools that list it (smart-open/TraeWorkAssistant, zhengwuji/Jet-Hub) ask the same batch, as a 0.1.5x SOLO client, and find it under solo_agent with model_name deepseek-v4.1-flash__dev.

Now the lists come from batch_get_detail_param (functions chat_v3, solo_work_lite, solo_agent, solo_agent_lite; agent_type "", access_type 0, show_custom_model), with get_detail_param per function when the batch gives none; the model host is told the client is 0.1.69 / 20260917 (x-ide-version, x-app-version and their codes). A model several functions list is asked through the first whose entry names a __dev model, and that model goes as model_name. The IDE's helpers (usage other than chat_completion: summary, fast_apply...), configs switched off and custom-model slots are left out of the list; names come from display_config.display_name, context from context_window_tokens.dev (max is Max mode's), output from the __dev model's max_tokens.

usage.test.mjs: the batch test (one ask, its body and version headers, DeepSeek-V4.1-Flash listed with 200000/64000 and asked through solo_agent as deepseek-v4.1-flash__dev) and the signed-out batch test fail on 0.1.2 and pass; bun test (24 pass) and scripts/check.mjs trae pass. Not tried with a real Trae CN account (none here).
2026-10-04 01:13:59 +08:00
yetone c8ff2c63ab trae 0.1.2: the TRAE agent's models (solo_agent) are listed too, so DeepSeek V4.1 Flash shows (yetone/magpie#681)
Trae CN 3.3.104's agent-type map (libai_agent.dylib manifests/mapping.json)
files deepseek-v4.1-flash under the "trae" agent only, which is function
solo_agent; solo_work_lite (SOLO Work) lists DeepSeek-V4-Flash-Official and
the custom_model_deepseek_* ones the issue shows. get_detail_param is now
asked for chat_v3, solo_work_lite and solo_agent, merged, and a model is
asked through the function that lists it. Not tried with a real account.
2026-10-03 22:30:10 +08:00
yetone 7711a3714a mimo 0.1.7: the plugin gives its provider MiMo Code's logo (#14) — package.json's magpie.icon is the SVG mimo.mi.com serves (static/mimo-code.a1594b207bbc4bee.svg) as a data:image/svg+xml URI, so the host passes it on with nothing fetched, and OpenCode or a magpie showing the plugin's own picture shows Xiaomi MiMo's mark. Checked: the decoded URI renders as the black Xiaomi MiMo tile, host.js's iconOf test (data:image, under 1.5 MB) takes it, scripts/check.mjs mimo and bun test (20 pass) under a temp HOME. 2026-10-03 22:17:38 +08:00
yetone a6ebbc55d8 trae 0.1.1: SOLO's models are listed too, and asked through SOLO's function (yetone/magpie#681)
DeepSeek-V4.1-Flash, which Trae CN's SOLO picker offers, was missing from
magpie's list: the plugin read the account's models from
/api/ide/v1/get_detail_param for chat_v3 (the classic IDE's chat) only, and
SOLO's models (the user's list showed DeepSeek-V4-Flash-Official and the
custom_model_* entries of chat_v3, no V4.1) come under solo_work_lite. Now
the list is asked for every chat function (chat_v3, solo_work_lite) and put
together, chat_v3's first; one list failing leaves the other's, a lapsed
sign-in still throws. A model only SOLO lists is asked through
solo_work_lite first, the 4001/4023/1005 fallback kept.

usage.test.mjs "SOLO's models are listed too" fails on 0.1.0 (V4.1 absent)
and passes; bun test: 21 pass. Not tried with a real Trae CN account (none
signed in here).
2026-10-03 21:17:55 +08:00
yetone 10bf7c4364 cursor 0.1.9: a step that calls tools reports what it used, the cache included (yetone/magpie#676) — Cursor tells a turn's usage (TurnEndedUpdate) only once the client has run the tools and sent their results in the same Run, and the caller runs them after the Run is closed, so a tool step had none: its input was estimated with no cache (2395 / 0 where Cursor counted 4265, 4224 of them cached). After the calls it sends only the checkpoint (no token details) and heartbeats, and a cancelled Run ends with an error and no usage. Every Run is counted in the dashboard's usage events (DashboardService/GetFilteredUsageEvents) by its conversation_id, input apart from the cache read and written, as TurnEndedUpdate does; one shows about 2.5 s after the Run closes. So a tool step with no TurnEnded closes the Run, then looks for its event (after 1.5 s, every 0.5 s, up to 6 s): its conversation's, no older than the Run, not already counted; else the estimate as before. stepusage.test.mjs fails on the old code and passes. Tried with the real Cursor account through a sandbox magpie's plugin host: grok-4.7-fast tool calls report 6186 in, 6144 cached, 121 out (0.1.8: 5057 estimated, 0 cached); streamed too. 2026-10-03 21:10:20 +08:00
yetone 873449a2f4 workbuddy 0.1.8: the credits window tells its count, amount of limit in credits, beside its share and display — for magpie to say how many credits are used or left on the Routing page, the Usage page and the menu bar as it says the share (yetone/magpie#659). usage.test.mjs checks the count for a paid, a free and a fractional account; it fails on the old code and passes. Tried with the real WorkBuddy and WorkBuddy AI accounts in a sandbox magpie: 33.29 / 3900 and 13.47 / 2250 credits come through the host. 2026-10-03 16:40:09 +08:00
yetone 16ec1b8ba9 factory 0.1.14: Claude Code 2.1.288's runtime context sent as a system message of text blocks is adapted as the string one is (yetone/magpie#658)
anthropicBody adapted a role:"system" message only when its content was a
string, so Claude Code 2.1.288's context as [{type:"text",...}] reached
Factory unadapted and was refused (403). Each text block of such a message now
goes through systemContext, its other fields and non-text blocks kept; a user
text block opening with the generated environment context (a system message
folded into the user's turn) is adapted too. The top-level system already
treats a string and an array alike, and the OpenAI route adapts no context.
Tests: the #658 shape (fails on 0.1.13), string/array parity, idempotence;
two tests that asserted array content was left alone now use text outside the
generated shape. Not tried with a live Factory account.
2026-10-03 16:30:42 +08:00
yetone bf7ced3156 qoder 0.2.4: Qoder's token usage is read — it comes in a chunk of its own after the finish, with no choices, and the stream was read only up to the finish, so every request through the plugin was counted as 0 tokens (found testing a real qmodel account: prompt_tokens 0 on every reply). events() now reads to [DONE], keeps the finish reason, and takes the usage, cached and reasoning tokens included, from whichever chunk carries it, as the built-in did (qoder.go). stream.test.mjs, a reply shaped as a real one, fails on the old code and passes. Tried with a real Qoder account in a sandbox magpie: chat, streamed chat and an Anthropic tool call all report their tokens (40 in / 120 out, 107 reasoning; 298 / 86 with the tool). 2026-10-03 16:10:04 +08:00
yetone 5847375f65 registry: Trae CN is back in magpie's Plugins list — @magpie-community/opencode-trae-auth 0.1.0 is on npm (published by hand), and publish.yml is its Trusted Publisher, so later versions publish from Actions like the rest 2026-10-03 15:32:05 +08:00
yetone cc20fcaba9 publish: a package npm has never seen no longer stops the rest — trusted publishing can't create a package, so trae-auth 0.1.0's PUT came back 404 (run 37104702928) and set -e would have left every package after it (workbuddy, zcode, zed) unpublished on their next bump. In Actions a new package is passed by with an error naming the way out (its first version by hand with scripts/publish.sh <otp>, then this workflow as its Trusted Publisher), the rest are published, and the run fails at the end naming it. Tried with a stubbed npm publish: zed bumped publishes after trae is passed by, exit 1. 2026-10-03 15:18:18 +08:00
yetone b541aaa766 factory 0.1.13: tools whose schema is a root anyOf/oneOf/allOf reach Factory's Claude models, nested under one argument and unwrapped on the way back (#12, yetone/magpie#646) 2026-10-03 14:56:46 +08:00
SadWood 7a504148cf fix(factory): 保留联合工具 schema 的参数约束 (#12)
Factory 的 Anthropic 接口拒绝顶层联合工具 schema,导致 Codex 请求返回 400。
通过内部参数包装、响应解包及历史转换兼容该接口,保留分支约束、引用作用域和参数精度。

新增 21 项回归测试,覆盖流式分片、多轮调用、异常、并发和精度。
全库 420 项测试通过,并以 Factory Opus 5.5 验证三种联合 schema、流式调用及第二轮对话。
2026-10-03 14:56:38 +08:00
yetone 3ef969d824 registry: Trae CN stays out of magpie's Plugins list until @magpie-community/opencode-trae-auth is on npm
Trusted publishing can't create a package that doesn't exist yet, so the
publish run for trae 0.1.0 failed and magpie would offer an install that
fails. The entry comes back once 0.1.0 is published by hand.
2026-10-03 14:40:08 +08:00
yetone 6c048c7fc2 trae 0.1.0: Trae CN (trae.cn) accounts, free tier included, with Trae's browser sign-in (experimental; Discord pdzebkbd0701)
Sign-in is trae.cn's authorization page back to a 127.0.0.1 /authorize
callback (userJwt + userInfo, or a refresh token exchanged), with a device
made at sign-in and kept for the account. ExchangeToken renews the JWT
through auth.refresh (refreshLead 10 min, one renewal per refresh token).
Requests go to the IDE agent's llm_utils_chat (chat_v3, then
solo_work_lite on 4001/4023/1005), its SSE events turned into OpenAI
chunks; tools named natively and as <tool_call> blocks. Usage is the
entitlement packs' credits. Worked out from wangqi233/trae2api and
autumnsentiment/Trae2api-cn; not run against a real account.
2026-10-03 14:34:31 +08:00
yetone f28aac332d factory 0.1.12: Claude Code with a global CLAUDE.md or a SessionStart hook, and Claude Desktop, reach Factory again (yetone/magpie#634)
Factory refused three generated phrases the adapter left as they were:
- the instructions reminder's "(user's private global instructions for all
  projects)" naming ~/.claude/CLAUDE.md, now "(global instructions)" in that
  reminder only;
- Claude 5's runtime context after a SessionStart hook's output, as a system
  message or folded into the user's turn: the context after the hook is
  adapted as it is alone, the hook's output left as it is;
- the model line inside a system prompt (Claude Desktop's), adapted as in a
  reminder.
Three tests cover them and fail without the change; bun test passes.
2026-10-03 13:29:17 +08:00
yetone 319eee27ea workbuddy 0.1.7: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 5 minutes (in-fetch: 1) for browser
sign-ins, on both sites; Desktop's (no expiry stored) is renewed as before.
A refresh now runs once per site and refresh token, and its result answers
for the old token a minute, shared by the request path and the hook. Every
failure, an ended refresh token included, throws plainly and doesn't mark
the account, as the built-in never did.

The check before each request stays for OpenCode, which doesn't call the
hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change;
HOME=$(mktemp -d) bun test passes (396 across the repo).
2026-10-03 12:07:23 +08:00
yetone 39d9cffe7d qoder 0.2.3: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 10 minutes (in-fetch: 5) for qoder and
qoder-cn: the job token through refreshJob, or a qoder-cn device-token chat
through refreshDevice (both pairs given). Under the request path's lock; a
spent map lets a request holding the old pair use the new one. 401/403 is
signIn "expired" as on the request path; anything else is retried.

The check before each request stays for OpenCode, which doesn't call the
hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change;
HOME=$(mktemp -d) bun test passes (396 across the repo).
2026-10-03 12:07:23 +08:00
yetone 7dd0b4e0b4 mimo 0.1.6: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 10 minutes before the day's session ends:
the account signs on again, once per account (the request path joins it),
and the new session (access, expires) is given. A passToken Xiaomi no
longer takes is signIn "expired"; any other failure throws and is retried.

The check before each request stays for OpenCode, which doesn't call the
hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change;
HOME=$(mktemp -d) bun test passes (396 across the repo).
2026-10-03 12:07:22 +08:00