Releases #396 (metadata.cli saved as "true", so OpenCode 1 keeps the
account). Adds the test #396 lacked: the "Devin CLI's sign-in" method,
with a sandbox credentials.toml and a stubbed GetUserStatus, must save
cli as "true" and every metadata value as a string.
Run: bun test in packages/devin (sandbox HOME): 102 pass, 0 fail.
bun scripts/check.mjs devin passes. With index.mjs put back to
`cli = true`, the new test fails and the other cli-key test passes.
By mameikagou. Reviewed at 0966b4b (comment on #297); squashed onto
origin/main dc59000 with the version bump.
Run at this tree: HOME=$(mktemp -d) bun test: 2083 pass, 0 fail;
bun scripts/check.mjs ok. Earlier, at 0966b4b with main's
packages/devin/index.mjs put back, the three new or changed tests
(empty-reply, error-after-metadata, metadata-only) were red.
Not tried: a real Devin account answering with an empty reply.
Co-authored-by: mameikagou <mameikagou@users.noreply.github.com>
Two Devin organizations under one email both answered GetUserStatus with
the same email, so the plugin saved both sign-ins as the same
metadata.email and magpie's host (settle, which matches on it) put the
second over the first. The account is now named "email · <organization>"
when Devin names an organization (devinInfo.accountDisplayName) that isn't
the email, with orgId and teamId in its metadata. The usage hook brings an
older sign-in's name and ids up to date through client.auth.set, which the
host scopes to that account. `devin auth status`'s Team ID must match
before the CLI is taken to answer for a key. An account with no
organization in its status is left as it was and nothing is written.
Existing users: on the next usage poll, a sign-in whose status names an
organization is renamed "email · <org>" once; its slot, key and plan stay.
metadata.orgId and teamId aren't read by magpie's host today; the slot
split comes from the distinct name. The magpie side (a CLI account's label
overwritten by `devin auth status`) is yetone/magpie#3198.
Run at the reviewed head 7d589ab45323ee46a03af0f4b496c2dc94e67ba4
(base af360a5), on macOS, bun 1.4.2:
- HOME=$(mktemp -d) bun test: 2051 pass, 0 fail; bun scripts/check.mjs ok.
- Red without the change: the two new tests (identity, usage) fail against
main's index.mjs.
- Ad-hoc test (not committed): a status with no organization writes
nothing through auth.set and keeps the name; an organization named as
the email adds no suffix.
- With #297's change on the same tree: 2052 pass, check ok.
Not tried here: real Devin accounts (the author reports two live Devin Max
organizations under one email on Windows 11).
magpie's built-in Devin (internal/gateway/devin.go buildDevin) sends the
images a tool returned on the tool message that answers the call
(inlineImages(p.Images), field 10). A chat's tool message holds text
alone, so magpie's gateway hands the plugin those images in the user
message after the results (buildChat's seeLater: "[From the result of
<tool> (tool call <id>):]" then the images, and the result's text ends
"[The tool returned an image; it follows in the next message.]"). The
plugin sent them to Devin as a user message of their own, and a tool
message's own image_url parts were dropped.
build() now puts each result's images back on its tool message: the
images under a heading naming a result just sent, up to the number its
note says (so the user's own images after them stay the user's), and a
tool message's own data: image_url parts. The note is taken off the
result's text when every image it names went back with it; an empty
result is "(no output)", as the built-in words it. Images without bytes
(URLs) are left out, as inlineImages leaves them. A heading that names no
result just sent is left as the user's text.
Run:
- bun test in packages/devin under a mktemp HOME: 93 pass, 0 fail.
- bun scripts/check.mjs devin: ok.
- tool-images.test.mjs against the old index.mjs: 3 of its 4 tests red
(the fourth guards a heading naming no result, which held before too).
With the count limit broken by hand (images past the note's number taken
as the tool's), the two-results test goes red.
- The fixtures in testdata/ are magpie's literal buildChat output at
origin/main b03031738, captured with a throwaway test in a separate
magpie worktree (codexViewImage, and an Anthropic request with two Read
results and the user's own image).
Not tried: a real Devin account (whether Devin's model reads a tool
message's images better than a user message's was not measured); OpenCode
itself, outside magpie, whose own shape for a tool's images was not read.
Devin's GetChatMessage has no field for the answer's format, so magpie's
built-in Devin (internal/gateway/devin.go, req.inSystem()) told the model
in the instructions: the json_schema's schema, or any JSON object for
json_object. The plugin dropped response_format, and magpie's generic
plugin path falls back to inSystem only when an upstream answers 400
naming the format, so a moved user asking for JSON got prose. build()
now adds the built-in's words (format.go's instruction) after the
system messages, ahead of the tool descriptions, at the head of the
first user message. A json_schema with no schema asks for any JSON
object, as the built-in's openAIFormat reads it.
Checked against the built-in, no change needed:
- Lightning variants (swe-2-high-lightning, swe-1-7-lightning-medium):
the built-in's tiers are fast and priority only (devinTiers), so a
-lightning id is no effort and no tier and is listed as its own model,
as the plugin lists it.
- A failed tool's result: magpie sends its content as "Error: …", and
build() passes a tool message's text to Devin as it came; a test now
holds that.
Run: HOME=$(mktemp -d) bun test in packages/devin: 89 pass, 0 fail.
structured-output.test.mjs: 3 of its 5 tests red with the index.mjs
change taken out (the other two: no format unchanged, and the
"Error: " pass-through). bun scripts/check.mjs devin: ok.
Not run: a real Devin account, nor magpie end to end.
太陽と向日葵 on magpie's Discord: Usage no longer shows what calls through
Devin cost. Two causes, both in what the list gives magpie:
- Every model went with a price of 0 (runtimeModel's cost), and magpie
falls back to models.dev, which has none of Devin's own models (SWE-2,
SWE-1.7 Lightning). Devin lists each paid model's price in
GetCliModelConfigs: field 32 of a config, one per "Input", "Cached input"
and "Output", a float32 in USD per "1M tokens". parsePrices reads it
(fields() now keeps a fixed32's bytes), and listed() gives an entry the
price its variants share, none when they differ. Read from Devin's own
response on 10-15: Opus 5.5 4/20 (cache 0.2), its fast run 8/40, SWE-1.7
Lightning 2.5/12.5, SWE-2 Lightning 1/5, GLM-5.2 1.4/4.4. The Free tier
lists none.
- Devin now files swe-2-high-, -medium- and -max-lightning under SWE-2 at
the High cost tier. A family was free only when every model under it
was, so swe-2 lost free (seen in the owner's plugin-providers.json on
0.1.17), and with it 0.1.16's rule that a used-up day and week don't hold
SWE-2. A family is now judged by the variants variantFor sends it as:
those at an effort and its default.
Run: HOME=<mktemp -d> bun test in packages/devin: 84 pass. prices.test.mjs
uses Devin's real GetCliModelConfigs bytes of 10-15, cut to 11 configs
(testdata/model-configs-1015.bin, no account data in it). Without the
index.mjs change: 3 of its 4 tests red. Broke by hand: the family's free
over every model again turns 2 red; cost back at 0 turns 1 red.
bun scripts/check.mjs devin: ok. Every price above checked by decoding the
full real response with a separate Python reader.
Not run: magpie end to end with this version (magpie reads a plugin's
price from its next commit on).
7eleven, in ZCode on devin/gemini-4-argon, got every turn refused:
"Devin: There is an issue with this request, please try a different
model." (invalid_argument). It is the request content, on Gemini models
only. On a real account, gemini-4-argon, gemini-3-1-pro and
gemini-3-8-flash refuse a request offering a tool whose schema has, at
any depth:
- a list type: ["string","null"], ["string"], ["string","number"];
- type "array" with no items, items true, or items that are a list;
- properties with no type;
- an enum with no type.
claude-sonnet-4-6 and swe-2 take all of them. Nullable written as anyOf,
items {}, nullable:true, const, $ref/$defs, additionalProperties and
format all go through on Gemini.
geminiSchema rewrites them, for a Gemini uid only:
- a list type becomes its one type, nullable when it had "null", or
anyOf of each type;
- such an array's items become {} (a one-schema list becomes that
schema);
- a schema with properties gets type object;
- an enum gets its values' type, and an enum of mixed values is dropped.
The caller's schema is not changed. Claude and swe-2 requests are byte
for byte what they were.
What was run:
- HOME=$(mktemp -d) bun test packages/devin: 80 pass.
- gemini-schema.test.mjs, with the gemini line in build() turned off by
hand: 10 red, one per refused shape.
- bun scripts/check.mjs: ok.
- Real account: each refused schema, sent as built here, went through on
gemini-4-argon-medium and gemini-3-1-pro-high.
- build() end to end with a search tool holding a list type, an array
with no items and an untyped enum: gemini-4-argon called the tool, where
0.1.16 got invalid_argument. claude-sonnet-4-6 called it on both.
Not tried: ZCode itself against the plugin. The reporter's exact tool is
not known; ZCode's own zod 4 tools write anyOf, so it is likely one of
their MCP or plugin tools.
太陽と向日葵 on magpie's Discord: SWE-2 costs nothing, but with the
account's quota used up magpie said so and didn't send SWE-2 to the
account, while a test of the model worked.
Devin's GetCliModelConfigs gives each model a model_cost_tier (field 24;
the CLI labels 1-4 "Low cost", "Med cost", "High cost", "Free"). On the
owner's account on 2026-10-14, of 262 configs only swe-2-high, -medium
and -max were 4. The plugin now reads that (parseFree), lists those
models and the entries standing only for them (swe-2) with free: true,
and gives the "1 day" and "7 days" windows notModels with their ids, so
magpie's allowance no longer counts them. ACUs are unchanged. When
Devin's configs can't be read, nothing is marked free and the windows
count every model, as before.
Run: bun test in packages/devin (58 pass) with HOME and TMPDIR in a
scratchpad dir; bun scripts/check.mjs. Broke it by hand: FREE_TIER=5
fails 3 of free.test.mjs's tests; dropping notModels fails the usage
one. Not tried: an account whose quota is really used up (the owner's
had 100% of the day and week left), so that Devin itself serves SWE-2
then is the reporter's word, not checked here.
On Windows the devin CLI reads %APPDATA%\devin\ whatever folder it is
given (#17), so cliAnswersFor turned it away for every account before
looking at whose sign-in it reads, and an account without the CLI never
asked at all. Both kept the 2026-09-30 SNAPSHOT, which has no Gemini 4
Argon; moving a built-in Devin with it ticked then failed with "the
plugin doesn't serve Gemini 4 Argon" (NieiR).
The list now comes from GetCliModelConfigs, asked with the account's
token (the call the plugin already made for images): its configs carry
each model's label, context (18), output (model_info 13), family uid
(model_info 23) and family label (30.1). Read over Devin's real response
for the owner's account, parseConfigFamilies gives exactly the 52
families and 262 variants `devin models list --format json` prints, in
its order, less Adaptive and Fusion. When Devin can't be asked, the CLI's
list is used if the CLI names the account Devin names the token's, even
when it reads its own folder (the Windows case); else SNAPSHOT, now
refreshed from the CLI (Gemini 4 Argon and Claude Haiku 5.5 added,
Inkling and Claude Sonnet 4.5 kept for the accounts still offered them).
Run:
- TMPDIR/HOME in a scratch dir, bun test packages/devin: 54 pass, 0 fail.
With index.mjs put back to 0.1.14, the 4 new identity tests fail
(parseConfigFamilies missing; familiesFor without gemini-4-argon;
"models list" never run for a same-account CLI reading its own folder;
provider.models without gemini-4-argon).
- bun scripts/check.mjs devin passes.
- Real account (owner's Devin, sandbox HOME, no devin CLI on PATH):
provider.models gave 85 models with gemini-4-argon (1048576/1000000)
and claude-haiku-5-5; 0.1.14 gave the declared list only.
Not tried: the Windows box itself; the new path doesn't run the CLI.
Devin plans billed by quota have a daily and a weekly quota. GetUserStatus
answers in proto JSON, which leaves a 0 out, so a week with nothing left
came as no weeklyQuotaRemainingPercent at all beside the day's 100. usage
skipped a window whose share was left out, so the card showed "1 day 0%"
alone and magpie's routing, seeing no full window, kept sending to an
account Devin refuses until the week resets.
On a BILLING_STRATEGY_QUOTA plan a window with a reset time and no share
is now used up (100%, its reset kept), so routing holds the account until
then. A hidden quota and one with no reset are still not shown, and a plan
billed otherwise still has no quota windows from a share left out.
usage.test.mjs: the new test (the week left out beside the day's 100, and
both left out) fails on 0.1.13 and passes now; the old test that took a
left-out share for "no quota" on a quota plan is replaced.
HOME=$(mktemp -d) bun test packages/devin: 50 pass, 0 fail.
bun scripts/check.mjs devin passes. Against the owner's real Devin Teams
account (read-only GetUserStatus): both windows are read as before
(1 day 0%, 7 days 1%), so present shares are unchanged. A real account
with the week used up wasn't available; the left-out field is how the
reporter's card lost its week.
SWE-2 names a call after its tool and turn ("Bash:0#a65b6a5e02194b87bbc796c4428c946d"), and the plugin passed that on as the call's id. Claude Code takes a tool_use id only of [A-Za-z0-9_-]: it dropped every such call and the turn failed with "The model's tool call could not be parsed (retry also failed)". Codex and pi take any id and were fine.
An id with any other character, or one that begins "dv_", now goes out as "dv_" and its base64url (stateless, so it holds across restarts and accounts); build() turns it back into Devin's own id on the assistant's call and on the tool result that answers it, so Devin still sees the id it gave. A safe id goes both ways as it came. magpie passes a chat tool_call id through unchanged to Anthropic's tool_use.id, Responses' call_id and Chat, so the one mapping covers all three.
tool-ids.test.mjs builds Devin's reply frame from the reporter's literal id: with the change taken out, both the whole and the streamed test fail (Received: "Bash:0#a65b6a5e02194b87bbc796c4428c946d" against /^[A-Za-z0-9_-]+$/); with it, the id out is safe and the call and its result reach Devin as "Bash:0#a65b…". HOME=$(mktemp -d) bun test packages/devin: 45 pass; the 4 CLI tests in identity.test.mjs time out at 30 s on this Mac with and without the change (a script just written under $TMPDIR doesn't start: exec of a fresh /bin/sh script hangs here), and pass in CI. bun scripts/check.mjs devin passes. Not tried against a real Devin account.
An agent can send one turn's tool calls in two assistant messages in a
row, answered together after. build() answered the first message's calls
at the second one: toolu_a went to Devin as "Tool use was interrupted and
did not produce a result." and its real result A! was dropped.
joinSplitCalls now joins an assistant message onto an assistant message
before it that made tool calls, as Anthropic reads consecutive assistant
messages and as magpie's built-in buildDevin does since 7067fce5. A call
of the split turn that really went unanswered is still answered for; two
text-only assistant messages stay two.
split-calls.test.mjs is #1275's request in Chat form: 3 of its 4 tests fail
on 0.1.10 and pass now. HOME=$(mktemp -d) bun test (43 pass, 0 fail) and
bun scripts/check.mjs pass. Not tried against a real Devin account.
objectRoot dropped any anyOf/oneOf branch that was itself a union. Codex
desktop's automation_update (zod 4: root anyOf of view, delete, and create
and update, each a union on kind) folded to only view's mode and id, both
required, so the model was offered a tool that could only view. Found
while fixing the same fold in magpie's built-in for #1271.
A nested union branch is now folded first (up to 8 deep); a field the
root doesn't define takes every distinct schema the branches give it, as
anyOf when they differ; a field every branch requires stays required.
Verified: schema.test.mjs's new test fails on 0.1.9 (no "name" among
[id mode]) and passes now; HOME=$(mktemp -d) bun test in packages/devin:
39 pass, 0 fail.
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.
.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