On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
chen2652 on magpie's Discord (v0.1.3361): three Command Code Go
accounts, folded together on the Routing page, showed no summed
credits. The Credits window of a units plan said only its share and
a display string, so magpie's mergeQuotas could only take the mean of
the shares, and only for cards on one plan. It now carries amount (the
credits used, as the display rounds them), limit (the month's pool)
and unit "credits", so magpie adds them up: "16.40 / 30 credits".
Bought and free credits (dollars at model cost) left the display's
"+ $X extra" for the account's balance, a row of its own under the
windows on magpie's Usage card. With a limit set, magpie's GUI and TUI
say the count from amount and limit, not the display, so the extra
would have been lost from the card otherwise.
Not changed: Max, Ultra and Teams Pro, whose Credits pool is dollars,
keep display and share only (magpie would print "$" as a unit after
the numbers).
Run: bun test in packages/commandcode on mote (100 pass, 1 skip, as
before), bun scripts/check.mjs (all ok). The test expectations for
the units plans' Credits window now include amount, limit and unit,
and GOAT's bought credits are the balance.
inkstone 0.1.3 (#832, yunwang2442-creator):
- Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all.
- A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none.
- The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal.
- The body rewrite strips the reasoning fields and sets image detail to auto.
- A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key.
- Neither browser method is offered when no Chromium-family browser is found (#825).
- The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry".
- The #826 metadata token read is kept, and its test is back.
- The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows.
- maxConcurrency is 4.
- The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included.
Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME:
- full bun test: 6853 pass / 0 fail; both checks exit 0
- bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0
- 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed)
Not tried: a real InkStone account or sign-in, Windows and Linux runs.
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern
InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id
`intern-inkstone`. Community package by yunwang2442-creator.
What it does:
- Browser sign-in (Edge/Chrome, its own profile under
$XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or
%LOCALAPPDATA%\magpie\inkstone-browser). The login window has no
debugging port. A headless CDP read takes the uaa-token cookie, and the
same read renews it silently later.
- Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs.
- Chat: a pasted ink-* API key, or one the sign-in creates, named
ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An
idempotency clash (-15109) retries with a fresh name, up to three times.
Pruning is on by default. It only touches this machine's and account's
prefix, keeps the newest two and the key this sign-in created, and never
deletes manual keys or keys of unknown age.
- Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover
browsers are matched by --user-data-dir=<escaped profile>, and Windows
uses .Contains().
- The login wait comes from an injected waitForLogin in tests. No env
hook is left in production code.
- Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn,
127.0.0.1 (CDP).
Outside the package: scripts/opencode2.mjs lets a prompt with
`required: false` stay optional (`p.required !== false`). Every package's
copy is synced byte for byte, so all 39 copies in the merged tree are blob
afe074cb. No other package sets `required: false` on a prompt, so this
changes nothing for them. Also a root README row and a registry entry.
Review at 36412a15, on mote, HOME=$(mktemp -d), Bun 1.4.2:
- bun test packages/inkstone: 68 pass, 0 fail in Asia/Shanghai, UTC,
America/Los_Angeles and Pacific/Kiritimati.
- bun scripts/check.mjs inkstone and bun scripts/check.mjs: ok.
- bun test (repo), on 36412a15 merged with origin/main e7cb9dc5:
6743 pass, 20 skip, 0 fail. main has since moved by cline 0.1.14 and
zcode 0.1.55 only, and none of the adapter copies changed.
- Broken by hand, each red: no protectName protection; prune_keys default
off; no post-sign-in prune; no SIGTERM on close; the -15109 retry keeping
its name.
Not tried: a real InkStone account sign-in on macOS, Linux or Windows (no
account here); a live chat request; magpie end to end with the plugin.
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin
must export a default definition with an id and an effect or setup
function. (cause: SchemaError(Missing key at ["default"]))". 2.x
imports a package's exports["."] (a plugin dir and an npm install
alike) and has no V1 path at all, so every package here that serves
models failed the same way, not only trae.
Every one of the 32 model packages now has:
- opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an
adapter that runs the package's V1 plugins inside 2.x's promise
API. Config providers become 2.x providers (package pinned so the
aisdk sdk hook runs), V1 auth methods become integration methods
(oauth auto/code with forms; api without authorize as a key method),
V1 credentials are kept in metadata.v1, the loader's baseURL,
apiKey, headers and fetch are applied through the sdk hook, an
auth.set renewal is stored per credential, and credential.switched
/updated reload the account's own model list.
- opencode.mjs, main: re-exports the V1 plugin functions only.
OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's
main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin
export is not a function"); the new main fixes that too.
- both files in "files"; patch version bumped. devin already had 2.x
and is unchanged.
scripts/check.mjs fails a model package whose 2.x entry has no default
{id, setup}, whose opencode2.mjs differs from the canonical one, whose
entry is missing from files, or whose main exports a non-plugin.
Run at this head (mote):
- HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail
(4914 tests, 374 files). A first run set globalThis.fetch for the
whole process from opencode2.test and failed 528 tests in other
packages; the block is now set and put back around that file's tests.
- bun scripts/check.mjs: every package passes. With the network
blocked cloudflare-workers-ai fails on its fetched catalog, the same
on origin/main.
- Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae
0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN"
and trae-global "Trae Global" with their browser sign-ins; `auth
login` starts the trae.cn authorization and waits (cancelled there);
with a fake credential POSTed to /api/credential, `opencode models`
lists trae-cn's six models.
- Real 2.2.5 with a fake V1 key plugin through the same adapter
against a local fake server: `auth login` with a key, `models`,
`opencode run` reached /real/v1/chat/completions with the loader's
"Bearer loader-sk-fake" and header, and printed the fake's reply;
with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key
from the loader. This run found the key method missing after 2.x's
second integration transform (a once-only flag outside the
transform); fixed, and opencode2.test checks a rebuild.
- Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models`
lists trae-cn and trae-global models; 0.2.26 failed there.
Broken by hand (scratch copy, bun test scripts/ and check.mjs):
- trae's exports back to "./index.mjs": the trae 2.x test fails
(default.id undefined), check fails trae with "OpenCode 2.x:
./index.mjs has no default {id, setup} (plugins#657)".
- zed's opencode2.mjs changed: the copies test fails, check fails zed
"differs from scripts/opencode2.mjs".
- the key flag back outside the transform: the 1.x plugin test fails
on the rebuilt sign-ins (key missing).
Not tried: a real sign-in with a real account on 2.x; Windows (the
reporter's OS); chat.headers, chat.params, usage and tool hooks, which
the adapter doesn't carry to 2.x; the tools/pages packages (calc,
goanyapi, layerfs, search1api, aelios, agent-console, chat,
fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x.
Reflection's Beam (reflection/beam:free) answered a fresh one-turn chat
and turned the second turn away with 400 "Missing required parameter:
'messages[N].reasoning_content'", a reply another model made included;
it took the request once each earlier assistant message had something
there (EDwinpzy on magpie's Discord, magpie 0.1.2717, through
/v1/chat/completions and /v1/responses alike).
The Provider API's list says nothing of it (Beam's entry is id, name,
context_length and supported_endpoints, read 2026-11-03), so:
- a model matching reflection/beam has reasoning_content on every
assistant message: its own when it has some, the thinking sent back as
reasoning (moved, not duplicated), else "." (a blank one, which magpie
sends tool turns with, is replaced too: whitespace may read as missing);
- any other model the Provider API refuses with a 400 asking for
reasoning_content is asked once more with it filled, and is filled from
then on (in-process).
Other models' requests go as they came.
Run at this head (mote, bun 1.4.2): bun test in packages/commandcode,
HOME=$(mktemp -d) as pr.yml does: 101 pass, 0 fail. bun scripts/check.mjs
commandcode: ok.
Broken by hand: reasoning-back.test.mjs against the old index.mjs: 4 of
7 fail (both of the reporter's two-turn shapes, the reasoning/blank case
and the learned model get 400); the three "goes as it came" pass.
Not tried: a real Beam request. The one Command Code key on this machine
answers 401, so the placeholder "." and the refusal's JSON around the
reporter's words are not checked against Beam itself. Go's /alpha/generate
path is unchanged and not tried with Beam.
kthink on Discord: dsh on google/gemini-3.8-flash was refused 400
AI_UnsupportedFunctionalityError "Google schema conversion only supports
references to direct children of root-level $defs or definitions ...
#/properties/func/properties/triggers/items". dsh reuses part of its own
schema by a pointer into properties. For a Google model (google/..., or an
id naming gemini) such a $ref is now written out in place, on the Provider
API and on Go's /alpha/generate; a ref to a direct child of $defs or
definitions goes as it came; a loop or 32 deep ends at the target's type.
Data named $ref (default, enum) and refs that name nothing are untouched.
Every other model's schema goes as it came.
Run (mote, HOME from mktemp -d): bun test in packages/commandcode, 94 pass;
bun scripts/check.mjs commandcode ok. google-schema.test.mjs against the old
index.mjs: 6 of 7 red, including both end-to-end tests (GOAT, Go) that
send the dsh-shaped schema to google/gemini-3.8-flash.
Not tried: a real request. Both Command Code keys in magpie's plugin-auth
answer 401, so the fix is not checked against Command Code's gateway.
Siblings (other plugins with Gemini models) are not checked: #557.
NeuroPaw (#556): PLAN_NAMES sizes GOAT's month at 70 and Pro's at 80,
while Command Code's pricing now says GOAT "up to $100" and Pro "up to
$110", per model.
Checked against Command Code's live pages (2026-10-31). The usage limits
page says "on Go, GOAT and Pro, credits are usage-value units -
full-allowance models like GLM-5.2 get $1 of usage per credit", and that
GOAT's 14 credits in 5 hours and 35 in 7 days are "worth up to $20 / $50
of usage on a $100 model like Ling 3.1 Flash, or $14 / $35 on a $70 model
like GLM-5.2" (Pro: 16 / 40, up to $22 / $55 on a $110 model, $16 / $40
on an $80 one). billing/credits' windowLimits caps are those credits (the
recorded GOAT reply has caps 14 and 35, monthlyCredits 69.80). So the
month is 70 credits on GOAT and 80 on Pro, in the units monthlyCredits
counts in: the CLI's 70 and 80 still match, and raising them to 100 and
110 would mix dollars into a credit count. What was wrong is the card
calling those credits dollars ("$0.20 / $70.00"). The pricing page lists
Provider as "$15 /month ... Pay as you go" with no credits, and the
table's 15 made a "$x / $15.00" month for it.
- Go, GOAT and Pro (both Pro ids): the Credits window is the month's
credits, said as credits ("0.20 / 70.00 credits"); bought and free
credits, dollars at model cost, are said beside it ("+ $5.00 extra")
and no longer added to the pool.
- Max, Ultra, Teams Pro (1 credit = $1): the CLI's pool, in dollars,
unchanged.
- Provider: no month of credits, so its card is the balance.
- The 5-hour and weekly windows are unchanged.
The response has no field with the plan's total, so the month's size
still comes from the table; /alpha/usage/summary was not read (see Not
tried).
Run (mote, Bun 1.4.2, HOME=$(mktemp -d), at this tree on b70725c):
- bun test (whole repo): 4201 pass, 0 fail, 4210 tests across 329 files.
- bun scripts/check.mjs commandcode: ok.
Broken by hand:
- plan-credits.test.mjs against origin/main's index.mjs: 4 of 5 red
(GOAT real reply, credits labels, GOAT extras, Provider balance); the
Max parity test stays green, as it should.
- GOAT set to 100 (the issue's option 2) in the new index.mjs: 3 of 5
red.
Not tried: a live Command Code account. Both keys here (~/.commandcode
and magpie's plugin account) are answered 401 by billing/credits,
billing/subscriptions and usage/summary today, so the GOAT reply is the
one recorded in testdata (2026-09/10). Which planId today's $20 Pro has
(individual-pro, 30 in the CLI, or individual-pro-v1, 80) is not
confirmed; both are left as the CLI has them.
blue12345655 (magpie Discord #help): a Command Code account signed in
through the plugin was signed out, and magpie offered no 重新登录, on
v0.1.1844 and still on v0.1.2021.
Cause: commandcode said X-Magpie-Sign-In "kept" on every answer and
signIn "kept" on every usage read, so a revoked key came back as a card
saying "Unauthorized" while magpie kept the account signed in, routed to
it, and never showed Sign in again on its rows. Devin and Kiro did the
same in their usage reads: their errors already said "sign in again",
but "kept" stops magpie from reading those words.
- commandcode: a usage read whose credits are refused (401/403), or a
request answered 401, asks /alpha/whoami; when whoami refuses the key
too, the usage says signIn "expired" with "Command Code's sign-in has
expired; sign in again", and the answer carries X-Magpie-Sign-In:
expired, its body unchanged. A 403 for a model the plan lacks, a 401
whoami still takes, and a whoami 500 keep the account. A clean usage
read says "renewed", which takes a mark off.
- devin: a usage read Devin answers 401 says "expired"; a clean read
"renewed"; other failures "kept". Requests unchanged.
- kiro: a usage read whose sign-in Kiro refused (the errors made by
gone) says "expired"; a clean read "renewed"; other failures "kept".
auth.refresh and requests unchanged.
The response bytes in commandcode/signed-out.test.mjs are what
api.commandcode.ai answered an unknown key on 2026-10-29 (whoami,
billing/credits, billing/subscriptions, provider/v1/chat/completions).
Run (WSL magpie-desktop, Bun 1.4.2, HOME=$(mktemp -d)):
- bun test in packages/commandcode: 82 pass, 0 fail; packages/devin:
142 pass; packages/kiro: 67 pass.
- bun scripts/check.mjs: every package ok.
Broken by hand: signed-out.test.mjs against the 0.1.18 index.mjs, 4 of
9 red (usage expired, clean read renewed, Provider API expired, Go
expired). kiro's and devin's changed usage tests against their old
index.mjs: red ("kept" received where "expired" expected).
Not tried: a real revoked Command Code, Devin or Kiro account; the
whoami check is only against an unknown key's real answers.
joeliu96872540 on X: magpie couldn't get Command Code's typesafe/jev.
Command Code's /provider/v1/models (94 models) doesn't list it; the CLI
(command-code 1.88.2, read from its bundle, not run) knows it as
SYSTEM_ONE_MODELS ["typesafe/jev"], asked at POST /provider/v1/systemone
with {model, state, questions} and buildCommandAuthHeaders, answered with
{model, answers, usage}. That is magpie's System One shape.
- config sets decide: true on the provider and adds Jev to its models,
marked decides (magpie's plugin decision API, yetone/magpie#1514).
- provider.models adds Jev, marked, to every plan's list (Go's, the live
one, the default standing in); Command Code decides which plans may ask.
- fetch sends a /systemone question as the CLI does: its headers
(User-Agent cli, x-command-code-version 1.88.2, project slug, session,
Bearer key, x-cmd-zdr when ZDR is on), not the chat's x-api-key, with
Jev's other names (jev, jev-latest, typesafe-ai/jev) sent as
typesafe/jev. The answer goes back as it came; a refusal through
failure(), the account kept; a Go plan's "no API access" keeps the key
as Go's.
- The plan-list tests that count chat models leave Jev out (talking()).
Run: bun test in packages/commandcode on mote: 72 pass, 1 skip (as
before), 0 fail; bun scripts/check.mjs all green. Broken by hand (the
/systemone branch, decide and withJev turned off): 6 of jev.test.mjs's 8
go red; the ZDR and Go-refusal cases pass either way, as the generic
Provider API path does the same for them.
Not tried: a real Command Code account (none in a sandbox HOME), so no
real /systemone answer has been seen, nor which plans Command Code lets
ask Jev.
01huadalang: "command 的订阅插件没有显示总额度剩余的条子". A Pro, GOAT,
Max or Ultra account reports 5 hours, Weekly and then Credits. magpie's
Providers account line (quotaLine) and the menu bar (trayusage) show an
account's first two windows only, so the Credits bar, the plan's whole
allowance, was never drawn there; it sat in the tooltip. allowanceOf now
puts Credits right after the first window: 5 hours, Credits, Weekly. The
5-hour window stays first, so the Usage card's spark and pace line are
unchanged; Weekly moves to the account line's tooltip. Accounts with one
limit window (Weekly, Credits) or none (Go: Credits alone) are as before.
Not this change: #303 (amount/limit on the Credits window) is held, as
reviewed on it: on every released magpie a window with a limit is
printed as "17.89 / 70" with no "$" in both modes, until magpie formats
a unit "usd" window as money (#301 step 1, not landed).
Run (HOME a temp dir without "magpie" in its path; no-magpie.test.mjs
greps every request for the word and finds the HOME in the Go body
otherwise):
- packages/commandcode bun test: 65 pass, 0 fail.
- bun run check: exit 0, every package.
- Old code: usage.test.mjs's "a Max account: its 5 hours, its credits
second ..." fails on origin/main's index.mjs (12 pass, 1 fail: Weekly
where Credits is expected).
- Real account: the owner's GOAT key through hooks.auth.usage now gives
[5 hours 0.93%, Credits $0.63 / $70.00, Weekly 1.20%] (before: 5 hours,
Weekly, Credits).
Not tried: a Go, Pro, Max or Ultra account (none here).
The Go catalog (/provider/v1/models) went with User-Agent "magpie" and
every /alpha/generate with x-project-slug "magpie". Both are now what
command-code 1.88.0's cli.mjs sends:
- the catalog: installModelCatalogManager asks with accept alone under
Node's fetch, whose User-Agent is "node";
- x-project-slug: buildCommandAuthHeaders' projectSlug is
getCommandCurrentProjectDirName, slugify(basename(cwd)) || "root". The
plugin takes the working folder magpie names (x-magpie-work-dir, which
it already strips), else the home folder as before. A Windows path
splits on "\" as the CLI's win32 basename does. A name past Latin-1 is
percent-encoded: Node refuses such a header, so the CLI has no value
there to copy and the request would otherwise throw (found by the
existing #86 test's "中文" folder).
Test: no-magpie.test.mjs records every request (URL, every header,
body) for a Go chat with and without a folder, a Pro chat and the
catalog, and fails on /magpie/i; red on the old code (3 of 3 fail),
green now.
Run: bun test in packages/commandcode (64 pass, 1 skip, 0 fail);
bun scripts/check.mjs commandcode ok.
Live, sandbox HOME, owner's GOAT key: Provider API chat 200, catalog 62
models, /alpha/generate 200 with x-project-slug "shop" (billing answered
503 locally so the saved Go plan routed it); the second saved key is
dead (401) but its generate request went out clean too. 0 of 9 recorded
requests named magpie.
Not tried: a real Go-plan key; Windows.
CHENJIAMIAN measured Command Code's Provider API on a GOAT key: "off"
gives 0 reasoning tokens on deepseek-v4-pro, v4-flash,
v4-flash-vision-exp, v4.1-flash and v4.1-flash-fast; "none" is refused
as no option, thinking {"type":"disabled"} is ignored, and
deepseek-v4-flash-fast and Kimi-K3 refuse "off". The plugin offered no
off level and passed magpie's none on unchanged, so every way of asking
for off still thought.
- THINK_OFF: those five models list none, low, high, max on the
Provider API's list and in the default list (low/high/max are the
levels magpie borrowed from DeepSeek for them before).
- The Provider API fetch sends reasoning_effort "off" for none or a
client's "off" on those models, and drops the field for any other
model, which refuses both spellings. Other levels go as they came.
- Go's /alpha/generate: not measured with "off", so its levels are
unchanged and off (none or "off") is sent as no level, as none was.
magpie needs no change: a plugin model's variants are its levels
(pluginCatalog), and magpie sends none to a plugin model that lists it
(TestPluginThinkingOff).
Run at base 421117e (origin/main, fetched just before the commit):
- packages/commandcode: TMPDIR=$H HOME=$H/home bun test, 62 pass 0 fail.
- repo root: HOME=<temp> bun test, 2317 pass 0 fail; bun
scripts/check.mjs ok.
- think-off.test.mjs against the old index.mjs: 5 of 6 red (none sent
as "none", no "none" level listed, Go sent "off"); the sixth, other
levels unchanged, passes on both, as it should.
Not tried: no real Command Code account was used. The "off" behaviour
rests on the reporter's measurements, and Go's /alpha/generate with
"off" is untested. The Responses API path (reasoning.effort) is not
rewritten: magpie and OpenCode ask these models on chat completions.
moonshardx (#246): Command Code keeps request content up to 30 days
unless Zero Data Retention is asked for (commandcode.ai/docs/resources/
zdr): CMD_ZDR=1 for the CLI, x-cmd-zdr: 1 on the Provider API. The
plugin had no way to send it.
- The plugin declares a "Zero Data Retention" switch (auth.options,
magpie #2038, off by default, with a cost note to confirm). magpie
shows it in the provider's editor; the plugin reads it through
input.magpie.option at each request, so no restart is needed.
CMD_ZDR=1 in the plugin process's environment also turns it on, as for
the CLI; only "1" does, as the CLI's isCmdZdrEnabled reads it.
- While on, the Provider API request and Go's /alpha/generate request
each carry x-cmd-zdr: 1. For /alpha/generate this mirrors the CLI: its
1.84.0 bundle (npm pack, read, not run) adds [CMD_ZDR]:"1" in
buildCommandAuthHeaders, and the installed CLI 1.74.1, run with
CMD_ZDR=1 in a sandbox HOME through a logging pass-through proxy
(COMMANDCODE_SANDBOX=true, COMMANDCODE_API_URL), sent x-cmd-zdr=1 on
/alpha/generate and on every other request.
- A model with no ZDR upstream: the Provider API's 422 cmd_zdr_no_providers
goes on as it came. On /alpha/generate Command Code answers 200 with an
error line ({"type":"cmd_zdr_no_providers","code":
"CMD_ZDR_NO_PROVIDERS","statusCode":400}); the agent gets that 400 and
message as before, and now the error's type cmd_zdr_no_providers
instead of commandcode_error.
Run: zdr.test.mjs is new (6 tests, fixtures are Command Code's literal
bodies from today). Broke each by hand and watched red: no option, no
Provider header, no generate header, CMD_ZDR read as truthy, the switch
read once, the 422 rewritten, the type dropped: 1 to 3 fail each.
bun test packages/commandcode: 55 pass, 1 skip, 0 fail.
bun scripts/check.mjs commandcode: ok. HOME=$(mktemp -d under $TMPDIR)
bun test: 1822 pass, 0 fail.
Live, with the owner's GOAT key, the plugin's fetch with the switch on:
Provider API deepseek-v4-flash 200 with x-cmd-zdr: 1; Provider API
poolside/laguna-s-2.1-free 422 cmd_zdr_no_providers, body as it came;
/alpha/generate (plan forced to Go) deepseek-v4-flash 200 with the header,
laguna 400 cmd_zdr_no_providers; with the switch off neither had the
header. Not tried: a real Go account (none here), the switch in magpie's
editor itself (driven by a stand-in for input.magpie), OpenCode.
Three things magpie's built-in Command Code did that the plugin didn't,
ahead of retiring the built-in:
- The Credits window had no reset, though the month's credits come back
when the plan's period ends, which billing/subscriptions' currentPeriodEnd
says (sub.until, already the card's "until"). allowanceOf now puts it on
the window as resetsAt (yetone/magpie#2454). No period end, no reset.
- The models the CLI marks FREE (magpie's cmdFree, all 11: Space Bunny
Alpha, Pixel Canary, Laguna S 2.1, the Ling 3.0/3.1 Flash ones, the
MiniMax M3/M2.7 free ids, LongCat 2.0 free, Tencent Hy3) now say
free: true on every list: the Provider API's, Go's, and Go's table when
the list can't be had.
- A Go chat's max_tokens sent to /alpha/generate is kept within 200,000,
the most Command Code takes ("Too big: expected number to be <=200000
at params.max_tokens"; magpie's CommandCodeMaxOutput in cmdRequest).
Before, a 384,000 ask failed the whole request.
Run: bun test in packages/commandcode: 49 pass, 0 fail. parity.test.mjs
is new; usage.test.mjs's two plan-with-period cases now expect the reset.
Broke each by hand and watched red: no resetsAt, 3 fail; no free flag,
3 fail; no cap, 1 fail. bun scripts/check.mjs commandcode: ok.
Live, with the owner's GOAT key: the card's Credits window says resetsAt
2026-10-28T16:16:42Z, the subscription's until; its list (71 models) has
poolside/laguna-s-2.1-free free, the only one of the 11 Command Code lists
today. Not tried live: a Go request over 200,000 (no Go key here).
01huadalang, signed in on the Go plan, was shown models only GOAT and above
may use. Command Code's /provider/v1/models is the same 87 models for every
plan (read with a GOAT key and without one on 2026-10-13: the same but for
"created"); which of them a plan may use is the CLI's own table (command-code
1.79.2, evaluateModelAccess: each model's category, premium or open, and
each plan's allowedCategories and blockedModels), and the Provider API turns
the rest away only when asked (403 "MODEL_NOT_IN_PLAN: Claude Opus 5.5
available in Provider and above plans or extra on demand usage").
Cause: the plugin filtered Go's list by a copy of CLI 1.73.0's table, which
didn't have Claude Haiku 5.5 (1.79.2: "haiku 5.5 in goat plan", blocked for
Go), and didn't filter any other plan at all, so GOAT, Pro and Provider were
shown models their plan refuses (a real GOAT account listed all 87, Claude
Opus 5.5 and GPT-6 Sol among them).
Now:
- PLAN_MODELS is CLI 1.79.2's table by plan name: Go and GOAT the open
models only, Go also blocked from GOAT's (Sonnet 5.5, Haiku 5.5, GPT-5.6
Sol, Grok 4.6/4.7, Muse Spark 1.2/1.3, Gemini 3.7/3.8 Flash, MiMo V2.6 Pro
UltraSpeed), Pro blocked from Opus, Fable, GPT-6 Astra, GPT-6.1 Sol and
Fugu Ultra, Provider from GPT-6.1 Sol, Max/Ultra/Teams Pro everything.
GO_REFUSED is derived from it. Blocks are by id: the CLI's own block of
"vercel-ai-gateway:xiaomi/mimo-v2.6-pro-ultraspeed" misses its "cai"
model, and Go stays kept off it as before.
- provider.models filters every plan's list (and the default list standing
in when the list can't be read) by it.
- A plan not read (billing/subscriptions failing, nothing saved), "No plan",
or a plan name the table doesn't know keeps the whole list.
- Bought or free credits (billing/credits) let every model, as the CLI does;
credits not read are taken as last read, else none, so the plan's list
stands and a model it leaves out is still refused by Command Code.
- The refusal itself is unchanged: the Provider API's 403 reaches the agent
as it came, and on Go's endpoint failure() says "Model not in plan: …".
Tests: plan-models.test.mjs is new, built from real bytes in testdata
(models-2026-10-13.json, a GOAT account's subscriptions and credits replies
with its ids zeroed, the two MODEL_NOT_IN_PLAN refusals). The Go case uses
the GOAT reply with Go's planId: there is no Go account here. All 7 fail on
0.1.11. Broken by hand, each goes red: Haiku 5.5 unblocked for Go (Go test),
no plan filter (5 tests), credits ignored, an unread plan refusing premium,
the stand-in list unfiltered, credits unread taken as extra.
models.test.mjs's pictures test moves from Pro to Max, since Pro's list no
longer has Claude Opus 5.5.
Ran: TMPDIR=<scratch> HOME=<scratch>/home bun test (all packages, 1144 pass,
0 fail) and bun scripts/check.mjs commandcode. The new provider.models hook
against the owner's real GOAT account (saved plan and none) lists 66 models:
Sonnet 5.5, Haiku 5.5 and GPT-5.6 Sol in, Opus 5.5, Sonnet 5 and GPT-6 Sol
out; a 1-token request confirmed GOAT gets Haiku 5.5 (200) and is refused
Sonnet 5 (403 MODEL_NOT_IN_PLAN).
Not tried: a real Go account (none here), an account with bought credits,
and the new version inside a running OpenCode/magpie; magpie needs the
mover's min raised to 0.1.12 for moved users to get it.
This is the sibling of zen-free 0.1.4 (6a5dd01). /alpha/generate's reply
is turned into a Chat Completions stream, which magpie's gateway can't go
on with, so the error frame threw away what the client was already shown.
Now a streamed reply that said something (text, reasoning or a tool call)
and then lost its finish line ends with the note, a finish (`stop`, or
`tool_calls` after a call) and [DONE]. Tool calls arrive whole here, so
none can be half written. A reply that said nothing, or one that wasn't
streamed, is still a 502, so magpie retries it.
Run: HOME=$(mktemp -d) bun test packages/commandcode gave 37 pass. The
whole repo's bun test gave 1129 pass, 0 fail. bun scripts/check.mjs passed.
On the old index.mjs, 3 of the 4 new tests fail. With the cut branch
disabled by hand they fail again.
Not tried: a real Go account. The owner's two Command Code accounts aren't
on Go, and the real upstream can't be made to cut a stream. A streamed
request through the patched loader on those accounts still takes the
Provider API path, which this commit doesn't touch.
Found beside #86. A Go key's chat completion goes to /alpha/generate with
the CLI's config, which said workingDir: homedir() and isGitRepo: false
whatever folder the agent worked in. It now takes the folder and the git
state magpie tells the plugin's fetch (x-magpie-work-dir,
x-magpie-work-git). Untold, it is the CLI's config outside a project in
the home, as before (a git word without a folder means nothing). The
headers are taken off every request, the Provider API's too.
Run: bun test in packages/commandcode (33 pass, new workplace.test.mjs),
bun scripts/check.mjs commandcode. With the old index.mjs both new tests
fail. Not tried with a real Go account.
.github/workflows/publish.yml runs the tests (in a throwaway HOME) and
scripts/publish.sh on each package.json change pushed to main, or by hand;
npm's OIDC exchange stands in for a token and an OTP. Every package now
names magpie-community/plugins' publish.yml as its trusted publisher on
npmjs.com, and gets the repository field npm checks it against.
- every {type:"failed"} carries an error reason magpie shows
- commandcode/devin: accounts taken from the CLI are marked metadata.cli and re-read its credentials on each request, usage and models
- factory: a refused refresh answers 401 authentication_error (Anthropic shape on /llm/a/, OpenAI's elsewhere) instead of throwing; the whoami back-off is per account; 403 hints name the account to sign in again
- versions: factory/devin/commandcode/cursor/kiro/mimo/zed/zcode 0.1.2, workbuddy 0.1.3