Qoder Ultimate sent two native tool calls at tool_calls[].index 0, each
with its own id and name. events() kept one call per upstream index, so
the second call's arguments were sent as more of the first:
{"key":"A"}{"key":"B"}, which the client refused as unparseable JSON.
A fragment with a non-empty id that differs from the open call's id at
that index now starts a new call with an output index of its own. A
fragment with no id, or the open call's id, still goes on with the open
call (OpenAI's argument fragments, and relays that repeat the id). A call
pushed aside before it got a name still counts as nameless (#579).
After two ids at one index, id-less fragments go to the newer call; the
report suggested failing there instead, but OpenAI streams each call's
fragments right after its start, so the newest is the one open.
Siblings with the same index-keyed fold, fixed the same way:
- zed 0.1.19: chatWhole (a streamed chat reply folded for stream:false).
- codearts 0.3.7: completionFromChunks.
- zen-free 0.1.27: stream.mjs chatAccumulator, and tool-response.mjs's
chat buffer, which gives each call its own index when two collided.
- page-chat 0.1.13: lib/server.mjs folds through toolCallFolder.
Looked at and left: codearts' stream name restorer and kimi-desktop's
Agent hold pass fragments through unchanged and join no arguments;
zed's streaming path passes Zed's chunks through, and magpie's gateway
already starts a new call on a new id (internal/gateway/chat.go).
Run (WSL magpie-desktop, bun 1.4.2, node 22):
- pedh's repro.mjs with his fixture: [0,0] gave one tool event plus an
args event on 0.2.64; now two tool events (index 0 and 1), each with
valid JSON. [0,1] unchanged.
- HOME=$(mktemp -d) bun test packages/qoder packages/zed
packages/codearts packages/zen-free packages/chat: 987 pass, 0 fail,
1 skip (the epub reader's, as before). bun scripts/check.mjs: every
package and registry.json ok.
Broken by hand:
- qoder back to index-only: 3 of the new tests fail (two ids, id-less
after a second id, streaming adapter).
- qoder starting a call on any fragment without the open id: 8 fail,
the id-less continuation test among them.
- qoder treating any id as new: the repeated-id test fails.
- zed, codearts, zen-free (both) on main's code and chat keyed by index
only: each new collision test fails (5 of 5).
Not tried: a real Qoder account (no Qoder Ultimate here), real Zed,
CodeArts or OpenCode Zen replies with a collision, and the chat page
in a browser.
Reported-by: pedh <pedh@users.noreply.github.com>
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.
Zed's editor sends CompletionBody with thread_id (the agent thread's id,
a UUID made once per thread) and prompt_id (a new UUID per message the
user sends, kept through the tool calls answering it): zed
crates/cloud_llm_client/src/cloud_llm_client.rs CompletionBody,
crates/language_models_cloud (the Google path sends both),
crates/agent/src/thread.rs advance_prompt_id. The plugin, and the
retired built-in before it, sent neither, so to Zed's cloud every
request was a thread of its own. Yezike-yyy's Gemini 4 Argon
conversation read cache_read 0 on 11 requests of 180k-230k input tokens,
where Zed's docs say Argon bills implicit cache hits.
- a chat.headers hook names a Zed request's session in
x-magpie-zed-session; the loader's fetch now keeps a Request's
headers, and complete() reads the header and sends it no further.
- thread_id is a UUID hashed (per-process salt) from the account and the
session, else the first user message; prompt_id from the thread and
the count of user messages with text (tool results don't count), on
all four APIs (Messages, Responses, chat completions, Gemini).
- usage mapping was checked and is right: magpie reads Gemini's
cachedContentTokenCount through the plugin's passthrough.
Run (mote, bun 1.4.2): packages/zed `bun test` 78 pass 0 fail;
`bun run check` at the repo root, exit 0.
Broken by hand: the new thread-id.test.mjs against the old index.mjs,
7 of 7 red; the loader dropping a Request's headers, its test red;
tool-result turns counted as prompts, the Gemini test red.
Not tried: no Zed account, so no real request; whether Zed's cloud uses
thread_id or prompt_id for Gemini's implicit cache is not known (its
server is closed source). The reporter is asked to retest.
gogoing1024 (#708): claude-sonnet-5-5 from Claude Code at max effort
was answered 400 "Zed: failed to parse Anthropic request: unknown
variant `updates`, expected `omitted` or `summarized`". Claude Code
asks its newest models for thinking.display "updates"; Zed's cloud
parses display into an enum with only omitted and summarized.
providerRequest now sends "highlights" as summarized (the thinking
still shown) and leaves any other value beyond omitted/summarized out,
the same rule magpie's gateway applies to relays (withDisplay in
internal/gateway/anthropic_shapes.go). Adaptive and budgeted thinking
alike; summarized and omitted go as written.
Run at this head (mote, via mote-run):
- bun test in packages/zed: 71 pass, 0 fail (11 files)
- bun scripts/check.mjs: exit 0
Broken by hand: thinking-display.test.mjs against the old index.mjs,
3 of 5 red (updates, highlights, budgeted updates).
Not tried: a real Zed account; the fix is from the reporter's 400
text and the request shape Claude Code writes.
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.
Zed's cloud parses an Anthropic request's context_management into its own
enum (zed crates/anthropic), which has one variant, compact_20260112, and
needs edits. Claude Code's clear_thinking_20251015 was answered 400
"unknown variant ..., expected `compact_20260112`". nllay's patch dropped
that edit. The follow-up keeps only compaction edits, since any other
type (clear_tool_uses_20250919) fails the same way. context_management is
left out when no edit remains, and a non-list edits or a null entry no
longer throws. zed 0.1.15.
Run at the reviewed head 79aab88 on mote (Bun 1.4.2), packages/zed:
bun test, 66 pass 0 fail. The new context-edits.test.mjs is red without
the change: 2 pass 3 fail with 74caff5's index.mjs, 1 pass 4 fail with
main's.
Not tried: a real Zed account (nllay reports a 200 through magpie for the
clear-thinking case).
Zed's cloud parses a Google request with its own serde enums (zed
crates/google_ai): ThinkingLevel is rename_all UPPERCASE (MINIMAL, LOW,
MEDIUM, HIGH) and FunctionCallingMode rename_all lowercase (auto, any,
none). A thinking budget reached it as thinkingLevel "low" and was
answered 400 "failed to parse Google AI request: unknown variant `low`,
expected one of `MINIMAL`, `LOW`, `MEDIUM`, `HIGH`" (iron-water, #215).
- The gemini wire in providerRequest() now goes through geminiEnums(),
from ump45nose's #587: the thinking level is uppercased (an empty one
left out) and the tool-calling mode lowercased, as 0.1.13 already did,
with VALIDATED, which Zed has no variant for, asked as auto.
- Zed's /models now lists a Gemini model's supported_effort_levels
uppercase (LOW/MEDIUM/HIGH; Yezike-yyy's Student-plan list on #215), so
the variants were keyed LOW and carried thinkingLevel "LOW". magpie's pi
profile, which maps efforts by key, matched none of them, and
@ai-sdk/google (thinkingLevel z.enum minimal/low/medium/high) refuses
an uppercase level. effortsOf() now lowercases the values whatever case
/models writes, once each, so a variant keeps the AI SDK's lowercase
spelling (the owner's review on #587) and only the wire is uppercase.
This covers every vendor's efforts, not only Google's.
- _internal exports model() so the test checks provider.models' variants.
Tests: gemini-enums.test.mjs builds its model list from the
supported_effort_levels Yezike-yyy pasted on #215, byte for byte, and its
fake /completions refuses both enums with Zed's error text.
Run on mote at f4e2ac3 plus this change: packages/zed `bun test` 61 pass,
0 fail; root `HOME=$(mktemp -d) bun test` 4545 pass, 0 fail; `bun
scripts/check.mjs` ok. (A root run with a HOME outside tmpdir gives the
same 20 devin/isolated-home reds on origin/main as with this change.)
Broken by hand:
- origin/main's index.mjs under the new test: 7 of 7 fail;
- effortsOf without the lowercase: 4 fail;
- the wire level not uppercased: 2 fail;
- VALIDATED not mapped to auto: 1 fail.
Not tried: a live request to cloud.zed.dev and OpenCode with the real
@ai-sdk/google (no Zed account here). Yezike-yyy reports the same two
changes, patched into 0.1.13, answered 200 for low/medium/high on
zed/gemini-4-argon through magpie on Windows with pi.
Thanks to Yezike-yyy for the uppercase /models finding and its check
through pi.
Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com>
Zed's cloud reads toolConfig.functionCallingConfig.mode with lowercase
variants only (auto, any, none). The Gemini API's proto enums, which the
AI SDK's @ai-sdk/google and magpie's Code Assist envelope both write
(AUTO, ANY, NONE), were answered 400 "failed to parse Google AI request:
unknown variant `AUTO`, expected one of `auto`, `any`, `none`", so every
Gemini turn that declared a tool failed while plain chat and a model test
worked (atticuskk on magpie#4657). providerRequest's gemini case now
lowercases the mode; nothing else in the request moves.
ggbdpq (gua2100) found the cause and proposed the fix on magpie's side
(a body fitter for the zed account). It is made here instead, where the
request is fitted to Zed's cloud: the plugin is what knows Zed's wire, and
OpenCode users of this plugin, whose @ai-sdk/google writes AUTO too, are
covered the same way.
Run (mote): cd packages/zed && bun test: 54 pass, 0 fail;
bun scripts/check.mjs zed: ok. Broken by hand: the lowercase line off ->
gemini-tool-mode.test.mjs red (3 fail, 400 for AUTO, ANY, NONE).
Not tried: a live request to cloud.zed.dev (no Zed account here).
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
Zed's cloud parses an Anthropic body's message content as blocks only, and
answers a string, which Anthropic's own API takes, with 400 "failed to parse
Anthropic request: invalid type: string \"hi\", expected a sequence".
magpie's Test models sends {"role":"user","content":"hi"}, so every Claude
model failed its test in Zed's provider page (Been on Discord, 0.1.11). The
anthropic wire now turns each turn's string content into one text block; a
top-level system string is left as sent (Zed takes it either way).
Not here: Gemini's "missing field contents" in the same test is magpie
sending a non-Gemini body to a plugin's @ai-sdk/google model; fixed in
magpie.
Run (mote-run, bun 1.4.2): packages/zed bun test, 49 pass 0 fail.
Broken by hand: with index.mjs reverted, string-content.test.mjs is 0
pass 2 fail. system-role.test.mjs's effort test now expects blocks.
Roy on Discord, Claude Code through magpie on a Zed subscription:
"API Error: 400 Zed: failed to parse Anthropic request: unknown variant
system, expected user or assistant".
Cause: Claude Code (2.1.288 on) writes {role: "system"} messages inside
messages[]: an empty one carrying a turn's effort as output_config, and
(2.1.296) one after tool results with its hooks' notices, <total_tokens>
and what the user typed while a tool ran. Anthropic's API takes them in
place. magpie's gateway passes them on as written (anthropic_shapes.go
mends only after a refusal matching `messages.N.role`, which Zed's serde
message doesn't), and the plugin's providerRequest "anthropic" case
forwarded them to Zed, whose Anthropic Role is user | assistant only.
Fix: providerRequest's anthropic case runs withoutSystemTurns. Each
system message's text goes, as text blocks (cache_control kept), into a
user turn at the same place: appended to the user message before it;
else after the leading tool_result blocks of the user message after it
(tool results must stay first); else a user message of its own. One with
no text (an effort alone) is left out; the request's top-level
output_config still carries the effort.
Why in place and not folded into the top-level system: the prompt cache's
prefix is tools, then system, then messages. Text appended to system on
each turn that has a notice changes the prefix ahead of every message, so
the whole conversation misses the cache from then on, while merging in
place changes only bytes at the conversation's tail, which the next
request repeats unchanged (the transform is deterministic per message).
It also keeps the meaning Anthropic's API gives the message: said at that
point in the turn, not standing instructions for the whole conversation.
magpie's own withSystemOnTop folds to the top for Command Code, which
refuses the role by name; that path never fires for Zed's wording.
Siblings, not changed: responses (OpenAI Responses) and chat (xAI Chat
Completions) both have system/developer roles in their own message
schemas, so a system message there is not this error; gemini has no
system role in contents (the AI SDK sends systemInstruction). None was
tried against Zed's cloud with a mid-conversation system message, and
there is no report of one.
Tests (system-role.test.mjs, built from Claude Code's shapes and
checking the provider_request the plugin hands Zed's /completions):
a hook notice after tool results joins their user turn after the
results and system stays as sent; an empty effort-only system message
is left out; system text before a tool-result user turn goes after the
results, and one after an assistant turn becomes a user turn. With
index.mjs reverted to 43ffb46 all 3 fail; with the fix all pass.
Run at 43ffb46 + this change: `HOME=$(mktemp -d) bun test` in
packages/zed: 47 pass, 0 fail. `bun scripts/check.mjs`: ok (exit 0).
Not tried: a real Zed account (none in a sandbox HOME here); the shape
Zed accepts is Anthropic's user/assistant messages, as the plugin
already sends for every request without system messages.
ReneXiong's account has two organizations: the personal one on
zed_student and a non-personal default with no plan. orgOf() always took
default_organization_id, minted the model token for it, and /models and
/completions answered 402 "Organization does not have an active
subscription". planOf() fell back to the account's plan_v3, so the card
said Student over an organization with none.
What Zed's editor does (zed-industries/zed 56934ec): user.rs
update_authenticated_user starts in the default organization, else the
first; the title bar's organization menu calls set_current_organization,
which the LLM token's auth context (language_models cloud.rs
ClientTokenProvider) follows; plan() is plans_by_organization[current],
none when it has no entry (current_organization_has_no_active_subscription
treats a missing entry as no subscription; an unknown plan as Free). The
plugin has no switcher, so it now picks as a user switching would:
- the organization the sign-in saved, while it still has a plan that
calls models (any but Free) and models aren't turned off for it;
- else the default, if it has one; else the personal one with one; else
any with one;
- none with one: what Zed picks (saved, else default, else first).
planOf names the picked organization's own plan ("" without an entry);
only a reply with no organizations falls back to plan_v3.
A sign-in saved before this under the unsubscribed default is moved on
the first 402 (llm_tokens, /models, /completions) or empty list: the
account is read again, moved if another organization has a plan, the
move saved through client.auth.set (and kept in memory in case the save
doesn't land), and the request asked once more. The usage hook re-picks
the same way. The model-token cache and the model list are keyed by
organization now, so a move mints and lists anew. There is no explicit
organization choice in the plugin or in magpie to respect; the saved
organization is the sticky one.
Run (bun 1.4.2, macOS, worktree at origin/main 8cdf2d2 + this):
- packages/zed/org.test.mjs (new, no network: fetch stubbed): 11 pass.
With the old index.mjs and the new tests: 10 fail, 1 pass (the
no-plan fallback the old code also did).
- HOME=$(mktemp -d) bun test (whole repo): 1802 pass, 0 fail.
- bun scripts/check.mjs: every package ok.
Not tried against a real Zed account; the reporter's /users/me shape is
from the issue's sanitized read.
ReneXiong's Zed Student account (an organization without an active
subscription) showed "zed (Zed, 6 models)" with no error: the six
models the config hook declares before sign-in, with their hard-coded
limits. provider.models handed those back whenever /models failed and no
list had been read for the account. The likely path for this account is
a 200 whose models are all disabled: parseModels throws "Zed lists no
models for this account", the hook returned the declared list, and
magpie's host, seeing the last fetch answer 200, didn't mark the list as
fallen back, so nothing said it wasn't the account's.
Now, with no list ever read for the account, the hook throws the reason
(Zed's own "Zed: ... (status)", "Zed lists no models for this account
...", or "Zed: this account's models couldn't be read: <cause>"). magpie's
host takes a thrown models error as fellBack with that message as
listError, and the editor and `magpie providers` show "couldn't list its
models: <reason>". A list read before is still kept on a later failure,
as it was. A 401 for the model token still marks the sign-in expired.
Tests (bun 1.4.2, packages/zed): models.test.mjs 7 pass. With the old
index.mjs and the new tests, 3 fail: "the list refused with the token
just minted", "Zed down before any list", "a 200 listing nothing
callable" (each got the declared models back). Whole package: 33 pass,
0 fail.
Siblings: minimax, qoder, trae, raccoon, workbuddy and opendesign also
return provider.models on a failed list. Each of those checks a
response status magpie's host sees, so a failed read is marked as
fallen back with its HTTP status; not changed here. Not tried against a
real Zed account.
What changed:
- usage: magpie's built-in zedLoginQuota showed a free account's card
(plan_v3 zed_free, or none) as "No plan", unless an overdue invoice was
its error, while the account row kept zed.PlanName's "Free". magpie's
card knows "No plan" (app.js noPlan) and translates it. The plugin's card
said "Free". It now says "No plan" in the same case; the sign-in still
saves planName "Free", and an overdue free card keeps "Free" with its
error, as the built-in's switch did.
- README: "Not included" listed the plan display, which the usage hook has
shown since 0.1.x, and several accounts and the web-search stand-in,
which magpie gives a plugin provider itself (plugin_accounts.go, the
gateway's generic searchReply path). It is now a "Usage" section and an
"In magpie, not the plugin" section.
What was run:
- usage.test.mjs: the free-account test (zed_free, "" and an overdue free
account) fails on 0.1.7's index.mjs ("Free" for "No plan"), passes now.
- packages/zed under a scratch HOME: 31 pass, 0 fail (4 files).
- bun scripts/check.mjs zed passes.
Not tried: a real free Zed account.
This is the sibling of zen-free 0.1.4 (6a5dd01). magpie's gateway goes on
with an Anthropic or Responses reply that was cut short, but not with a
Chat Completions one. For those, the error frame after a 200 threw away
the reply the client had already been shown.
Now, when a chat stream loses Zed's stream_ended, the plugin looks at what
the choices already said:
- If no choice is still open, only [DONE] is added.
- If a choice said text or reasoning and has no tool call half written,
each open choice gets the note and a `stop`, then [DONE].
- If nothing was said, or a tool call is still unfinished, it fails as
before.
Anthropic, Responses and non-streamed replies are unchanged.
Run: HOME=$(mktemp -d) bun test packages/zed gave 31 pass. The whole
repo's bun test gave 1129 pass, 0 fail. bun scripts/check.mjs passed. On
the old index.mjs, the 2 new tests that cover the cut-short endings fail.
With the tool-call guard removed by hand, the tool-call test fails.
Not tried: a real Zed account (there is none to test with). The
upstream's cut can't be triggered.
.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