Commit Graph
43 Commits
Author SHA1 Message Date
yetone a064cf15e1 devin 0.1.35: Claude's thinking keeps its signature and goes back with it (#665)
Vigilans (#665): GetChatMessage's reply carries the thinking's signature
in delta_signature (10) and its type in delta_signature_type (21), and
ChatMessagePrompt takes the thinking back in thinking (11), signature
(12) and signature_type (18). The plugin read only delta_thinking (9),
so /v1/messages answered thinking blocks with signature "", and the
next request left the assistant's thinking out. Field numbers checked
against devin2api's all-protos.proto (GetChatMessageResponse,
ExaChatPb_ChatMessagePrompt) at e8547b6d.

- events() yields {signature} for field 10 and {signatureType} for 21.
- Messages, whole: the signature goes on the last thinking block. Stream:
  a signature_delta in the open thinking block, before its stop, as
  Anthropic streams it. Only when the request's model is Claude; another
  model's thinking stays unsigned, as before.
- The type is kept by signature (the last 512) since a Messages block has
  no field for it; one not kept goes back as "anthropic", what Devin says
  for Claude.
- buildMessages, to a Claude model: a signed thinking block goes back
  on the assistant prompt after it (its text, or the calls' prompt);
  a second one before any prompt gets an empty prompt of its own, and
  one after the text with calls following goes on the calls' prompt.
  Unsigned thinking, thinking to a model that isn't Claude, and a turn
  that only thought send nothing, as before.
- The chat completion and Messages streams read past events they send
  nothing for: a pull that enqueues nothing isn't pulled again in Bun,
  and the Messages stream hung on one (seen in the new tests before the
  loop).

Not changed: chat completions (and OpenCode 2's language model, which
goes through them) have no field for a signature, so they carry the
thinking text only, as before. thinking_redacted (reply 11, prompt 13)
isn't read or sent.

Run at this head on mote:
- bun test packages/devin (HOME a temp dir): 199 pass, 0 fail.
- repo root bun test: 5175 pass, 0 fail (15 skip); bun scripts/check.mjs ok.
- thinking-signature.test.mjs on origin/main 311d628: the six tests of
  the signature (read, whole, stream, replay, two thinking blocks, type)
  red; the four "as before" tests pass.
Not tried: a real Devin account (none in a sandbox); frames are built
from the proto's field numbers, not captured bytes.
2026-11-03 17:28:11 +08:00
yetone 4c801e5756 devin 0.1.34: keepalive pings timed from when the request was sent; magpie's session header keys them (#626, #620)
#626 (zelong77): keptAfter scheduled the first ping 285 s after the
reply's stop event, and run() scheduled each next one 285 s after the
ping before had come back. Devin renews its cache when it takes a
request, so a 33-47 s Fable reply or a 10-20 s ping put the next ping
past the 5 minutes. In zelong77's usage.jsonl every ping 315.9 s or more
after its request was sent missed and wrote ~500k tokens again.

- roundtrip stamps sentAt before it sends; scheduleKeepalive waits
  max(0, interval - (now - sentAt)), and each ping is timed from when it
  was sent. A reply or ping longer than the interval is followed at once.
- The timers object carries the clock (now), so tests hold it.

#620, after 0.1.33 (zelong77, 08:18): through magpie, check A and the
grown check B still kept separate pings. magpie hands a plugin's fetch
none of the agent's own headers, so x-claude-code-session-id never
reached keepaliveKey, and magpie's translation merges Claude Code's two
user messages into one whose history grows in the middle, which firstOf
can't follow.

- keepaliveKey reads x-magpie-session first and x-magpie-subagent beside
  x-claude-code-agent-id. magpie sets both on a plugin's fetch in a
  release that follows this one; the host strips them from what a plugin
  sends on.
- README: the timing, and the headers.

Run on mote (Bun 1.4.2, HOME=$(mktemp -d)) at this tree, on main 63cd0e4:
- packages/devin `bun test`: 189 pass, 0 fail.
- The 3 new keepalive tests on main's index.mjs: 3 fail (22 pass). The
  two timing tests got 285000 where 238200 and 0 were due; the merged
  check A's timer was never cleared.
- Whole repo `bun test`: 4781 pass, 0 fail. `bun scripts/check.mjs
  devin`: ok.

Not tried: a real Devin account or a real Claude Code session; fake
timers and a fake Devin only. Without any session header (not Claude
Code's case once magpie sends x-magpie-session), a merged check whose
history grows in the middle still gets a new key: matching on a shared
leading block would merge different conversations that start with the
same reminder, which costs a full rewrite rather than an extra read.
2026-11-02 16:54:17 +08:00
yetone 581ca13db6 devin 0.1.33: a permission check whose history grew replaces its keepalive pings (#620)
zelong77 found that Claude Code Auto's permission check left several
keepalive tasks running for one check. keepaliveKey hashed the first user
message, and the check sends the whole history in that message, so every
check got a new key. stopKeepalive(newKey) never stopped the old task,
and each reply started another one.

- The key is now the session, the Claude Code agent id and a hash of the
  instructions and the tools' names. The first user message is left out
  when the agent names a session. The lead, its permission check and a
  subagent still get keys of their own, because their instructions,
  tools or agent id differ.
- When a request names no session, the first message still tells two
  conversations apart. A first message that grew from one seen before
  (blocks appended, or text added to the last block) maps to the earlier
  key (firstOf). firstOf keeps only hashes, of 256 conversations at most.
- README: what a conversation is.

Run on mote (Bun 1.4.2, HOME=$(mktemp -d)) at this tree, on main 2595d48:
- packages/devin `bun test`: 186 pass, 0 fail.
- The new keepalive tests on main's index.mjs: 4 fail (18 pass, 4 fail).
  These are zelong77's repro, with and without session headers, plus a
  grown last text and the stay-apart case.
- Whole repo `bun test`: 4741 pass, 12 skip, 0 fail.
  `bun scripts/check.mjs`: exit 0.

Not tried: a real Devin account, or a real Claude Code Auto session. The
tests use zelong77's offline requests with fake timers and no network.
A request with no session whose first message starts with another
conversation's whole first message is taken as that conversation.
2026-11-02 14:44:55 +08:00
leosocy 17525a70fd devin 0.1.32: a system notice mid-conversation keeps its place and cache mark (#599)
buildMessages now sends a role:"system" notice partway through a conversation as a user prompt that keeps its cache mark and its place. Before, the notice was lost or merged away. A notice that arrives while tool calls are still waiting for results is held until those results are answered, so it never comes between a call and its result. A notice after an interrupted call goes after the missing-result placeholder. An empty notice is skipped.

By leosocy (#599), reviewed at 647039a.

Run on the Mac mini with Bun 1.4.2 and HOME=$(mktemp -d), on 647039a merged with main 1a05a77:
- `bun test packages/devin`: 182 pass, 0 fail.
- The new tests on main's index.mjs: 4 of cache-marks.test.mjs fail (13 pass, 4 fail), as they should.
- Whole repo `bun test` (with #606 and #596 merged in too): 4592 pass, 11 skip, 0 fail. `bun scripts/check.mjs`: exit 0.

Not tried: a real Devin account.
2026-11-02 03:36:24 +08:00
yetone 1a3a138491 devin 0.1.31: each cache keep-alive ping is told to magpie; the interval and count get magpie's Options editor (#592)
zelong77 asked for two things once 0.1.30's keep-alive worked: the pings
were invisible in magpie, and the interval and ping count could only be
edited in plugins.json.

- Each ping that wasn't cut short is reported through magpie.usage (new
  in magpie, plugins#592) with kind cache_keepalive, the conversation's
  model (chat.model) and account (magpie.account at request time), its
  input, output, cache read and write tokens, status, time, and why it
  failed. The ping still goes straight to Devin, never back through the
  gateway: the gateway re-shapes a request, and the cache would no
  longer match. An older magpie or OpenCode has no magpie.usage and is
  told nothing; the pings go on the same.
- pingOnce now also reads output tokens (usage field 3) and keeps the
  failure's message.
- package.json magpie.options gives the two settings' defaults
  (285 s, 6), which magpie's Plugins › Options editor now starts from
  for a provider plugin. The switch's description says where they are
  and that pings show in Usage, in all five languages, each under the
  host's 300-character cap.

Run (on mote, sandbox HOME): bun test in packages/devin, 174 pass;
bun scripts/check.mjs devin ok.
Broken by hand: reporting aborted pings too fails "a ping cut short by
the conversation's next request isn't told"; dropping the report call
fails "each ping is told to magpie".
Not tried: a real Devin account's ping reported into a real magpie.
2026-11-01 17:59:33 +08:00
yetone b797476f6b devin 0.1.30: an opt-in cache keepalive, as the devin CLI's (#592)
Devin's prompt cache lasts 5 minutes and has no longer TTL to ask for.
A switch, "Keep the cache warm" (cache_keepalive, off by default, with
zh, zh-TW, ja and de labels), keeps it as the CLI's cache_keepalive.rs
does: after a reply that read or wrote the cache, whatever it stopped
for, the same GetChatMessage goes again every 285 s with one more user
prompt, "continue", and max_tokens 1. The request's bytes are encoded
once, and the ping is them with that prompt and field 8's max_tokens.

- A conversation is session + Claude Code agent id (when the headers
  reach the plugin) + a hash of the instructions, tool names and first
  user message; its next real request stops its pings, so a subagent
  never stops its lead's.
- Stops on 401, 402, 429, two pings in a row reading under half their
  prompt from the cache, the most pings (6), the switch going off, and
  process exit. Timers are unref'd. At most 32 conversations are kept.
- Options cacheKeepaliveInterval (30-299 s) and cacheKeepaliveMaxPings
  (1-50); OpenCode, which has no switch, takes cacheKeepalive: true.
- README says the cost (each ping is a cache read of the whole context,
  spent whether the user comes back or not) and why it is off.

Run (mote, HOME=$(mktemp -d)):
- bun test packages/devin: 170 pass, 0 fail (14 new in keepalive.test.mjs).
- Whole repo bun test: 4520 pass, 9 skip, 1 fail: gcp-ai's "a lock held
  by another process is waited for, then taken" (ENOENT in abandoned()'s
  stat, a race in lib/lock.mjs; passes 3 of 3 alone), filed as #594.
- bun scripts/check.mjs: ok.
- The new tests against the old index.mjs: 14 of 14 fail.

Broken by hand, each red in the test named for it: no cancel on the next
request, no agent id in the key, no prefix hash, no stop on 401/402/429,
no miss count, no cap, no unref, max_tokens kept, pings after a reply
that touched no cache.

Real account (the owner's Devin sign-in read, nothing written, sandbox
HOME, this Mac): claude-sonnet-5-5-low, an 11k-token prompt wrote 10,984
to the cache; one ping 287 s later read 10,984 from it (cacheWrite 3,
output 1) and, at max 1, stopped.

Not tried: more than one ping or a long Claude Code session; the OpenCode
2 (v2) path, which has no keepalive. magpie doesn't pass
x-claude-code-session-id / x-claude-code-agent-id to a plugin's fetch, so
under magpie the key rests on the prefix hash (a lead and a subagent
differ there; two sessions with the same prefix share one keepalive).
2026-11-01 14:12:06 +08:00
yetone 8b01396ffe devin 0.1.29: a failed tool result on the Messages path says "Error: " first (#566)
0.1.28 moved Devin's Claude models onto Anthropic's Messages API, where
a failed result arrives as tool_result is_error. On chat completions
magpie's gateway writes it into the text, "Error: " first (failedAsText:
Devin has no failed mark), and TestPluginToolFailureSaid holds that; the
Messages path dropped is_error. It now says it the same way.

Run:
- mote-run: HOME=$(mktemp -d) bun test in packages/devin, 156 pass 0
  fail; bun scripts/check.mjs ok.
- Broken by hand: without the prefix the new test fails.
Not tried against the real Devin API (the change is text only).
2026-10-31 22:20:09 +08:00
yetone 1d340e873e devin 0.1.28: Claude models keep the client's cache marks and block boundaries (#566)
Claude Code's growing classifier history read only ~558 tokens from
Devin's cache: the plugin declared @ai-sdk/openai-compatible for every
model, so magpie turned Anthropic Messages into chat and the blocks were
joined into one text with no cache_control, and encodeMsg never sent
ChatMessagePrompt.prompt_cache_options.

- Claude models (id matching /claude/i) now declare @ai-sdk/anthropic
  (config provider.npm, runtime api.npm, variants {effort}); every other
  model is unchanged (chat, {reasoningEffort}).
- The loader serves .../messages: buildMessages makes each text block,
  system block, assistant text, tool-call turn and tool result its own
  ChatMessagePrompt in order, every boundary kept (yetone/magpie#3835),
  with field 8 {1: 1} (EPHEMERAL) where the client put cache_control.
  The encoding is the devin CLI's own: a capture of devin 3000.11.92
  through a recording proxy carries 0801 at field 8 of its user prompt.
  Claude Code's billing line (cch changes each turn) is dropped. Tools
  with a server type are not offered; tool_choice none offers none.
  Effort: output_config.effort, else the thinking budget, none when
  thinking is disabled.
- Replies come back as Anthropic's message / SSE events, usage with
  cache_read_input_tokens and cache_creation_input_tokens; errors in
  Anthropic's shape, X-Magpie-Sign-In: kept; /messages/count_tokens 404.
- The chat path's request bytes are unchanged (build's tail moved into
  encodeRequest).

Run:
- mote-run: HOME=$(mktemp -d) bun test in packages/devin, 155 pass 0
  fail (19 files, at this tree rebased on 42a5055); bun scripts/check.mjs
  ok.
- Broken by hand: without the field 8 line, 3 of the 8 new tests fail;
  with user blocks joined into one prompt, the two cache tests fail.
- Real Devin account (sandbox credentials, the plugin's completeMessages
  called directly, no magpie), the issue's sequence ~7.3k tokens, first /
  resend / grown history / resend, cache read/write:
  claude-haiku-5-5 whole: 558/6760, 7318/0, 7318/560, 7878/0
  claude-opus-5-5 streamed: 558/6760, 7318/0, 7318/560, 7878/0
  old 0.1.27 chat path, same text: 558/6787, 7345/0, 558/7344, 7902/0
  A tool round trip on haiku (streamed tool_use, then a tool_result
  marked, two assistant text blocks as two prompts) answered correctly.

Not tried: through a magpie gateway end to end with Claude Code (the
non-streaming Messages path for plugin accounts is yetone/magpie#4571);
images in a Messages request against the real API; the v2 (OpenCode 2)
path, which is unchanged.
2026-10-31 22:14:06 +08:00
yetone eee889afab devin 0.1.27: SWE-2 never goes as a paid -lightning variant or a bare family id, and an unreadable model list is said, not swallowed
zws13579 (magpie Discord #general, devin 0.1.26): a Devin Free plan
account ($0) can't use SWE-2 through the plugin, while Devin CLI/Desktop
can. They listed five places SWE-2 could be lost silently; checked each
against the code:

1. configsFor swallowed every error (real). Its reason is now kept
   (c.error), logged once to stderr when the asks start failing (the host
   routes it to magpie's log), and usage adds an aside row "Free models:
   unknown: Devin's model list couldn't be read (<reason>)" when a quota
   window exists and Devin has never answered for the account. The windows
   still count every model then (a failed read means unknown).
2. notModels only rides on a window (as designed: with no window nothing
   counts SWE-2). A plan with no quota window gives none and no error;
   a test holds that. The real gap behind it was 1, now visible.
3. A family the account's list leaves out (picked from SNAPSHOT's list,
   which the OpenCode config offers) went to Devin as the bare family id
   ("swe-2"). variantFor now falls back to SNAPSHOT's family, so it goes
   as swe-2-high (swe-2-max at max). The listing is unchanged: no model
   is added that the account's list doesn't have.
4. variantFor's effort-less default and listed()'s free check took
   f.models[0]. Devin's captures (10-14, 10-15) list swe-2-high first, so
   it isn't hit today, but a first -lightning variant (High cost tier)
   would have sent effort-less SWE-2 to a paid variant and unmarked it
   free. defaultModel skips such suffixed variants.
5. v2Models/v2Setup: not a magpie path. magpie's host loads server()
   (DevinAuthPlugin), whose usage hook carries notModels; OpenCode 2 has
   no usage hook, and a free model's cost there is already 0.

usage.test.mjs's stub answered GetCliModelConfigs with a JSON parse
error, so those tests ran with the model list unreadable; it now serves
a one-model list, so they test what they name.

Run (mote, from the repo root, as CI): HOME=$(mktemp -d) bun test:
3866 pass, 9 skip, 0 fail; bun scripts/check.mjs: every package ok.
Broken by hand: the new free.test.mjs against origin/main's index.mjs:
3 red (lightning default "swe-2-medium-lightning", bare "swe-2", no
"Free models" row), 6 green.

Not tried: a real Devin Free plan account. No Free plan GetUserStatus or
GetCliModelConfigs has been captured, so whether Devin gives a Free
account SWE-2 at the Free cost tier (its pricing lists free SWE-2 for
Pro) is unknown; nothing here assumes a shape for it.
2026-10-30 22:08:48 +08:00
yetone 9410e2a510 commandcode 0.1.19, devin 0.1.26, kiro 0.1.19: a refused sign-in marks the account signed out
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.
2026-10-29 17:04:52 +08:00
A. S. 9dbde4573c devin: OpenCode 2 support, a default export with setup (#397)
devin 0.1.25: the plugin loads in OpenCode 2 (a default export with setup), beside OpenCode 1.

Also: v2Usage leaves the uncached count undefined when prompt_tokens is missing, instead of NaN.

Run at the reviewed head 6b151dba3c7cc1056026629bf2e4e4c8e312a6d0, on mote:
- HOME=$(mktemp -d) bun test packages/devin: 125 pass, 0 fail
- bun scripts/check.mjs: ok
- HOME=$(mktemp -d) bun test: 2920 pass, 8 skip, 0 fail
- Broken by hand: with 1ed15ef's noCache line back, "v2Usage takes cached tokens out of the uncached count" goes red (NaN), green once restored.
Not tried: a real Devin chat in OpenCode 2 (no Devin account here).
2026-10-29 00:02:04 +08:00
yetone 2c30818458 devin 0.1.25: an anyOf beside a type, below a tool's root, goes to Gemini models as a merged branch or a oneOf (#458)
songyq26's Kimi Code Read tool (line_offset: anyOf of two integers) and
any Optional field made every devin/gemini-4-argon request 400 "There is
an issue with this request". The cause is a type beside the anyOf:
magpie's gateway (geminiToolTypes) writes the type the branches agree on
beside an untyped anyOf for a Gemini-named model, and Devin's Gemini
models refuse {type: T, anyOf: [...]} anywhere below the root. An untyped
anyOf, a root anyOf and a oneOf beside a type are taken, which is why the
reporter's matrix showed oneOf as OK.

geminiSchema now changes only an anyOf beside a type, at depth > 0: null
branches become nullable, one branch left of the same type (or none) is
merged into the schema, two or more go as a oneOf (into allOf if a oneOf
is already there). The recursion already reaches properties, items,
additionalProperties and anyOf/oneOf/allOf members, so each gets it.

Run:
- HOME=$(mktemp -d) bun test in packages/devin (on mote): 119 pass, 0 fail.
  bun scripts/check.mjs devin passes.
- Broken by hand: with index.mjs at origin/main, 9 new tests fail
  (8 fixtures incl. kimiRead from the reporter's literal line_offset, and
  the unit test); the 30 others pass.
- Real account, plugin fetch to gemini-4-argon: on 0.1.24, typed anyOf in
  properties / items / of objects and Kimi's line_offset with the
  gateway's type 400; untyped anyOf, root anyOf and typed oneOf 200. With
  this change all 17 probe shapes 200. A first try that turned every
  nested anyOf into a oneOf made {nullable, oneOf} with no type, which
  Devin refused, so untyped anyOf is left as it came.
Not tried: Claude / swe-2 models live (their path is unchanged);
other plugins (grok, qoder, workbuddy, kimi-work) have their own
cleaners for other vendors' rules and don't share geminiSchema.
2026-10-28 13:21:49 +08:00
yetone 6bd998a3f8 devin 0.1.24: the CLI sign-in's metadata is all strings (#396)
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.
2026-10-26 15:57:33 +08:00
A. S. 5068cc3219 devin: the CLI sign-in saves metadata.cli as a string, so OpenCode 1 keeps the account (#396)
Devin CLI's sign-in saved metadata.cli as the boolean true. OpenCode 1's auth
schema (src/auth Api: metadata Record<String, String>, v1.19.4) drops an
auth.json entry with a non-string metadata value. The account then
disappeared and requests went past the plugin's fetch to the placeholder
URL, which returned 404. The flag is now the string "true". live() only
checks that it is truthy, so entries saved with the boolean (magpie's
mover writes one) keep working in magpie. An OpenCode 1 entry already
saved with the boolean stays dropped until the account signs in again.

Reviewed at 151c72f:
- TMPDIR=<scratch> HOME=$(mktemp -d) bun test in packages/devin: 101 pass,
  0 fail. bun scripts/check.mjs devin passes.
- Probe: a sandbox XDG_DATA_HOME with a credentials.toml and a stubbed
  GetUserStatus fetch, then the "Devin CLI's sign-in" method's callback.
  On main, metadata is {email, plan, cli: true}, and cli is the one
  non-string value. With the PR, cli is "true" and every value is a
  string. live() returns the CLI's key in both cases.
- Checked that whoOfStatus gives plan, orgId and teamId as strings too.

Not tried: a real OpenCode 1 run (the schema was read from the v1.19.4
source).
2026-10-26 15:56:45 +08:00
yetoneandmameikagou 397a890df5 devin 0.1.23: a reply with only usage or metadata is refused before the stream starts, not passed on as an empty success (#297)
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>
2026-10-22 02:21:44 +08:00
SkylarHu a20c1b9d54 devin 0.1.22: organizations under one email are kept apart, each with its own quota (#296)
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).
2026-10-22 01:53:35 +08:00
yetone 82afc36ad3 devin: identity.test waits for macOS's first-run check of its fake CLI before the tests (#268)
Cause: the fake devin CLI is a shell script written when the file loads,
and macOS checks a new executable the first time it runs (com.apple.
provenance; ~0.3s on an idle machine, measured, the second run 0.01s).
The first test that runs the CLI ("when Devin can't tell, ...") paid that
check inside its 30s bound, and on a loaded machine the check took longer.
Its CLI then outlived it and wrote "auth status" into the one shared
cli.log, which the next tests read as their own call list.

Now beforeAll runs the fake once and waits for it to exit (the state, not
a duration; a 10-minute hook bound only so a broken exec can't hang the
run), so no test's time holds the check. Each test's runs go to a log of
its own (FAKE_LOG), so a run a test left behind can't land in the next
test's list.

Run on macOS arm64, bun 1.4.2:
- Injected: the fake slept 35s on its first run only (a slow first-run
  check). origin/main's test: red, "when Devin can't tell" timed out after
  30000ms, as in the issue. With this change: 11 pass, 0 fail (35.6s).
- Loaded: 6 parallel loops of 10 fresh `bun test
  packages/devin/identity.test.mjs` (each a new script, so each pays the
  check) at load average ~55: 0 of 60 runs failed; earlier 8 x 15: 0 of 120.
  (--rerun-each doesn't apply: the plugin's per-key caches outlive a rerun,
  red on origin/main too.)
- `HOME=$(mktemp -d) bun test` from the root: 1920 pass, 0 fail.
  `bun scripts/check.mjs`: ok.
Test-only, no version bump.
2026-10-21 07:39:22 +08:00
yetone e2c3a35447 devin 0.1.21: a request past 8 KiB goes gzipped, as the devin CLI sends it (#275)
Run on origin/main 4fd68ba: bun test in packages/devin 98 pass 0 fail;
bun scripts/check.mjs devin ok.
2026-10-21 00:21:58 +08:00
Jinx 4fd68ba046 devin: gzip a Connect request frame past 8 KiB, as the devin CLI does (#275, BGMYE)
Devin's nginx turns a GetChatMessage body past 10 MiB away with 413, so a
long turn failed. A Connect frame's message is now gzipped (flag 1,
Connect-Content-Encoding: gzip) past 8 KiB, as the devin CLI sends it.

Review commit da6c664 on top of 05d8a65, from the official client: the
devin CLI 3000.11.92, run in a sandbox through a logging proxy, sends 8,083
bytes plain and 8,333 gzipped, names the encoding only on a gzipped frame,
and sends no Connect-Accept-Encoding. The PR's 64 KiB threshold, header on
every request and Connect-Accept-Encoding were changed to match.

Run at da6c664fa917ee995a10a457a10fb94ad743e8ab: bun test in packages/devin,
98 pass 0 fail; bun scripts/check.mjs devin ok. The new tests are red on
main f906a22 (3 fail) and on 05d8a65 (3 fail). Live, owner's account,
swe-1-6: a 12 MiB plain frame gets 413, gzipped it passes nginx (the model
then refuses the size); complete() with a short and a >64 KiB message both
200.
2026-10-21 00:21:16 +08:00
yetone 29adee2688 devin 0.1.20: a tool's images go to Devin with its result, as the built-in sends them
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.
2026-10-16 18:10:59 +08:00
yetone aec06bdf96 devin 0.1.19: a chat's response_format is told in the instructions, as the built-in told it
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.
2026-10-16 17:32:23 +08:00
yetone 43d93b0cf9 devin 0.1.18: each model carries the price Devin lists for it, and SWE-2 is free again beside its Lightning variants (太陽と向日葵 on Discord)
太陽と向日葵 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).
2026-10-15 17:39:13 +08:00
yetone 157c7c0f88 devin 0.1.17: a tool whose schema has a list type, an array with no items, or properties or an enum with no type goes to Gemini models in a shape they take, not "There is an issue with this request" (7eleven on Discord)
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.
2026-10-15 11:08:07 +08:00
yetone cff78b3424 devin 0.1.16: SWE-2 is free, so a used-up day and week don't hold it
太陽と向日葵 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.
2026-10-14 17:03:50 +08:00
yetone 95f7b51737 devin 0.1.15: every account's model list is Devin's own for its token, so Gemini 4 Argon is listed on Windows and without the CLI (#115)
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.
2026-10-14 15:57:04 +08:00
yetone 1897d34ce3 devin 0.1.14: a week used up shows at 100% beside the day, and holds the account until the week's reset (面条 on magpie's Discord)
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.
2026-10-10 20:38:54 +08:00
yetone d33df7e21a devin 0.1.13: a call's id goes to the agent of [A-Za-z0-9_-] only, and back to Devin as Devin gave it (yetone/magpie#1304, StarMoonCity)
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.
2026-10-08 19:41:57 +08:00
Versun c70c9df24e devin 0.1.12: a temperature or top_p of 0 goes to Devin as 1e-6 — Devin answered every request carrying exactly 0 with 400 "an internal error occurred (trace ID …)" (in=0/out=0), on claude-opus-5-5, claude-sonnet-5-5 and swe-2 alike, streamed or not, so a caller that asks for greedy output (Hermes Agent's command approvals send temperature 0, max_tokens 16) failed on every devin/* model and, the 400 not being one magpie falls back on, never reached the next member of a group. 1e-6 is the smallest step above 0 and goes through, as do 0.1, 1 and 2; any other value is sent as it came, and none still as Devin's defaults (1, 0.95). sampling.test.mjs decodes field 8 of build()'s request: its first test fails with the fix taken out. HOME=$(mktemp -d) bun test packages/devin (45 pass, 0 fail) and bun scripts/check.mjs pass. Tried against a real Devin account through magpie: temperature 0 and top_p 0 → 400; 1e-6 → 200. (#50) 2026-10-08 17:58:41 +08:00
yetone 994d58077a devin 0.1.11: a turn's parallel tool calls split over two consecutive assistant messages keep their results (yetone/magpie#1275)
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.
2026-10-08 16:54:48 +08:00
yetone fbee8a0abf devin 0.1.10: a tool's root union whose branches are unions themselves keeps their fields, so a model can create a Codex automation (yetone/magpie#1271)
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.
2026-10-08 16:51:46 +08:00
yetone c9b811d288 devin 0.1.9: a tool whose parameters have anyOf, oneOf or allOf at the root goes to Devin as a plain object (yetone/magpie#1196, iron-water) — Devin's Claude models answered every request offering one with 502 "There is an issue with this request, please try a different model" (in=0/out=0), so Codex desktop, whose codex_app automation_update has a root oneOf, hung on devin/claude-opus-5-5 while swe-2 and gpt-6-1-sol were fine. build() now folds the schema as magpie's built-in folds it for Anthropic (provider.ObjectRoot, #646): allOf's branches are all merged, properties and required alike; of anyOf's and oneOf's object branches the properties are merged, a field each requires stays required, the other branches go; local $refs into $defs/definitions are followed. A schema with no root combinator is sent as it came, and the caller's own is not changed. schema.test.mjs builds from the issue's literal parameters: its three build tests fail with the fold taken out of build() (the oneOf/anyOf/allOf arrives at Devin). HOME=$(mktemp -d) bun test packages/devin (37 pass, 0 fail) and bun scripts/check.mjs devin pass. Not tried against a real Devin account. 2026-10-08 05:19:57 +08:00
yetone 3884236b21 devin tests: the two "without the CLI" images tests take the devin CLI out of reach themselves — they relied on no devin being on PATH, so on a machine with the CLI installed (~/.local/bin on PATH) provider.models took the CLI's path, returned full runtime models and both failed; CI has no CLI and stayed green. They now point PATH at an empty temp dir (removed after) and say so if /usr/local/bin or /opt/homebrew/bin holds the CLI. Test-only, no version bump; HOME=$(mktemp -d) bun test (676 pass, 0 fail) and check.mjs devin pass. 2026-10-07 01:36:01 +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 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 8f25b63718 publish from GitHub Actions with npm's trusted publishing, no one-time password [skip ci]
.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.
2026-10-03 00:00:23 +08:00
yetone 09053e36d3 devin 0.1.6: an assistant reply goes to Devin with every tool call it made (#416 on yetone/magpie: swe-2 always answered "capacity issues" on the plugin, never on the built-in) — build() let the pending list share the reply's own calls array, so answering a call took it off the reply too, and Devin got tool results with no call that asked for them from the first tool round on. pending is now a copy, as the built-in's buildDevin keeps it; with tool history the request decodes the same as the built-in's. request.test.mjs fails against 0.1.5. 2026-10-01 20:34:49 +08:00
yetone 01aee5da28 all: a usage read says what it means for the sign-in, and a renewal clears the mark whatever follows, as the built-ins did (要保证插件跟内置的所有逻辑都要一模一样) — auth.usage returns signIn on every path: expired where the built-in's quota read marked the account (Zed's /users/me 401, Factory's and MiMo's refused renewals, Qoder's refused job refresh), renewed after a renewal, which took the mark off, kept everywhere else, so magpie no longer guesses from the words 'sign in again' (Kiro's, Devin's and ZCode's usage errors marked accounts their built-ins never did) nor clears on a clean read. A request after a renewal says renewed on any status; one without says kept, as the built-ins cleared only on renewal. Kiro, Cursor, Devin, Command Code, WorkBuddy, Grok and ZCode, whose built-ins never marked an account, say kept on every answer. New tests fail against 85d7dd0's index.mjs. 2026-10-01 04:53:29 +08:00
yetone 85d7dd0d0a all: each plugin fails with its built-in's status and marks the sign-in as it did, through X-Magpie-Sign-In (要保证插件跟内置的所有逻辑都要一模一样) — Factory's and MiMo's refused renewals are the built-ins' 502 marked expired, not 401s; Qoder's vendor 403 is the built-in's 401 kept, its model list's failure a 400, its job refresh refused marked expired; Zed's retried 401 is a 401 kept, not a 403; Kiro's unreachable refresh a 401 kept; Cursor's expired trial a 401 kept; a vendor 401 WorkBuddy, Grok, Devin, Command Code and ZCode passed on no longer marks the account, as their built-ins never did, and Grok and MiMo no longer retry what their built-ins sent once. Messages take the built-ins' words. New tests fail against the previous index.mjs. 2026-10-01 04:47:03 +08:00
yetone e39f4f4dc0 devin 0.1.4: errors no longer start with "Devin: ", which magpie adds (it read "Devin: Devin: usage limit reached: …"), a stream error before anything included; an error Devin gives no words for is worded as Go's status text ("Payment Required") as the built-in's devinFailure does, where it read "HTTP 402"; an empty reply is the built-in's 502 "the reply broke off: EOF". Statuses were already the built-in's (unauthenticated 401, resource_exhausted/quota/rate limit 429, too long 400, invalid_argument 400, unavailable 503); errors.test.mjs checks them 2026-10-01 03:43:41 +08:00
yetone d8739bcdbc devin 0.1.3: the card's quota windows are "1 day" and "7 days", shown only when Devin says what is left of them (one left out is no longer taken for used up); usage no longer overwrites the row's plan ("Devin Pro", as devin auth status names it) with planName's bare "Pro"; a refused key says "Devin's sign-in has expired — sign in again"; the efforts none and minimal go as given; a variant the user picked stays, as magpie's devinCollapse keeps it; only a model models.dev says takes images gets image input 2026-10-01 03:03:01 +08:00
yetone c8f4d448df Parity with magpie's built-ins: a failed sign-in says why, CLI-backed Command Code and Devin accounts follow the CLI's key, Factory's refused renewal is a 401 in the caller's API shape
- 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
2026-10-01 00:55:50 +08:00
yetone 7d641b86c4 devin 0.1.1: usage shows as magpie's built-in did — plan, period, windows and what they count, balancedevin 2026-09-30 23:03:08 +08:00
yetone 92d1af8df6 devin: Devin — the CLI's browser sign-in or its existing one, GetChatMessage over protobuf with tool descriptions moved into the prompt; tried with real requests 2026-09-30 17:10:33 +08:00