Adds agent-kimi-desktop 0.1.0 (kupakupar): Kimi desktop Work on magpie's
Agents page. It moves the runtime's daimon-kimi-code baseUrl to a
loopback bridge and back, through Kimi's local control API.
Re-reviewed at dd8ed2c against the last review at 6c584bb:
1. menu-hook.cjs and selection.mjs are removed; no injected code ships.
2. No full config backup is written. Only before-menu-models.json (the
model list and current choice) is kept, and it is removed on a clean
disconnect.
3. providers.json and settings.json are never opened. The catalog comes
from the gateway's /v1/models with the agent's key and its registered
UA "Desktop Kimi Work".
4. No signal handlers and no process.exit. Restore runs on the 'exit'
event, which fires when magpie closes the host's stdin (host.js
rl.on("close") -> process.exit(0)). The README gives manual recovery
after a SIGKILL.
5. macOS record: COMPATIBILITY.md (macOS 26.6.2 arm64, Kimi 3.2.17
build 3.2.17.4, magpie 0.1.1276, Bun 1.4.3). All four control methods
succeeded, a streamed request returned 200, and a restore followed.
The README says what happens when a private method fails.
6. Search and fetch pass Kimi's own request, with its own key, to Kimi's
own origin, unchanged. This is the user's own account used by that
user, the same rule as #171, so it is accepted.
Run at dd8ed2c, and merged onto origin/main 2ea25b9 together with #171:
- HOME=$(mktemp -d) bun test: 1660 pass, 0 fail (merged: 1668 pass, 0 fail).
- bun test packages/kimi-desktop: 12 pass.
- bun scripts/check.mjs: ok (it skips agent packages).
- git diff --check, npm pack --dry-run (8 files), node scripts/dist.mjs
(packs agent-kimi-desktop@0.1.0).
- Broken by hand: re-adding a SIGTERM handler and a full config backup
turns 3 tests red.
- No CI ran on the PR. No real Kimi or credential was used.
Adds kimi-work 0.1.3 (kupakupar): a provider for the Kimi desktop's Work
subscription, using the desktop app's own local sign-in. It stores only
a hashed account reference, rereads the desktop's tokens on each call,
writes nothing to disk and logs nothing.
Re-reviewed at d9fe48d against the last review at fc3e395:
- (1) the desktop credential: decided acceptable (same as WorkBuddy,
Qoder, ZCode: each user's own allowance).
- (2) macOS record: COMPATIBILITY.md, macOS 26.6.2 arm64, Kimi 3.2.17
(3.2.17.4), magpie 0.1.1276 (released 2026-10-16 17:11Z, before the
20:09Z run), Bun 1.4.3. The path and four field names match readDesktop.
- expireTime: resetsAt dropped, window renamed 会员共享额度.
- efforts: every advertised level is kept (redacted real catalog fixture).
- kimi-work-opencode overlap: the README credits it and says not to
enable both.
- Request input: handled; body, headers and signal are kept, and the
desktop credential replaces any caller Authorization or Cookie.
- Icon is shipped once (package.json); the UA reads the package version.
Run at d9fe48d, and merged onto origin/main 2ea25b9 together with #169:
- HOME=$(mktemp -d) bun test: 1656 pass, 0 fail (merged: 1668 pass, 0 fail).
- bun test packages/kimi-work: 8 pass.
- bun scripts/check.mjs: ok (kimi-work checked).
- git diff --check, npm pack --dry-run (4 files), node scripts/dist.mjs
(packs opencode-kimi-work-auth@0.1.3), scripts/new-to-npm.sh (new).
- Broken by hand: String(input) for Request and the old effort allow-list
each turn their new test red.
- No CI ran on the PR. No real Kimi account or credential was used.
An opt-in gateway middleware for Codex Responses history after a provider
or account switch. For a provider whose rule turns historyFilter on, it
drops old reasoning items and items typed encrypted_content, removes the
optional server id from message and tool items, and sets store false. It
keeps text, tool arguments, results and call_id pairing. It rejects
previous_response_id, conversation, item_reference, encrypted compaction
and /responses/compact with a message, instead of dropping them silently.
Every provider passes through unless configured. No network, file, env or
child-process access.
Run at the reviewed head 96881ead, merged with origin/main:
- bun test packages/codex-history: 22 pass, 0 fail.
- The same 22 cases.json cases through magpie's own engine (moejs, via
internal/middleware Begin/Request in a throwaway test): 22 ran, all equal.
- Broke it by hand (reasoning items kept): bun 4 fail, moejs 4 BAD; restored.
- Whole repo: bun test 1606 pass, 0 fail; bun scripts/check.mjs exit 0.
Adds packages/raccoon, @magpie-community/opencode-raccoon-auth, for SenseTime Raccoon (商汤小浣熊, xiaohuanxiong.com).
- Sign-in: through the browser, or reusing Raccoon desktop's live sign-in.
- Lists the models and makes chat requests.
- Reads account credits (balance and bills).
- Runs the daily check-in through auth.checkin, plus the desktop's first-login grant. The grant is marked settled only when the vendor gives a definite answer.
What was run, at the reviewed head 6078f92 merged onto origin/main 4e64f26:
- HOME=$(mktemp -d) bun test packages/raccoon: 21 pass, 0 fail.
- bun scripts/check.mjs: every package ✓, raccoon included.
- Whole repo, HOME=$(mktemp -d) bun test: 1575 pass, 1 fail.
- The failure was grok's "a login's link is still handed on", a 5s timeout. Another full suite was running on the machine at the same time.
- The test passed 5 of 5 when run alone.
- It is filed separately.
- The raccoon code is byte-identical to c068cc5. That head was reviewed line by line on the PR, and every fix was broken by hand to check that its test goes red. 6078f92 only merges main.
- The package isn't on npm yet. magpie serves it from the dist branch until an owner publishes 0.1.0 (scripts/new-to-npm.sh).
Not verified: a real Raccoon account. Only the reply bytes the author captured were used.
registry.json lists tools-calc (kind "tools"), page-usage (kind "page")
and middleware-reserve (kind "middleware"), community, with en/zh
summaries and no icon (magpie has none that fits).
README: sections "Routing strategies" (under Gateway middleware), "Tools
for every agent" and "Pages", each with a table and what a package of
that kind is a folder with; "Write your own" pointing to
usemagpie.ai/docs/plugins (#tools, #pages, #gateway-points, #middleware,
#agents, #quick) and to a template package of each kind. The market
section names the kinds.
Run: registry.json parses (26 entries); HOME=$(mktemp -d) bun test 1554
pass, 0 fail; bun scripts/check.mjs ok.
Known: magpie main's Plugins > Discover (plugins.js kindOf) treats any
kind but middleware and agent as a provider, so the tools and page
entries show with the provider chip until magpie learns those kinds.
Finds from the registry, for origin/main, each package npm doesn't have
(first publish, then publish.yml as its Trusted Publisher with
--allow-publish) and each whose version npm lacks (its trust revoked and
made again with --allow-publish, then publish.yml dispatched). Runs npm 11
through npx, since npm trust needs 11.5.
Run: sh -n; --dry-run against the real registry lists opendesign 0.1.4 and
type4me 0.1.0 as new, zed 0.1.7 and zen-free 0.1.8 as behind, and leaves
no worktree behind. The trust-id parser was tried on sample JSON. The
publish and trust steps themselves need an owner's 2FA and weren't run.
Adds @magpie-community/agent-type4me: Type4Me (macOS voice input) as a magpie agent. magpie writes the picked model, its /v1 address and Type4Me's key into ~/Library/Application Support/Type4Me/magpie-agent.json, which Type4Me reads before each dictation (joewongjc/type4me#343, merged). The folder is the one Type4Me and Type4Me Dev share (AppDataLocation.sharedProfileName).
Run at the reviewed head dc9d19bd: bun test packages/type4me (4 pass), bun scripts/check.mjs (green). Checked every field against magpie's agentplug.Desc and the file path, keys and folder against Type4Me's MagpieAgentFile and AppDataLocation.
Not done: the first npm publish of a new package name is manual (the package has no trusted publisher yet), and registry.json is not updated in this PR.
New package @magpie-community/opencode-opendesign-auth 0.1.4, provider id `opendesign`: an Open Design Cloud account's Design Plan as a magpie provider (dbydd, #84).
Reviewed at this head (37ef688), as in the PR's last review: `HOME=<temp> bun test` for packages/opendesign, 19 pass; `bun scripts/check.mjs opendesign` ✓; the package loads under Node and Bun; `npm pack --dry-run` packs 5 files; a stubbed usage call sent its User-Agent to amr-api.open-design.ai only. The only hosts in it are amr-api.open-design.ai and amr-link.open-design.ai, with no install script, child process, or write outside OpenCode's auth store.
It no longer waits on its first npm publish: the publish workflow packs it onto the dist branch, and magpie 0.1.1243 and later install it from there until npm has it.
A new package's first npm version can't go through trusted publishing
(a Trusted Publisher is set on a package that exists, with an owner's
2FA), so reviewed plugin PRs (#84 and others) sat unmerged until an owner
published by hand. Now publish.yml's dist job packs every package's
version (scripts/dist.mjs, npm pack --ignore-scripts) onto the dist
branch: tgz/<file> and index.json with each tarball's sha512. magpie
installs a @magpie-community package from there when npm doesn't have
the version. A new package without NPM_TOKEN is a notice, not a failed
run; a version npm refuses still fails it, now naming the stage-only
default of trusts made since 2026-09-03 and --allow-publish.
Run: node scripts/dist.mjs into an empty folder packed all 22 packages
(index.json 164K); the zed tarball's sha512 equals npm pack's integrity;
a second run packs nothing. The workflow itself is tried on main after
this push (workflow_dispatch).
Every publish run on main since 13:27 UTC 10-14 is red: opencode-zed-auth
0.1.7 and opencode-zen-free-auth 0.1.6 answer 404 because their Trusted
Publisher isn't set, and a new package (opendesign-auth, AstraFlow) can't be
created by OIDC at all. Each of those needed an org owner's OTP by hand.
npm tries OIDC first and falls back to the token in .npmrc, so publish.yml
now hands setup-node's NODE_AUTH_TOKEN the repository's NPM_TOKEN secret.
publish.sh publishes a new package when the token is there instead of
passing it by, and its errors say which of the two is missing or that the
token expired. The PR check now notes a new package instead of failing,
since the merge publishes it. README gains a Publishing section with the
one-time token setup.
Run: sh -n on both scripts; scripts/new-to-npm.sh against npm (every
package is on npm); scripts/publish.sh with GITHUB_ACTIONS=true and a fake
npm on PATH (zed-auth "new"): token -> published with the token, exit 0; no
token -> ::error naming it, exit 1; token refused -> ::error saying replace
the token, exit 1.
Not tried: a real publish with a token, since the secret doesn't exist yet.
magpie (cb406c84) lets a plugin add an agent it has no setup of its own
for. This one writes Aider's ~/.aider.conf.yml: the model under litellm's
openai/ prefix, magpie's /v1 and Aider's own key. check.mjs skips agent
packages as it does middleware; README gains an Agents section.
Run: bun test packages/aider (2 pass); bun scripts/check.mjs; the module
loaded through magpie's agentplug.Compile and its connect returned the
three keys. The same module, in a sandbox magpie, wired a real aider
0.86.2 that answered from a real DeepSeek account, and Disconnect put
the file back byte for byte.
Trusted publishing can't create a package, so #39's block-patterns,
merged before its first version was on npm, left every publish run on
main red after it (8 runs, the last 37781353941), and a real refused
publish would have hidden behind it. pr.yml runs bun test and check.mjs
on each pull request, and scripts/new-to-npm.sh names any package npm
doesn't know, so its first version is published by hand and its Trusted
Publisher set before the merge. The README's market section says so.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Add OpenCode Zen Free provider and market listing
* Guard Zen tool calls and address provider review
* Preserve upstream SSE error frames in Zen tool guard
* Restore Zen Free package name and simplify README title
* 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>
* 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
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.
* Cline: usage-billed models, ClinePass's and Cline's free ones, on your own Cline account — Cline's device sign-in (WorkOS device code, traded at /auth/register) or an API key; chat completions on api.cline.bot with Cline's own client-identity headers (pinned to the current CLI release — what the free models' gate reads), the non-stream data envelope unwrapped, the model list from Cline's recommended-models feed, usage from the account's balance (counted in millionths of a dollar). cline-pass answers 403 ENTITLEMENT_ERROR without the subscription and the message says so; so does an empty balance, with the top-up URL.
* cline 0.1.0: the pinned CLI version and the workos: prefix move to Cline's current client — apps/cli is at 3.0.68, and provider-auth-registry's formatProviderOAuthApiKey lowercases before it startsWith("workos:") so a token stored as WorkOS: is not double-prefixed here either; bearerOf's "once" test fails against 0.1.0.
* cline 0.1.0: the model list is Cline's whole catalog, not just the recommended feed — the title promised usage-billed models but the plugin read only recommended-models (6 paid models), while Cline's own clients also load /api/v1/ai/cline/models (loadCloudModels), so most usage-billed models were missing. The four feed arrays are now read by name instead of walking every value (a tag or description could become a model, and one in both recommended and free lost its "(free)"), clineCloud stays out as the client leaves it out, a raw-id name is prettified, and the bundled snapshot drops gemini-2.5-pro and minimax-m2.5 (not in cline-recommended.generated.ts) and gains the missing cline-pass/* entries; the parseFeed, snapshot and models-merge tests fail against 0.1.0.
* cline 0.1.0: a refresh failure no longer fails a request that still has a good token, and a rotated pair survives a failing auth.set — a 4-minute token plus a 500 from /auth/refresh answered the chat 502 and never sent it, and with auth.set throwing the next request re-spent the old refresh token, got invalid_grant and marked the account expired. fresh now keeps the current token on a transient failure while it is still good (Cline's getValidClineCredentials), failing only once it has expired, and the latest rotated pair is held in memory beside the save (kiro's held), used when getAuth still hands back the spent token; the still-good-token and rotated-pair tests fail against 0.1.0.
* cline 0.1.0: failure() keys on Cline's error codes and whole phrases, not loose substrings — a 403 whose text mentioned "tokens" (max_tokens exceeds…) became "the sign-in lapsed — sign in again" and lost the real message, and any message containing "credit" became a 429 usage limit. The 401/403 token check, the out-of-credits and entitlement checks and the 429 check now match what Cline's client matches (ENTITLEMENT_ERROR, insufficient_credits, SPEND_LIMIT_EXCEEDED, the not-subscribed wording), and a renewed token clears the lapse mark through the error path too as qoder's renewed() does; the codes-and-phrases and renewed-mark tests fail against 0.1.0.
* cline 0.1.0: device polling grows the interval for good and rides out a bad poll — slow_down raised it for one poll only (RFC 8628 and Cline's pollWorkOSTokens do interval += 1 permanently), the minimum was 0.25s where the client clamps to 1s, and a single 5xx, non-JSON reply or network error ended the sign-in with "the token answer had no access token". The poll now keeps polling through those; the slow_down, one-second and bad-poll tests fail against 0.1.0.
* cline 0.1.0: the held pair covers every refresh token this run has spent, not only the last — when auth.set goes on failing (which a store that failed once usually does) getAuth keeps handing back the first pair, and a second rotation overwrote held.from, so the third request refreshed the already-spent r1 again: /auth/refresh went r1, r2, r1 and the chat answered 401 expired. held.from is a Set every rotation adds to now, and the held pair is used whenever the refresh token getAuth hands back is in it; the two-rotation test fails against 0.1.0 (200, 200, 401).
* cline 0.1.0: X-CORE-VERSION moves to 0.0.90 with the CLI release — the header set pinned 3.0.68 beside 0.0.89, but cline@3.0.68 depends on @cline/core 0.0.90 (0.0.89 is what 3.0.67 shipped) and resolveProviderRequestHeaders sends X-CORE-VERSION from that dependency, so the number the comment calls the one that has to match was a release behind; the client-header test pins the pair now and fails against 0.1.0.
* cline 0.1.0: a poll reply that isn't JSON and isn't a 5xx fails the sign-in at once — a body that wouldn't parse was read as WorkOS having a moment, so an HTML 400 (a proxy's error page, say) kept the poll going to the deadline, ten minutes, before failing there anyway. Only a network error and a 5xx are a poll to try again now; a 4xx that isn't JSON is the poll refused. The refusal test fails against 0.1.0.
* cline 0.1.0: a renewal's mark survives a network error on the chat itself — the 502 the fetch throws after a renewal returned without signed(..., renewed(cred)), so the request that never left the machine dropped the mark while the request that came back refused kept it; it is wrapped the way the !res.ok path is. The network-error test fails against 0.1.0.
* cline 0.1.0: the held pair is kept per rotation chain, so no account is sent on another's token — magpie calls ClinePlugin once for the provider and hands every account its own getAuth, so the one `held` pair outlived them: with two accounts, a save failing every time and every token wanting renewal, A, B, A went out as A-jwt1, B-jwt1, B-jwt2 and A's third request refreshed with B's token, spending it and billing B (yetone's two-loader repro, page-for-page the same). A spent refresh token now maps to the newest pair its own chain reached — the token getAuth handed back and the one the refresh spent both point at that chain — so a request offering either finds its own account's pair; the per-chain test fails against 0.1.0 on the third request's Authorization, with the 51 before it passing.
A new package, @magpie-community/opencode-minimax-auth, written from MiniMax Code 0.6.2's bundle.
Sign-in: MiniMax Code's OAuth device flow, the same one mcode uses (account.minimax.cn / account.minimax.io, client mcode-public, scope agent.default, audience agent-backend, PKCE S256). It also handles MiniMax's own variant, where there is no device_code, the user_code is polled for, and expired_in may be an at-ms. The account is named from MiniMax's signed /v1/api/user/info. mcode's ~/.minimax sign-in is never read or written. Each account is a sign-in of its own, so magpie can hold several.
Refresh: two minutes before the token ends, or once on a 401. One refresh runs per account (keyed by the refresh token it spends), and its result answers for the old token for a minute, so a late reader doesn't spend a rotated token twice. Only invalid_grant with HTTP 400 signs the account out (signIn: expired); any other failure keeps it and uses the token in hand while it lasts.
Chats: Anthropic messages at <agent>/mavis/api/v1/llm/v1/messages, carrying:
- Authorization: Bearer <token>
- x-api-key sk-xxx (mcode's placeholder)
- User-Agent MiniMaxAgent
- X-Mavis-Agent-Id main
- X-Mavis-Timezone-Offset
- X-Mavis-Session-Id, from chat.headers' sessionID (otherwise a fixed id per run)
A 402, 403 or 429 whose body says credits or quota ran out goes on as a 429 "usage limit reached".
Models: the live config at GET /mavis/api/v1/models?region=&buildEnv=prod (asked again without auth on a 401/403), with mcode's built-in four as the fallback: MiniMax-M3.1-Flash-Preview, MiniMax-M3, MiniMax-M2.7 and MiniMax-M2.7-highspeed. Variants follow what mcode sends: adaptive thinking at an effort (output_config.effort), and none to turn thinking off.
Usage: mcode's signed account API: user info, the type-0 workspace from get_user_extra_info, then get_membership_info. The card shows credits left (op_credit_summary / opcredit_balance), Free or "M Plan <tier>" with its end, and, for an M Plan, coding_plan/remains with X-Group-Id. That is read as magpie's readMiniMaxPlan reads it. There is no check-in.
Tests: fakes only. nonet.mjs is imported first, so only 127.0.0.1 can be reached. They cover:
- sign-in, the variant, refused, and other errors
- refresh, a three-way race plus a late stale reader, per-account refreshes, invalid_grant, other failures, and 401 then refresh then retry
- request headers and chat.headers
- credits running out going on as a 429
- the live list, the retry without auth, and the fallback (the given object back)
- signing, against fixed vectors and the bundle's formula
- usage parsing (readMiniMaxPlan's own fixture), Free, M Plan, and a refused account
bun test packages/minimax (27 pass) and bun scripts/check.mjs pass.
End to end through magpie: origin/main b0486663, built with -tags nogui in a worktree since removed, under env -i with a sandbox HOME, a fake upstream on 127.0.0.1:47811, and a copy of the package with its hosts pointed there:
- plugin add
- plugin login minimax-code: the device flow and the account named; a second login of the same account merged into one
- the live list: 2 models
- provider test minimax-code: the chat went out with the headers above
- quota: M Plan Plus, 321.5 credits, 5 hours and 7 days windows
- an expired token refreshed and saved
No request was made to MiniMax.
ARNO on Discord: the plugin's Start Plan requests were answered 405 / 3012
"blocked due to unusual activity" while his own plugin (Freeflow, provider
zcode-start) worked from the same machine. zcode.z.ai serves the plan only
to what looks like ZCode's own request: a Start Plan request now carries
ZCode's headers and its body is dressed as ZCode's (three cached system
blocks, the environment section, the date reminder as the first turn, one
cache mark on the last block, metadata.user_id naming the sign-in's
device). The prompt texts are magpie's (901fd87e), each matching ARNO's
plugin's hash. Coding Plan and team requests are unchanged. The Start Plan
is advertised again.
Hosts, client id and paths read from Qoder CN's own CLI (@qodercn-ai/qoderclicn 1.1.65): sign-in on qoder.cn, accounts on openapi.qoder.com.cn, models and chat on gateway.qoder.com.cn, client id e883ade2-…; signing unchanged. The same as magpie's built-in Qoder CN. When qoder.cn refuses a job token the account chats on its device token, renewed through /api/v1/deviceToken/refresh, as the CN CLI does. cn.test.mjs (12 tests, a local server standing in for every host) covers sign-in, polling, both tokens' refresh, a chat, models, usage and qoder.com unchanged; 6 fail with the CN chat host pointed back at api3.qoder.sh or the fallback off. Version 0.2.0.