6 Commits
Author SHA1 Message Date
yetone 191d94bf6e devin 0.1.41: a Gemini reply goes back with its thought signature, as the CLI sends it
Reported on X (@liuzhengdong99, magpie 0.1.4146): in DSH, Devin's Gemini 4
Hydrogen often fails with "an empty reply ... (502)" or hangs; SWE-2 works.

Diffing the plugin's GetChatMessage against the official devin CLI's
(captured through a proxy, same account, gemini-4-hydrogen-medium, a tool
turn): Devin streams Hydrogen's thought signature (field 10, type
"gemini" in 21) and no visible thinking. The CLI sends it back on the
assistant prompt that carries the call: signature (12), signature_type
"gemini" (18) and the model that wrote it (22). The plugin dropped Gemini
signatures, on the chat wire and the Messages wire, so every later turn
went back to Gemini without them. Google documents thought signatures as
required for Gemini 3-class function calling.

Neither a chat completion nor a Messages tool_use carries a signature, so
the plugin keeps each Gemini reply's signature in memory by its call ids
(or by its words, for a reply with no call), up to 4096, and puts it back
on the matching assistant prompt with field 22. Other models are
unchanged; an unknown call, or one after a restart, goes back unsigned as
before.

Run:
- gemini-thought.test.mjs (7 tests, fixture = a real Hydrogen tool reply
  captured from the CLI, testdata/gemini-tool-reply.bin, no credentials):
  7/7 on mica. Broken by hand: against origin/main's index.mjs the 5
  signature tests fail (Received: undefined); the 2 "goes back unsigned"
  tests pass on both.
- Whole plugins suite on mica, HOME=$(mktemp -d) bun test, as CI:
  8796 pass, 0 fail (8816 tests, 615 files); bun scripts/check.mjs ok.
  packages/devin alone: 220/220.
- Real account (sandbox HOME, plugin through a chat-completions shim):
  a 4-step tool loop on the new code signed every assistant prompt
  (1/1 .. 4/4), all 200, right answer. dsh headless (sandbox HOME) on
  Hydrogen through the shim: a JSON-parser coding task on old and new
  code, both finished with tests passing, every request 200.

Not reproduced: on the old code, 127 Hydrogen requests through dsh
(up to 170 messages, a 434KB request) all answered 200, with no empty
reply. So this restores what the official client sends; it is not proven
to be the reporter's cause. The "hang" is likely Hydrogen's hidden
thinking: the plugin waits for the first real content and Hydrogen
streams no thinking text. No retry was added.
2026-11-14 17:01:05 +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
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 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 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 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