175dfd25552d769905bbfd57ecd57036eaa37910
25
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0135b7b0ea |
agy-cli 0.1.32: the first model list after warming has agy's Claude and GPT models (#1064)
On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
|
||
|
|
34786edadb |
qoder 0.2.65: two tool calls at one index with their own ids are two (#930)
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>
|
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
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. |
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
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 |
||
|
|
3920b745d9 |
zed 0.1.18: name each request's thread and prompt, as Zed's editor does (#731)
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. |
||
|
|
aa44cc3edb |
zed 0.1.17: an Anthropic thinking.display Zed has no variant for is left out (#708)
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. |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
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. |
||
|
|
48d0cecaf8 |
zed 0.1.15: only compact_20260112 reaches Zed in context_management (nllay, #636)
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). |
||
|
|
3618bf9f22 |
zed 0.1.14: a Gemini model's effort variants are keyed lowercase, and its thinking level reaches Zed uppercase (#215)
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
|
||
|
|
f4e2ac36fe |
zed 0.1.13: a Gemini request's tool-calling mode goes to Zed's cloud in lowercase (magpie#4657)
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> |
||
|
|
3e940bc81b |
zed 0.1.12: a string message content goes to Zed's cloud as a text block
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.
|
||
|
|
3d355d349d |
zed 0.1.11: a {role: "system"} message inside an Anthropic request reaches Zed as user text where it was said, not as a role Zed refuses
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
|
||
|
|
5a836745fb |
zed 0.1.10: the organization with a plan is the one asked under, not a default without one, and a 402 for the saved one moves the account (#232, ReneXiong)
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
|
||
|
|
779388ba04 |
zed 0.1.9: a signed-in account whose model list was never read says why, instead of showing the six pre-sign-in models as its own (#229, ReneXiong)
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. |
||
|
|
47a8bb40d2 |
zed 0.1.8: a free account's card says "No plan", as the built-in's did, and the README says what the plugin and magpie now do
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.
|
||
|
|
e105f567db |
zed 0.1.7: a streamed xAI (chat) reply Zed breaks off after it said something ends cut short, with a note, instead of failing the turn (#91)
This is the sibling of zen-free 0.1.4 (
|
||
|
|
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. |
||
|
|
7b072d798b | zed 0.1.6: a model token Zed refuses while listing the models marks the account, as the built-in's zedLapse did there — the models hook throws with signIn: expired on the refusal (magpie 78c3229 reads it), and falls back to the listed models on any other failure as before. models.test.mjs fails without the change. | ||
|
|
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. | ||
|
|
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. | ||
|
|
53e0db6648 | zed 0.1.4: a streamed reply is held until it says something, as the built-in's relayStatus holds it, and a failure before that is answered with its status rather than a 200 carrying it — Zed's failed status keeps the status its code names (upstream_http_401 a 401, http_403 a 403, billing a 402, where magpie read the old stream's chat and Responses errors as 502s), the provider's own error event is a 502 with its message, a reply ended with nothing said is a 502 "Zed ended without an answer" and one cut short a 502; a whole reply carrying the provider's error is that error (it was a 200 with nothing in it), and a code outside 400–599 is a 502. errors.test.mjs fails without the change. | ||
|
|
3d3f3b7bf1 | zed 0.1.3: an account reply that can't be read is the card's error, as zed.FetchMe says it (Zed: an unreadable account: <encoding/json's words>), not a plan-less card; a free account reads Free, as the built-in's row names it (zed.PlanName); a model token refused right after it was minted is a 403, not a 401 magpie would take for a lapsed sign-in; errors no longer start with "Zed: ", which magpie adds; a model Zed gives no limits has none made up (was 200000/32000) | ||
|
|
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
|
||
|
|
bd9c0780cc | zed 0.1.1: usage shows as magpie's built-in did — plan, period, windows and what they count, balancezed | ||
|
|
620cf1329f | zed: Zed — browser sign-in with Zed's key pair, model tokens minted as Zed does, Anthropic/OpenAI/Google/xAI requests wrapped for Zed's /completions |