2b56b3bc4f4abbcc68a7a1c3dc350605fa8a7352
504
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2b56b3bc4f |
zcode: name the conversation in x-session-id as a bare UUID, so BigModel's prompt cache hits (#388)
ZCode's client names every request's conversation in x-session-id: a bare UUID, the same on each turn (3.14.3 xst/Tst). BigModel keeps a prompt's cache for the requests that name the same session. The plugin sent none, so a long conversation seldom hit the cache (#387). Every zcode request, on the Start Plan and on Coding Plan or team seats alike, now carries it: - the agent's session (chat.headers' sessionID, which magpie fills) goes as it is when it is a UUID, lower-cased; - any other id (magpie-<hex>, ses_..., sess_...) goes as a stable UUID made from its sha256; - with no session, a UUID made from the device. metadata.user_id's session_id is the same UUID, in dress() and marked(). Reviewed at 48013c0, which addresses all four points of the earlier review (UUID shape, session_id in user_id, rebase onto 0.1.30, no "Closes #387"): - TMPDIR=<scratch> HOME=$(mktemp -d) bun test in packages/zcode: 125 pass, 0 fail. bun scripts/check.mjs zcode passes. Merges cleanly onto main. - With main's index.mjs and the PR's tests: 17 fail (all 7 new session tests, plus the start, userid and dual assertions on the header). - Probe through the plugin's chat.headers and loader fetch, as magpie's host calls them (host.js passes sessionID and sets out.headers before the fetch): magpie-<hex> twice gives the same UUID in the header and in user_id.session_id, and ses_other gives a different UUID. None contains magpie, ses_ or sess_. Not tried: a real BigModel request (the author's hit-rate numbers are the evidence: 3/12 before, 24/24 after through magpie). |
||
|
|
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. |
||
|
|
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).
|
||
|
|
07e643018e |
minimax 0.1.6: the credits show how much of them is used, from MiniMax's credit details (#393)
moxuanchen's card showed MiniMax's credits as a bare balance ("1200
credits"), with no share or bar. The membership answer has only what is
left. MiniMax's own web client (agent.minimaxi.com, prod-web-sh-0.1.230)
lists every batch in Settings → Usage → Credit details (积分明细): GET
/minimax-cloud/api/v1/credit/details with page_number, page_size 20 and
include_expired, answering { details, total_count }; each batch has
credit_type 1 purchased / 2 check-in, granted/consumed/remaining_amount as
decimal strings (commas allowed, a remaining below 0 read as 0) and
expire_at_ms. That is the reporter's endpoint, checked in the client's
own bundle (the npm CLI @minimax-ai/code 0.6.12 doesn't have it).
usage now reads every page of it (signed, to the account host, as the
check-in's minimax-cloud calls go) and adds a Credits window of the
batches not yet expired: used = granted - remaining, amount/limit/unit
"credits", and runsOutAt/runsOut for the soonest batch with credits left.
Beside an M Plan it is aside. A ledger that can't be read whole (an error,
a list shorter than total_count, an amount that isn't one) adds no window
and leaves the balance as before: a part of it would tell a wrong share.
Run: bun test in packages/minimax (nonet, fake hosts): 62 pass 0 fail. On
the old index.mjs the three new tests fail. bun scripts/check.mjs:
minimax ok.
Not tried: a real MiniMax account (no vendor credentials used), so
whether the account host answers this path signed as the check-in is
signed is not seen; if it refuses, the card is as it was.
|
||
|
|
634a865346 |
kiro 0.1.17: credits tell their count, so magpie's "Left" shows what is left (#408)
Fidelxyz switched magpie's usage to "Left" and Kiro's credits still read
as used ("12.5 / 50"). magpie turns a window round only from its count
(amount, limit, unit; quotaCount in app.js): display alone is the
vendor's text, shown as it is. usageOf now gives each Credits and Free
trial window amount = currentUsageWithPrecision, limit =
usageLimitWithPrecision and unit "credits"; display is unchanged.
Run: HOME=$(mktemp -d) bun test in packages/kiro: 57 pass 0 fail. On the
old index.mjs the two usage tests fail (amount/limit/unit missing).
bun scripts/check.mjs: kiro ok.
Not tried: a real Kiro account (no vendor credentials used); the window
shape is the one workbuddy's Credits already shows "left" with.
|
||
|
|
f32736f015 |
zen-free 0.1.16: requests go with OpenCode 2.0.25's User-Agent, since Zen refuses the 1.19.0 one 0.1.15 sent
杨梅 (yangmei_61422) on magpie's Discord, 10-26: Zen Free from Kimi
Code/Work fails again ("反代失败") a day after 0.1.15.
Cause, found against opencode.ai from this machine on 2026-10-26: Zen's
free tier now answers 429 FreeUsageLimitError ("Free usage limit
reached. Free models work in OpenCode") to the exact User-Agent 0.1.6 to
0.1.15 sent, OpenCode 1.19.0's
`opencode/1.19.0 ai-sdk/provider-utils/4.0.23 runtime/bun/1.3.14`,
whatever the body says. One request (short system prompt + the <env>
block + the five core tools, our other headers), only the UA changed:
that exact string 429; with provider-utils 4.0.24, bun 1.3.15, opencode
1.19.1, the ai-sdk or runtime part dropped, or an "x " prefix: 200;
"opencode/latest/2.0.25/cli" (what OpenCode 2.0.25 sends,
`opencode/${channel}/${version}/${name}` in its binary): 200. So it is
that one string, the plugin's fingerprint, not a version floor. The env
block is still needed: 2.0.25's UA without it is 429. Path
(/inference/v1), project "global", x-opencode-request and the
x-session-* pair made no difference either way.
Fix: userAgent() is OpenCode 2.0.25's on every protocol, and the header
set is the one captured from 2.0.25 on 10-25: its session id also under
x-session-affinity and x-session-id, no x-opencode-request. A caller's
own session headers still never go on.
Run:
- Real, through the plugin's loader.fetch: a Kimi Code request (its
system.md rendered, Shell/ReadFile/Glob/Grep/WriteFile/StrReplaceFile/
SetTodoList with Kimi's own descriptions, UA KimiCLI/1.0) and a plain
one. At origin/main (0.1.15): deepseek-v4.1-flash-free 429
FreeUsageLimitError for both. With this change: deepseek-v4.1-flash-
free, glm-5.3-flash-free and big-pickle 200 for both.
- tools-smoke.mjs, real: big-pickle and mimo-v2.6-flash-free, stream and
not, 200 with a Bash call.
- Header tests (project identity x4, per-protocol header set x3, the
streaming one): red on origin/main's provider.mjs (8 of 199 fail),
green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2675 pass, 0 fail;
bun scripts/check.mjs: ok.
Not tried: Kimi Code or Kimi Work themselves through magpie (the request
was built from Kimi CLI's installed prompt and tool files); a Responses
or Anthropic free model (Zen lists none free now).
|
||
|
|
9da5cd3426 |
workbuddy 0.1.35: used credits say when the plan's cycle starts again (windy on Discord)
windy's WorkBuddy card in magpie showed 46% of the credits used and, beside it, "Not used yet". The Credits window had no resetsAt, and magpie's card says "Not used yet" when no used window has a reset. WorkBuddy's own client (5.5.6, getCurrentPlan) says the plan refreshes at the cycle end of the package the summary names as the subscription (SubscriptionPackageCode). cycleOf now gives the Credits window that reset (CycleEndTime, UTC+8) and the cycle's span, from the paid and free lists usage already reads for runsOutOf; none named, not listed or a cycle already over leaves it unknown, as before. Run: bun test in packages/workbuddy, sandbox HOME, fetch stubbed: 154 pass 0 fail. On the old index.mjs the two new tests fail (resetsAt undefined; cycleOf's cases). bun scripts/check.mjs: workbuddy ok. Real: the summary and paid list of a real WorkBuddy AI Pro account (2026-10-26, read-only, no renewal) through the new code give Credits 89.2 / 2000, resetsAt 2026-10-28T16:40:52Z, span 30d-1s. Not tried: a China-site (copilot.tencent.com) account: the desktop sign-in on this machine is refused (401), so a CN free plan's SubscriptionPackageCode wasn't seen; without one the card stays as it was. magpie's card saying "Not used yet" beside a used window without a reset is fixed in magpie itself. |
||
|
|
e5136447b7 |
skills: magpie-setup, an agent sets magpie up as the user asks
Asked for by Leyuu_5 on X ("功能越来越多,感觉可以来个skill让AI来帮设置需求了").
The skill teaches an agent to read magpie's state, then turn a request
into magpie's own commands: keys and subscriptions, an agent's model,
routing groups with fallbacks and rules (time of day with a zone,
tokens, images, folders, compaction, intent), gateway keys with budgets
and model lists, model names/prices/visibility, and the library's MCP
servers, instructions and web search. It says what to ask before
(replacing, removing, sign-in) and what never to run unasked, and that
a subscription is never set up for another person's use.
What was run: every command in SKILL.md was read from magpie's
internal/cli source at origin/main d2e0ea393 and run against a magpie
built from it, in a sandbox HOME (provider add preset/url/anthropic/
ollama, provider test/models/fallback/off/on/rpm, account-cap,
group add/set models+=/template, every rule form incl.
time=09:00-18:00@Asia/Shanghai and tz=, rule mv/rm, gateway-key
add/list/limit month --cost 20/limit add day --tokens/models, model
name/disable/price/context, visible, library mcp add/instructions,
search add, save/use, claude/codex set and default, healthcheck,
usage, quota). Two magpie bugs found doing so are fixed there
(gateway-key limit <id> month refused; library mcp add with no agents
said every agent had it) and ship with the next tag.
Not tried: accounts add / plugin login (a real browser sign-in),
daemon install, webdav, backup/restore.
|
||
|
|
8531ccc532 |
commandcode 0.1.17: the Credits window comes second, so magpie's account line and menu bar show the plan's dollars (01huadalang on Discord)
01huadalang: "command 的订阅插件没有显示总额度剩余的条子". A Pro, GOAT, Max or Ultra account reports 5 hours, Weekly and then Credits. magpie's Providers account line (quotaLine) and the menu bar (trayusage) show an account's first two windows only, so the Credits bar, the plan's whole allowance, was never drawn there; it sat in the tooltip. allowanceOf now puts Credits right after the first window: 5 hours, Credits, Weekly. The 5-hour window stays first, so the Usage card's spark and pace line are unchanged; Weekly moves to the account line's tooltip. Accounts with one limit window (Weekly, Credits) or none (Go: Credits alone) are as before. Not this change: #303 (amount/limit on the Credits window) is held, as reviewed on it: on every released magpie a window with a limit is printed as "17.89 / 70" with no "$" in both modes, until magpie formats a unit "usd" window as money (#301 step 1, not landed). Run (HOME a temp dir without "magpie" in its path; no-magpie.test.mjs greps every request for the word and finds the HOME in the Go body otherwise): - packages/commandcode bun test: 65 pass, 0 fail. - bun run check: exit 0, every package. - Old code: usage.test.mjs's "a Max account: its 5 hours, its credits second ..." fails on origin/main's index.mjs (12 pass, 1 fail: Weekly where Credits is expected). - Real account: the owner's GOAT key through hooks.auth.usage now gives [5 hours 0.93%, Credits $0.63 / $70.00, Weekly 1.20%] (before: 5 hours, Weekly, Credits). Not tried: a Go, Pro, Max or Ultra account (none here). |
||
|
|
564719b9d9 |
zen-free 0.1.15: an agent's prompt goes with OpenCode's environment block, so Zen serves it as OpenCode's
杨梅 on magpie's Discord: deepseek-v4.1-flash-free and glm-5.3-flash-free
answered from OpenCode, while the same models from Kimi Work and WorkBuddy
failed at once with 429 (magpie: "额度用尽").
Cause, found against opencode.ai from this machine on 2026-10-25: Zen's
free tier tells OpenCode's requests by the body, not the headers. A
request whose system messages carry OpenCode's environment block (`<env>`,
a `Working directory:` line, `</env>`) is served; one without gets a small
allowance a day, then 429 FreeUsageLimitError "Free usage limit reached.
Free models work in OpenCode", Retry-After to 00:00 UTC. Captured real
OpenCode 2.0.25 (sandbox HOME, MITM with a sandbox CA) and replayed its
request: 200. Its headers with another system prompt, or without tools:
429. Our headers (1.19.0 UA, /inference/v1) with its body: 200, so UA,
path (/inference/openai/v1 vs /inference/v1), session ids, project and
trace headers don't matter. Bisected the prompt to the <env> block: case
sensitive, needs "Working directory:", counts only in a system message
(in a user message or a tool description it doesn't), value free
("unknown", "/" and "" all pass), and still needs tools (the core
stand-ins already sent pass).
Fix: addEnvironment appends "<env>\n Working directory: unknown\n</env>"
to the agent's first system message (a part of its own for content in
parts, a new first system message when there is none), Anthropic's
`system` and Responses' `instructions` likewise. A prompt that already
has a block, as OpenCode's does, goes as it is. The directory isn't known
in the plugin and the agent's own prompt says it, so it is said as
unknown, not a path that would mislead the model or leak the user's.
Run:
- Real, through the plugin's loader.fetch from this machine (whose
non-OpenCode allowance was used up): a WorkBuddy-like request (its own
system prompt, a Read tool, WorkBuddy UA) at origin/main's provider.mjs:
deepseek-v4.1-flash-free 429 FreeUsageLimitError (2.3s), glm-5.3
stream 429 (1.8s), the reporter's case. With this change: deepseek 200,
glm-5.3 stream 200, big-pickle 200.
- tools-smoke.mjs, real: big-pickle and mimo-v2.6-flash-free, stream and
not, 200 with a Bash call.
- New test, per protocol: the block added once after the agent's prompt,
added with no prompt and for content in parts, added when the block is
only in a user message, an OpenCode prompt left as it is. Red on
origin/main's provider.mjs (3 of 3 fail), green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2670 tests, 0 fail;
bun scripts/check.mjs: ok.
Not tried: a Responses or Anthropic Messages free model against Zen
(Zen lists none free now; all eight are Chat), so where Zen looks for the
block on those two is a guess from Chat's. Kimi Work and WorkBuddy
themselves weren't run; their request was built by hand.
|
||
|
|
57598ad410 |
zcode 0.1.30: a coding plan's requests name the device in metadata.user_id, as ZCode's do (#387)
wendyeq measured BigModel's GLM Coding Plan through magpie hitting the
prompt cache 1 time in 19 without metadata.user_id and 13 in 16 with it;
the official ZCode on the same account reads 95-98% of input from cache.
The plugin only put user_id on the Start Plan's dressed body; a coding
plan or team request went as the agent sent it, and Pi sends none.
ZCode 3.14.3 (glm/zcode.cjs) sets it on every Anthropic-format request,
not only the Start Plan's: Pst() returns MLs({deviceMid, sessionId}) for
any providerKind "anthropic", and vWr() puts it in
providerOptions.anthropic.metadata.userId for both generateText and
streamText. The value is {"device_id":<machine id>,"account_uuid":"",
"session_id":...}.
Now a coding plan or team request to .../v1/messages gets
metadata.user_id = {"device_id":<sign-in's saved device>,
"account_uuid":"","session_id":""}, the same value dress() puts on the
Start Plan's, when the agent sent no user_id of its own; other metadata
is kept and content-length dropped when the body changed. count_tokens
and non-Messages bodies go as they were. An account known only by a key
(a pasted API key, or a saved state with no device) gets a device id
hashed from the key, so it is the same on every start rather than
anyDevice, which was new per process.
Differences from ZCode, kept on purpose: ZCode overwrites any user_id
and fills session_id with its session (sess_ prefix stripped); this
keeps an agent's own user_id and sends session_id "" as dress() does,
one stable value per account.
Tests: userid.test.mjs (new, 6 tests; 5 red on origin/main's index.mjs,
the count_tokens one passes there as it should). start, toolsearch and
dual tests that pinned coding plan bodies byte for byte now expect the
agent's body plus the device's user_id.
Run at this tree: HOME=$(mktemp -d) bun test -> 2672 pass, 1 skip,
0 fail across 229 files; bun scripts/check.mjs ok.
Not tried: a real BigModel or Z.ai coding plan request, so the cache
hit rate after the change is the reporter's measurement, not mine.
|
||
|
|
6188ab5be7 |
search1api 0.1.0: Search1API's six tools with API key or OAuth sign-in (#384)
Adds packages/search1api as @magpie-community/tools-search1api 0.1.0
(fatwang2, replacing #340). It has six tools: search, news, ask, crawl,
sitemap and trending. Sign-in is one account by API key or OAuth: PKCE
S256, dynamic client registration and a loopback callback. Tokens refresh
through auth.refresh and on a 401. scripts/check.mjs now accepts a tools
plugin with auth and no loader, as long as its config gives the provider
no npm and no models.
Run at 7cf6a5c merged onto main, in a sandbox HOME, with HTTPS_PROXY
pointed at a dead port:
- bun test packages/search1api scripts/check.test.mjs: 19 pass.
- node --test on the package's own tests: 16 pass.
- tests/host.integration.mjs against main magpie's host.js: 2 pass.
- bun test across the whole repo: 2647 pass, 0 fail. This needs
|
||
|
|
017f05cbb9 |
gcp-ai tests: the network guard lets another package's loopback fetch through
gcp-ai's test/network.mjs (from #307) replaced globalThis.fetch with one that refuses every call. bun test runs every package in one process, so the guard outlived gcp-ai's files: with #384 merged on top, all eight Search1API tests that fetch their own 127.0.0.1 fixture failed with "Unexpected network fetch in test: http://127.0.0.1:…/search" in the repo-wide run, and passed alone. fetch now refuses only a non-loopback host, as the socket, http and dns hooks beside it already did. The real fetch stays inside the module, never on globalThis. Run (sandbox HOME under TMPDIR, HTTPS_PROXY at a dead port): - bun test packages/gcp-ai: 40 pass, 1 skip, 0 fail. - A script importing the guard: a Bun.serve loopback fetch answers "ok"; https://example.com is refused and the process exits 1. - bun test (whole repo) with this file over #384's merge: 2647 pass, 1 skip, 0 fail. Without it: 2638 pass, 9 fail (8 Search1API, plus one gcp-ai Chrome test that lost its CDP connection, which passed in the next run). - bun scripts/check.mjs: every package ok. |
||
|
|
5c9b7a4137 |
zcode 0.1.29: a sign-in keeps the account's user id beside its name
wakkana on Discord reported WorkBuddy accounts of one name collapsing into one. WorkBuddy's plugin already keeps a uid, which magpie's plugin host tells same-name accounts apart by. ZCode names an account by email, else by its name, and gave no uid, so two ZCode accounts with no email and one name were one account in the host. Both sign-ins (browser and the ZCode app's) now give uid: user_id. The app's entry also follows ZCode only while ZCode is signed in to the same user id, not another account of that name. Run: HOME=<scratch> TMPDIR=<scratch> bun test in packages/zcode, 112 pass. Both new tests (own.test.mjs, team.test.mjs) fail with index.mjs from HEAD (uid undefined). bun scripts/check.mjs green. Not tried: a real ZCode sign-in; whether ZCode's poll user carries user_id is read from who(), which already reads it. |
||
|
|
36d8902601 |
cursor 0.2.23: send cursor-agent's team in x-cursor-team-id (#231)
cursor-agent sends the team a request is billed to in `x-cursor-team-id`, from
cli-config.json's `authInfo.activeTeamId`. Without it, Cursor takes the
token's default team. In an organization that team may have on-demand spend
turned off, and the request then fails with "Team budget limit reached".
The plugin now sends the same header on Run (both the native and the stateless
path) and on the dashboard calls. It takes the team only when the token's
`sub` is the config's `authInfo.authId`, so an account signed in from magpie
never gets another account's team. GetHardLimit and GetCurrentPeriodUsage still
go out with `{}`, as cursor-agent sends them. GetFilteredUsageEvents names the
team only when there is one. The config's location (CURSOR_CONFIG_DIR, then
$XDG_CONFIG_HOME/cursor, then ~/.cursor) and the team check (a positive
integer) match cursor-agent 2026.10.01's paths.js and request.js.
Run at d4476ff merged onto main
|
||
|
|
60b9abf2bc |
qoder 0.2.37: a QwenWork personal account's usage shows what is left, with each pool, instead of "no credits" (#385)
Cause: the public cloud's account-context answers a personal account's
quota with total and used null and only remaining (the reporter's
{"total": null, "used": null, "remaining": 2098.6336, "exceeded": false}).
parseAccountContext made a window only from total > 0, so every such
account read as "QwenWork: the account reports no credits". The usage
hook already read the account-context on site.usagePath, not Qoder's
/sash/api/v2/me/usage (that is the qoder path); the comment naming a
fetchSiteUsage that doesn't exist is corrected.
What QwenWork's own client reads, from QwenWorkCN.app 1.2.1's
app.asar out/main/main.js: fetchQuotaUsage reads
/api/v1/adapter/user/account-context?include=user,plan,quota,page,data_sharing
(unwrapAdapterResponse: the data object, else the envelope), and for a
personal account fetchUserWallets reads /api/v1/adapter/user/wallets,
taking daily_credits, monthly_credits and longterm_credits'
total_balance (mergeWalletsIntoCreditBreakdown).
Now: remaining is the card's balance, "2098.63 credits (daily 98.6 ·
long-term 2000)", with no used share made up; an account with a total
keeps its used / total window; remaining 0 or exceeded is a spent
window. The wallets are asked on the public cloud only, never for a biz
account or the enterprise flagship (the client doesn't either), and a
failed wallets read leaves the balance without pools. The envelope is
read wrapped in data or bare.
Not changed: an enterprise account on the public cloud, which the
client reads from /api/v2/quota/usage, still reads the account-context.
Run (bun 1.4.2): bun test in packages/qoder, 238 pass, 0 fail; bun
scripts/check.mjs, rc 0. The 5 new tests in qwenwork.test.mjs (built
from the reporter's bytes) fail on the old index.mjs, 14 pass 5 fail.
Probed gateway.qwenwork.cn with a bad token: wallets and
account-context answer 401, /sash/api/v2/me/usage 404.
Not tried: a real QwenWork account (none on this machine).
|
||
|
|
1fbe22b3ad |
kimi-work 0.1.11: a usage read that fails says why on the card and keeps the Work sign-in
泠夜Soul (Discord), latest magpie and kimi-work 0.1.10: the Kimi Work
usage card says only "暂时无法获取额度", with no error anywhere.
Cause: auth.usage threw on every failure. magpie puts a plugin's reason
on the card only when usage returns it as `error` (quotaOfPlugin sets
PluginError; app.js quotaError then says "暂时无法获取额度:<why>"). A
thrown error reaches the card as the bare text, with the reason in a
tooltip. The read uses Kimi's web sign-in (credentials.kimiWeb.accessToken),
not the Work token chat uses. Kimi desktop 3.2.20 rewrites that token in
daimon config.json only while it runs (its token-change sync). Once the
desktop is closed, www.kimi.com answers it 401 "Session expired"
(REASON_INVALID_AUTH_TOKEN), the same stale token 0.1.10 found on the
menu. That 401 was thrown as expired() with signIn "expired", so magpie
also marked the Work account signed out while chat still worked. The
header changes in 0.1.8-0.1.10 aren't the cause: signed out or with a
bad token, GetSubscriptionStats answers the same 401 with or without the
x-msh headers. Their effect with a valid token wasn't seen.
What changed:
- usage never throws on a failed read. It returns
{windows: [], error, signIn: "kept"}. A 401 says
"Kimi 网页登录已过期,打开一次 Kimi 桌面版即可刷新额度(对话不受影响)",
in words that magpie's signInGone doesn't take for a lapsed sign-in.
Other statuses keep their HTTP code. Each failure is logged without the
token.
- subscriptionBalance is read in camelCase or snake_case. A balance
whose amountUsedRatio Connect JSON left out (zero) reads 0% used.
Before, that gave no window at all. A reply with no balance says so.
Field names are from the desktop's membership.v2 descriptor:
subscription_balance is optional in GetSubscriptionStatsResponse.
Run at this tree (origin/main
|
||
|
|
743e8af3b4 |
qoder 0.2.36: Anthropic's <function_calls><invoke> and Qwen's bare <function=…> calls written as text are read as calls (#323)
trae 0.2.19's sibling. qoder's Splitter read a text-written call only
inside <tool_call>, so a bare Qwen <function=compress><parameter=…> or an
Anthropic <function_calls><invoke name="…"> block (with or without the
namespace prefix) went to the agent as reply text. And parseCall
JSON-parsed every parameter, so a string parameter holding [1, 2] became
an array.
- Splitter takes the request's tools (none under tool_choice none) and
reads both shapes bare (xmlCall), only for a declared tool, never in
backticks or a code fence. A tag split across chunks is held, never
text; the closes and blanks after a call are dropped; one cut short
ends the turn with the CUT_SHORT error, as <tool_call> blocks do.
- A parameter's value is its text where the tool's schema says string,
else JSON, here and in <tool_call>'s <function=…> form.
- README says so.
Run at this commit (base origin/main
|
||
|
|
d248efa7a1 |
workbuddy 0.1.34: a free account's plan is "Free plan", not "Free" (#337)
Buger2008 read the "Free" beside their WorkBuddy account in Providers as
the model they picked (Deepseek-V4.1-Flash, 0.11x) being free, and as why
routing chose WorkBuddy first. It is the account's plan; routing doesn't
read it. The label now says it is a plan. Nothing in magpie or the plugins
compares a plan to "Free" (grepped internal/ and packages/).
Run: bun test in packages/workbuddy, sandbox HOME, network at a dead
proxy: 152 pass 0 fail; on the old index.mjs the 4 tests that say the
label fail. bun scripts/check.mjs: workbuddy ok.
Not tried: a real WorkBuddy account in the GUI.
Siblings: trae ("Free", d.plan || "Free") and mimo (plan "Free") say the
same; filed as their own issue.
|
||
|
|
9a52d96cec |
gcp-ai: the tests' fake gcloud runs on the test's own runtime, not PATH's node
publish.yml has been red since
|
||
|
|
ebe3555b30 |
qoder 0.2.35: a oneOf of objects with no type reaches kmodel typed object (#378)
congee949 found that qoder-cn's kmodel_latest (Kimi K3.1 Pro) fails with 502 on dsh's REA tools because of a oneOf with no type whose branches are all objects. With "type": "object" beside each such oneOf, the same requests got 200 in a real dsh run. qoderBody now sends each tool's parameters through typedUnions, which types such a oneOf object when each branch is typed object, directly or through local $refs. Other unions, anyOf, and missing, external or circular $refs are left alone. The work is done on a copy, so the client's schema is not changed. This is the same rule workbuddy 0.1.33 applies. Run: `bun test` in packages/qoder with a sandbox HOME/TMPDIR and a dead HTTPS_PROXY: 225 pass, 0 fail. `bun scripts/check.mjs qoder`: ok. Broken by hand: with qoderBody sending parameters unchanged, schema.test.mjs goes 1 red. Not tried: a real Qoder account. |
||
|
|
def6a83584 |
workbuddy 0.1.33: a oneOf of objects with no type reaches Kimi typed object (#378)
congee949 found that kimi-k3.1-pro on workbuddy and workbuddy-ai answers 400 "Invalid request parameters" to a tool whose parameters hold a oneOf with no type. This happens even when every branch is an object, either as a $ref's target or deeper in it (dsh's REA tools). The same request with "type": "object" beside the oneOf gets 200, in three real dsh runs with all 198 tools. fitTools now runs typeUnions after fitShape. typeUnions gives such a oneOf type "object" when each branch is typed object, either directly or through a chain of local $refs. A union of other or mixed types, an anyOf, and a $ref that is missing, external or circular are left as they came. Only schema keywords are walked, so examples and defaults are not. Tests use the issue's literal parameters: the minimal $ref → oneOf, the nested oneOf that all three routes refused, and the REA $ref-branch case. They also cover what is left alone. Run: `bun test` in packages/workbuddy with a sandbox HOME/TMPDIR and a dead HTTPS_PROXY: 152 pass, 0 fail. `bun scripts/check.mjs workbuddy`: ok. scripts/try.sh with magpie origin/main 4dfd88206 lists workbuddy (15) and workbuddy-ai (16). Broken by hand: with the typeUnions call taken out of fitTools, tools.test.mjs goes 1 red; with $ref branches not followed, 1 red. Not tried: a real WorkBuddy account. The rule is the one the reporter verified on the live API. |
||
|
|
f0bd94c4e2 |
cursor 0.2.22: a heartbeat keeps a counted tool batch open, and its failure says how much came (#377)
Okxdd123's grok-4.7 step counted its batch, thought, then wrote one long call for over 30 s with only heartbeats, and failed as "Cursor did not complete its declared native tool batch". batchWait was reset by a call, answered call, count or text, never a heartbeat, so a single long call's arguments could not outlast it. A heartbeat (InteractionUpdate 13) now resets it while the batch is open; silence stays bounded by idle (60 s) and a heartbeat-only stretch by quiet (240 s), as #2672 set. The failure now reads "N of M calls came, K answered here, none since X ms", the counts the report asked for. Not changed: the issue's third ask, a stateless rebuild for this failure. A streamed reply has already shown its reasoning by then, and the rebuild only runs before output is exposed. Run: the two new native-session tests and the updated #155 test are red on the old code (3 fail) and green after; bun test packages/cursor 291 pass in a sandbox HOME; bun scripts/check.mjs ok. Not tried live: it needs a real Cursor step writing one call for over 30 s. |
||
|
|
2d59003f8e |
zcode: the team seat's request test uses a key of its own
start.test.mjs's "a team seat's request goes as the agent sent it" used
key "team.secret", the same as team-gift.test.mjs. In one bun test
process the two files share index.mjs's routes cache (key + jwt), and
when both jwts were built in the same second the seat test read
team-gift's cached route, skipped the billing/balance read and saw 1
request where it expects 2. That kept publish.yml red since
|
||
|
|
d467d29746 |
cowork 0.1.0: Tuanjie Cowork on magpie's Agents page (#239)
Adds @magpie-community/agent-cowork 0.1.0 (Tuanjie Cowork on magpie's Agents page) and its registry entry. The agent writes the one key defaultChatModelTitle in ~/.codely/ide-settings.json. seed.mjs copies magpie's catalog into Cowork's store, and prunes, relabels and removes only the entry ids recorded in settings.json.magpie-seeded.
Re-reviewed at cbe10c949940b75c6ac2b4cdcc2fe9a92ae6830c against the three earlier change requests (items 1-8, adoption by address, prune hold, relabel and selection).
What was run at cbe10c949940b75c6ac2b4cdcc2fe9a92ae6830c (it merges cleanly onto main
|
||
|
|
e801e434f3 |
gcp-ai: Vertex models and Google Cloud credits with your own gcloud ADC (#307)
New package gcp-ai (Yaka88): Vertex models and Google Cloud credits through the user's own gcloud ADC, with multiple accounts, a signed-in model list, and a pipe-only Chrome for the credits read.
Reviewed at 8989b58 against the 10-24 review at 4586c99. I read the whole incremental diff (index.mjs, lib/browser, lib/credentials, lib/lock, test/*). Earlier rounds had already reviewed the rest.
- Tests reaching the network: fixed. test/network.mjs replaces fetch and blocks non-local net/tls/http/dns. `bun test` (40 pass, 1 skip [Linux-only lock test], 0 fail, 106s) ran in a sandbox HOME/TMPDIR behind a dead HTTPS_PROXY, with a preload that logged non-local fetch and connect calls: 0 lines logged. Broken by hand: with the fetch stub removed from "already filed", the guard prints "Unexpected network fetch … userinfo" and bun exits 1. Restored, it exits 0.
- Chrome background traffic: lsof on the test Chrome processes (56 samples during browser.test.mjs, 5 pass) found no inet sockets at all.
- Leftover work after a test: close() now awaits settled, and every sign-in test closes in finally before restoring fetch.
- Smaller points: the lock's age ceiling now comes after the Linux /proc check; settings() is auth > options > env for every field; resolveAdcDirectory and authorizeAdc are removed.
- `bun scripts/check.mjs gcp-ai`: ok. The merge onto main
|
||
|
|
98985a2426 |
codearts: the credit fixture's check-in stays on its sign-up's Beijing day at any hour (#322)
creditFetcher put the check-in 52s after a sign-up taken from the wall clock, so in the last 52s of a Beijing day it fell on the next day and the usage test read runsOut 4000, not 5000. The sign-up is now noon in Beijing of the same day, so the check-in a minute later can't cross midnight. Test only; the plugin is unchanged, so no version bump. Run: bun test packages/codearts under TZ=UTC, Asia/Shanghai and America/Los_Angeles (sandbox HOME): 109 pass. The new guard test (now 30s and 1ms before Beijing midnight, at it, and at noon) is red with the old fixture (1 fail) and green with the new. bun scripts/check.mjs codearts: ok. |
||
|
|
b46bcfcf9f |
nous 0.1.1: a null or string expires_in beside a valid JWT exp takes the exp, so the sign-in stays usable (#328)
token() counted any present non-number expires_in as a malformed bound and set expires = 1 even when the access token's JWT exp was valid, so a renewal recorded unusable_inference_jwt and every request failed. Like Hermes's _remaining_ttl, a null or non-numeric expires_in is now ignored when the JWT carries a finite exp. With no valid exp it is still a malformed bound (expires = 1), and a numeric expires_in <= 0 or non-finite still is too. Run: TMPDIR/HOME under the scratch dir, bun test packages/nous, 56 pass; the new test is red on 0.1.0. bun scripts/check.mjs nous ok. Not tried against the real Nous Portal. |
||
|
|
d43b228463 |
layerfs 0.7.3: workspace paths sit under ~/.layerfs-tools, so a tool result no longer names magpie (#360)
provision, resolve and exec answer the workspace's path, and a tool result goes to the vendor in the agent's next request. With the default root ~/.magpie-layerfs every provision named magpie upstream. The default root is now ~/.layerfs-tools. A ~/.magpie-layerfs made by 0.7.2 or earlier is renamed to it once, at the first backend made, and a link is left at the old path, so a session still holding an old workspace path keeps working. A legacy root that is itself a link (the user's own setup) is used where it is, as is one the rename is refused on. MAGPIE_LAYERFS_HOME set by the user is unchanged. A second host racing the rename finds the new root and uses it. Run, in a sandbox HOME: - bun test packages/layerfs: 53 pass, 0 fail. bun scripts/check.mjs layerfs: ok. - The three #360 tests against the old default (defaultRoot answering ~/.magpie-layerfs): 2 of them red, the third (a user's link) is unchanged behaviour. - Through magpie's real plugin host (origin/main 4dfd88206, plugin.Add of this package + plugin.RunTool "provision" in a testenv sandbox HOME): a fresh home answers ~/.layerfs-tools/workspaces/demo/main and makes nothing at the old name; a home with a ~/.magpie-layerfs holding a marker answers the new path, the marker is under ~/.layerfs-tools, and ~/.magpie-layerfs is a symlink. Not tried: Windows (the link is a junction there), and moving a root while an agent's exec runs in it. |
||
|
|
c02957a40b |
layerfs: the tests' cleanup hooks get a 120s bar, not bun's 5s (#362)
Both test files remove every temp dir in one afterAll. On a loaded box
that took 6-7.5s and went red against bun's default 5s hook timeout.
The hooks now carry their own bar.
Run: with a 7s Bun.sleepSync injected into layerfs.test.mjs's hook,
the old bar fails ("a beforeEach/afterEach hook timed out", 28 pass
1 fail) and the new one passes (28 pass 0 fail). Test-only change, so
no version bump.
|
||
|
|
b07478285c |
zcode 0.1.28: a key's route is read again with each card read, after a Start Plan refusal, and a minute after one list without its plan (#369, #379)
Also publishes #371 (a team seat lists the person's gift plans and their
-Trial models,
|
||
|
|
3a59be3caf |
qoder 0.2.34: QwenWork (千问办公), the public cloud and the enterprise flagship (#319)
QwenWork (千问办公) is served from the qoder package as two more provider ids, as the ruling on #313/#314 asked: `qwenwork` (gateway.qwenwork.cn, the desktop client's device flow and account-context usage) and `qwenwork-enterprise` (the enterprise flagship on the enterprise's own domain, asked at sign-in or preset by QWENWORK_ENT_DOMAIN). Chat, the model list and the queue are signed for the site (ClientType 6, scene qwork, cosy 1.1.59, product qoder_work). No PAT and no check-in for QwenWork, so Qoder's desktop identity never reaches it. Qoder and Qoder CN are unchanged. Reviewed at c543f1b (on main 8d687ad; main has no qoder or registry change since), by @LittlefishStudent. Run at c543f1b, sandbox HOME and TMPDIR, network pointed at a dead proxy: - packages/qoder `bun test`: 223 pass, 0 fail. `bun scripts/check.mjs qoder`: ok. - Broken by hand, one at a time: the queue status signed without its site, 1 red; the usage 401 rotation removed, 1 red; the site's system prompt ignored, 1 red; the enterpriseHost routing removed, 6 red. - Read every call of the changed signatures (cosyHeaders, userBlob, queueStatus, queueWait, qoderBody): each passes the site, and a Qoder site has none of the new fields, so its requests are as before (the earlier review's recording probe found them byte-identical). - magpie origin/main 4dfd88206's plugin host, sandbox HOME (scripts/try.sh qoder): qoder 17 models, qoder-cn 4, qwenwork 3, qwenwork-enterprise 3. Not tried against the real API here: no QwenWork account in the sandbox. The author ran sign-in, chats and usage against a real deployment. |
||
|
|
1bd45a8d17 |
autoclaw 0.2.8: the credit balance is the card's balance, not a meter reading "剩余 100%" (#376)
moxuanchen: AutoClaw's credits are a bare balance with no limit and no
amount used, but usage() also sent them as a window with used: 0, so the
card read "500 积分 · 剩余 100%" whatever was left. The total, and the
wallets it breaks into, now go in balance only ("1234 积分(赠送积分 500 ·
会员积分 734)"). The daily check-in row stays a window.
Not changed here: magpie's card gives every window a share, so an aside
row that only carries text (the check-in row here, and the same pattern
in cline, cursor, factory and zcode) still shows "· 0% used / 100% left".
That is magpie's rendering, not this plugin's.
Run: HOME=<scratch> bun test packages/autoclaw, 38 pass; the new test is
red on 0.2.7. bun scripts/check.mjs autoclaw ok. Not tried against the
real API.
|
||
|
|
ae2ed19e47 |
autoclaw 0.2.7: on Linux, X-Tm is "linux-x64" as the official client sends, not the "linux" the overseas gateway refuses (#367)
menhouran found that autoglm-api.autoglm.ai answers X-Tm "linux" with
403 {"message":"forbidden"} for a valid token, and "linux-x64" (what the
official AutoClaw Linux client sends) with 200. The plugin built X-Tm
from process.platform, so every overseas chat on Linux failed and read as
"AutoClaw 登录已失效". X-Tm is now mac / win / linux-x64; the User-Agent
keeps "(linux-x64)" from process.platform and process.arch as before.
Not changed: both hosts answering 403 is still reported as an expired
sign-in. The plugin's tests deliberately treat a bare 403 that way, and
what an expired token gets from this gateway hasn't been seen, so the
mapping is left alone.
Run: HOME=<scratch> bun test packages/autoclaw, 37 pass; the new test is
red on 0.2.6. bun scripts/check.mjs autoclaw ok. Not tried against the
real API or on Linux.
|
||
|
|
ba343b84ea |
workbuddy 0.1.32: a Claude model is served on Messages, where effort (max included) is honored (#346)
WorkBuddy's China build serves its Claude models on Anthropic's Messages API (<endpoint>/v1/messages). A Claude model there is now `@ai-sdk/anthropic` and goes to Messages, where `output_config.effort` (max included) is honored. Every other model, and every WorkBuddy AI model, stays on chat. A Messages body goes as sent, minus thinking blocks with no signature, and goes once more without thinking when WorkBuddy refuses a signature it didn't make (11159). count_tokens goes on the Messages route too. One Claude Code send keeps one turn id (#48). Reviewed at 9e0eb2b (rebased on main ba9801c; workbuddy unchanged from the 39f71a7 the author answered the last review with), by @waynesguan. Run at 9e0eb2b, sandbox HOME and TMPDIR: - packages/workbuddy `bun test`: 149 pass, 0 fail. Run again with HTTP(S)_PROXY pointing at a dead port: 149 pass, so no test reaches the network. - `bun scripts/check.mjs workbuddy`: ok. - Broken by hand: BAD_SIGNATURE that never matches turns "a signature WorkBuddy didn't make is refused once…" red; isMessages without count_tokens turns "count_tokens is a Messages request" red. - Read: magpie's provider/plugins.go takes `firstOf(o.BaseURL, m.URL, …)`, so the loader's empty baseURL falls back to each model's api.url (/v1 for Claude, /v2 for chat). - magpie origin/main 4dfd88206's plugin host, sandbox HOME (scripts/try.sh): the package adds, workbuddy lists 15 models and workbuddy-ai 16. Not tried against the real API here: the sandbox has no WorkBuddy account that can reach a Claude model. The author's replays with a real account (empty text block 200, signature binding table) are what the 11159 handling rests on. |
||
|
|
935ddb5b45 |
zcode: a team seat lists the person's gift plans and their -Trial models (#359, #371)
A team seat's ZCode session also reads the person's own gift plans (#359): plansOf no longer returns {start:false, gift:null} for every team seat. A team seat stays on its team plan (its personal plan list is not read), its <model>-Trial entries are listed, its card shows the gift buckets beside the team's windows, and a team seat with no or an expired ZCode session gets the "ZCode gift plans (-Trial models) need ZCode's sign-in" line. Plain models spend the team key; -Trial models go to zcode.z.ai with the ZCode session and no team key or organization header.
Reviewed at 4778e0d (on main
|
||
|
|
4ac4766217 |
trae 0.2.22: every client profile is read, a claim's code 0 is read back (#333)
moxuanchen's change for #361 (a second Trae CN account can't check in).
- Every Trae CN client profile is read (Trae CN, TRAE SOLO CN, trae-cn):
the one signed in as the account gives its device. A profile signed in
as someone else, or one that doesn't parse, no longer hides the rest.
- A claim's code 0 is read back from the status. Not in after the claim
is `ineligible` for the day (no repeat claims); a failed read-back is
ineligible too.
- 9074's message says Trae did not take the check-in for this account's
device, and no longer sends people to Trae CN's app.
- Credit: the claim's credits, else its extra_credits, else the
read-back's credits; never summed (matches 0.2.21).
- Version 0.2.22, README updated.
Run at the reviewed head 4006fef51 (rebased on
|
||
|
|
ba9801c953 |
trae 0.2.21: a check-in's credit is the day's credits, not credits plus extra_credits (zhujiu on magpie's Discord)
zhujiu (magpie Discord #feedback, 10-25): "trae签到的积分为100而不是200 …
显示错误了". The card showed a claimed Trae CN check-in as 200 credits;
the account got 100.
Cause: auth.checkin's claimed outcome was the claim's credits +
extra_credits, falling back to the status's credits + extra_credits.
Trae CN's real claim answer names no credit at all ({"code":0,
"message":"success"}, plugins#194), so the fallback always ran, and a
real account's status carries both fields at 100 ({"checked_in": false,
"code": 0, "credits": 100, "did_checked_in": false, "enable": true,
"extra_credits": 100}, yetone/magpie#808): 100 + 100 = 200. magpie's own
Go check-in (internal/provider/trae_checkin.go, used only for plugins
before 0.2.17) fell back to the status's credits alone, and its real run
recorded credit 100 (plugins#194).
Now the credit is the claim's credits, else its extra_credits when it
names only that (#260's case), else the status's credits; the two are
never added. The done outcome already read credits alone. Trae Global
has no check-in, so this is CN only. What extra_credits means on Trae's
side is not known; nothing seen shows it granted on top.
Tests (native-checkin.test.mjs): the real status and claim answers give
credit 100; a claim naming both gives 100; a checked-in day with
extra_credits is done with 100. On origin/main's index.mjs the first two
fail (Expected credit 100, Received 200). HOME=<scratch> bun test in
packages/trae: 206 pass, 0 fail; bun scripts/check.mjs trae: ok.
Not tried with a real Trae CN account (none here); the shapes are the
real ones quoted in #808 and plugins#194. PR #333 touches the same
fallback line and needs a rebase.
|
||
|
|
28f9cbb3b2 |
zcode 0.1.27: the Start Plan's 405 code 3012 says ZCode's risk control blocked the account, not a network block (#348)
zcode.z.ai answers {"code":3012,"msg":"request has been blocked due to
unusual activity."} with 405. Since 10-24 many accounts get it on every
request, and on several of them ZCode's own app (3.16.3) gets the same 405;
ZCode's support bot calls 3012 platform risk control on the account. The
plugin used to put "though magpie sends it as the ZCode app does; it can
be a network block of this IP" after it, and read that JSON as the edge
firewall's page (EDGE_BLOCKED matched "request has been blocked"), so
ZCode's own words and code were dropped.
Now: ZCode's words with the status and code, then provider
ZCodeRestrictedHint word for word ("ZCode's risk control blocked this
account for unusual activity (code 3012); it rests, and the group's other
providers are used. ..."), which magpie's gateway reads as the account
restricted (2h rest, next member asked) from the next magpie release on.
Only an HTML / errors.aliyun.com block page says the network's address
(provider.BlockedHint's words).
Compared with ZCode 3.16.3's glm/zcode.cjs (downloaded from
cdn-zcode.z.ai, the latest on zcode.z.ai): the Start Plan is sent
unsigned there too (requiresClientRequestSigning is false for
zhipu-account start-plan, off-peak and highspeed; X-Client-Sig/Pow apply
to coding-plan keys on the paas origin), and the headers plugins#348's
curl shows are the plugin's set. No request difference was found that
explains 3012; not tried against a real blocked account.
Run: packages/zcode, Bun 1.4.2, sandbox HOME: 102 pass, 0 fail. The new
start.test.mjs case is red on 0.1.26's index.mjs (1 fail, the 3012
message). bun scripts/check.mjs ok.
|
||
|
|
c9a0215f31 |
cursor: a continued Run that goes quiet after the caller's results ends (#364)
Test only. #364's tests covered the pause at a sealed batch but not the
resume after the submit: with resume() leaving the Run paused, every
test passed and a retained Run that went quiet on its second model call
would wait for lifetime again. This one is red with that break (times
out at 5 s) and green at
|
||
|
|
cf1873e292 |
cursor 0.2.21: a Run Cursor stops answering ends, retained or stateless (yetone/magpie#2672) (#364)
A Run Cursor stops answering mid-turn now ends with a 502 that says so,
on both the stateless path (runOnce/decode) and the retained path
(NativeSession.pump), instead of holding the reply open until the agent
gives up (yetone/magpie#2672: two composer-2.5 turns waited 305 s).
Quiet wraps a Run's frames: 60 s with no message at all, or 240 s with
only Cursor's heartbeats (InteractionUpdate.heartbeat), ends it. Only
time spent waiting on Cursor's next frame counts; a retained Run parked
for the caller's tool results is paused (resultWait bounds it) and
resumes from nothing after the submit. Each frame gets a fresh wake
promise, so frames already passed on are not held for the stream's life
(review of cbd5d3b). cursor 0.2.20 -> 0.2.21.
Run at the reviewed head 6a17d61 (base 79e383c; main
|
||
|
|
8d687ad519 |
kimi-work 0.1.10: a menu the web sign-in can't get is asked again without it, so K3.1 Pro stays listed
泠夜Soul (Discord) is on 0.1.9 and still has no K3.1 Pro (k3d1-agent),
with no error and nothing in the log. 0.1.9 was checked only against
the menu signed out.
What was found: provider.models asks the menu (DescribeKimiWorkConfig,
with credentials.kimiWeb.accessToken from Kimi's file) and agent-gw's
/models together, and a failed menu ask was dropped without a word:
the list was then /models' alone, k3-agent and k2d8-preview, which is
exactly the report, on 0.1.7 to 0.1.9 alike. www.kimi.com answers a web
sign-in it doesn't take with 401 "unauthenticated", "invalid user
token" (REASON_INVALID_AUTH_TOKEN), seen on 10-24 with a malformed and
a badly signed token; signed out it answers 200 with the desktop menu.
So a stale kimiWeb token in Kimi's file (the desktop closed, or it
renewed it elsewhere) takes K3.1 Pro away silently. That this is the
reporter's case is not proven: no signed-in account here.
What changed:
- The menu, when the signed-in ask fails (any HTTP status, a timeout,
or a reply with no models), is asked again without Authorization, as
the desktop asks it before signing in, with the same x-msh-* headers.
That reply is the desktop menu, K3.1 Pro first. agent-gw requests and
usage are unchanged; nothing is retried there.
- Each failure is written to the log (console.warn, so magpie's plugin
stderr): which ask, and its status or reason, never the token.
- jsonRequest's errors carry the HTTP status, and leaves Authorization
out when given no token.
- no-magpie.test's fake menu is now the captured desktop menu: an
empty one is asked twice now, which its request count would miss.
Run at this tree (origin/main
|
||
|
|
df552949e1 |
kimi-work 0.1.9: the menu is asked with the desktop's headers, so K3.1 Pro (k3d1-agent) is listed
泠夜Soul (Discord) has a Kimi Work membership whose desktop picks
K3.1 Pro, model id k3d1-agent, and magpie's Kimi Work list leaves it
out, on 0.1.7/0.1.8 too, which read DescribeKimiWorkConfig for this.
Cause, seen on the live endpoint (it answers without a sign-in):
DescribeKimiWorkConfig chooses the menu by the caller's x-msh-* headers.
Asked with none, as the plugin asked it (only User-Agent kimi-code-cli),
it answers with the web menu: k3-agent, k3-agent-swarm, k2d8-preview.
Asked as the desktop asks it (x-msh-platform mac or windows, as Kimi's
Connect interceptor sends from the desktop, with x-msh-version), it
answers k3d1-agent "K3.1 Pro", k2d8-preview, k3-agent. Five tries each,
stable. So the menu code was right and its reply was the web's.
What changed:
- www.kimi.com/apiv2 calls (the menu and GetSubscriptionStats, as the
desktop's interceptor puts them on every apiv2 call) carry
x-msh-platform (mac on macOS, windows on Windows, web elsewhere, as the
desktop's own rule), x-msh-version 3.2.20 (the desktop build 0.1.8's
headers came from) and R-Timezone. agent-gw's headers are unchanged.
- A menu row's reply limit is its requestParams.maxTokens (32768 for
every model listed today, the value that was hard-coded).
- tests/fixtures/work-config.mac.json and work-config.web.json are the
two literal replies, captured signed out on 10-24. The new tests have a
fake that answers as the server does (desktop menu only for mac or
windows) and check that k3d1-agent is listed as "K3.1 Pro" with
low/high/max, 262144 context and 32768 output, on darwin and win32.
Run at this tree (origin/main
|
||
|
|
79e383c404 |
layerfs 0.7.2: tool descriptions and errors say "the app" and "the host", not magpie (#358)
Tool descriptions, and the errors a call answers, are part of the prompt
the agent sends its vendor. provision said "magpie's config directory",
exec "magpie serves these tools…", "MAGPIE_LAYERFS_EXEC=1" and "in
magpie's plugin options". They now say "the app's config directory",
"the host serves these tools…", "the exec switch in the host's
environment (see the package's README)" and "the host's plugin options".
The siblings that reach the model too are reworded the same way: the
source refusal ("the app's config directory"), the sim-only error (no
package or repo name, no variable names) and the bad-backend error.
Every environment variable is still read as before.
Not changed, filed as plugins#360: the workspace path provision answers
is under ~/.magpie-layerfs by default; moving it needs a plan for
existing workspaces.
Run:
- bun test (packages/layerfs): 50 pass, 0 fail
- bun scripts/check.mjs: ok
- no-magpie.test.mjs against HEAD's index.mjs and layerfs.mjs: 2 of 2 red
|
||
|
|
c9a52b3baf |
opendesign 0.1.7: the sign-in names this computer, never "magpie" (#357)
The device authorization sent `host: hostname() || "magpie"`. The Open
Design CLI, `vela login` (@powerformer/vela-cli 0.1.7, darwin-arm64
binary), sends `{"cliVersion","host","profile":"prod"}` with host from
os.Hostname(), and when the name can't be read it stops with "resolve
hostname: %w" instead of sending a name of its own. The plugin now does
the same: this computer's name, or a sign-in that stops and says why,
with nothing sent.
Run:
- vela 0.1.7 `login` in a sandbox HOME/AMR_HOME with VELA_API_URL at a
local recorder: body {"cliVersion":"0.1.7","host":"yetone-mac-mini.local",
"profile":"prod"}
- bun test (packages/opendesign): 24 pass, 0 fail
- bun scripts/check.mjs: ok
- no-magpie.test.mjs against HEAD's index.mjs: 2 of 2 red
Not changed: cliVersion stays "0.1.4" and the User-Agent stays the
package's own name; neither names magpie.
Not tried: a live sign-in. There is no Open Design account to approve it.
|
||
|
|
a9b57b6fb9 |
autoclaw 0.2.6: user-profile carries the account's own device id, not "magpie-plugin" (#355)
fetchUserProfile sent `device_id: "magpie-plugin"`. AutoClaw 1.18.5's own client (app.asar, getUserInfoWithAccessToken -> withWebInfo) sends the device id the account signed in with (getAuthState().deviceId), a 64-hex id. The plugin already generates such an id per login (newDeviceId) and sends it with the login; the server writes it into the tokens' device_id claim. user-profile now sends that id: the login's own at sign-in, the refresh token's claim on refresh (old accounts included), "" only when no token carries one, as refreshTokens already does. Found by the new test: the global chat path forwarded magpie's x-magpie-* hint headers to the vendor. They are now dropped there (the CN path builds its own headers). Run: - bun test (packages/autoclaw): 36 pass, 0 fail - bun scripts/check.mjs: ok - no-magpie.test.mjs against HEAD's index.mjs: 2 of 2 red (device_id "magpie-plugin", then the hint headers) Not tried: a live run. There is no AutoClaw account to sign in with. |
||
|
|
a5c13b8c7a |
kimi-desktop 0.1.3: shared instructions go to the model as <shared-instructions>, not <magpie-kimi-shared-instructions> (#356)
The adapter puts the user's shared instructions in a system message of their own, and its tag went upstream with every prompt naming the app. This tag is the adapter's own (Kimi's client has no such message), so a neutral one was picked: <shared-instructions>. A history holding the old tag from turns before 0.1.3 has that message taken out as before, so no prompt carries two copies or the old name. Left as they are, and why: the menu alias magpie-local-<hash> and the " · Magpie" display name live in Kimi's model menu; the adapter replaces the alias with the real model id before a request leaves it, so neither reaches the model. Run: - no-magpie.test.mjs: with shared instructions and an old tagged turn in history the prompt holds no "magpie", one <shared-instructions> message, and applying twice changes nothing (red on the old code); with no instructions the old turn is still taken out. - bun test (package): 26 pass. scripts/check.mjs skips agent packages (exit 0). Not tried live: no Kimi Work account here, and Kimi isn't installed on this Mac or the Windows box. |
||
|
|
8310fd2e77 |
kimi-work 0.1.8: Kimi gets the headers its own Work client sends, not "Magpie Kimi Work provider" (#353)
Every request to agent-gw and kimi.com carried the User-Agent "Magpie Kimi Work provider/<version>". Kimi 3.2.20's daimon 0.6.10 (the desktop component that holds the Work credential in daimon-share/daimon/config.json) builds its agent-gw headers in createDaimonKimiCodeRequestHeaders: User-Agent kimi-code-cli/<Kimi Code version> (0.36.0, from its kimi-code.vendor.json; no caller passes a suffix), X-Msh-Device-Id, X-Msh-Device-Model, X-Msh-Device-Name, X-Msh-Os-Version, X-Msh-Platform "kimi-code-cli", X-Msh-Version and X-Msh-Daimon-Version 0.6.10. The plugin sends the same on /models and /chat/completions. The device id is the daimon's own: a randomUUID it writes once to <daimon>/runtime/kimi-code/home/device_id. The plugin reads that file and never writes it (it never writes the desktop app's files); when it is missing the header is left out. The www.kimi.com reads (membership, and 0.1.7's DescribeKimiWorkConfig menu) get the kimi-code-cli User-Agent only: those calls are made by Kimi's web page, whose own headers weren't read. The test also found magpie's x-magpie-* hint headers going through to agent-gw on chat requests; they are now dropped. Run: - no-magpie.test.mjs: models, the Work menu, chat (with a magpie User-Agent and an x-magpie-work-dir coming in) and membership hold no "magpie"; agent-gw gets the daimon's headers; the device id is read and never written. Both tests red on |
||
|
|
0a9415f4ef |
kimi-work 0.1.7: models come from Work's own menu (DescribeKimiWorkConfig) as well as /models, so K3.1 Pro on the 99 plan is listed
泠夜Soul (Discord #help, 10-24) is on Kimi's 99 membership and the official Kimi Work desktop has "Kimi K3.1 Pro" picked in its composer, but magpie's Kimi Work list (0.1.6) leaves it out. Cause, read from Kimi desktop 3.2.20's main bundle (decoded): the desktop does not build its Work model menu from agent-gw's /models. It calls the Connect RPC kimi.gateway.config.v1.ConfigService/DescribeKimiWorkConfig on https://www.kimi.com/apiv2 with the web sign-in, takes models plus moreModels, and hands each entry's requestParams.modelId to its agent (conversations.updateKimiModelList), which sends it to agent-gw as the model. The plugin listed /models only, so a tier model the menu has and /models doesn't was never offered. That /models leaves K3.1 Pro out is inferred from the report (0.1.6 already lists /models in full), not seen on an account. What changed: - provider.models asks both lists at once. Menu entries come first, under display.displayName, with id requestParams.modelId; reasoning levels are requestParams.reasoningEffortOptions, else daimonModelConfig's supportEfforts ("off" is REASONING_EFFORT_NONE there, sent as none); image input from its "image_in" capability. Context is capped at the standard 262,144 as before: XL is an X-Kimi-Context-Length header the desktop sends only when the user picks extended, and this doesn't send it. - An id both list keeps /models' row under the menu's name. Either list failing leaves the other; both failing, or the menu empty with /models failing, throws, so magpie keeps the last good list. - The reply is read in camelCase and in the proto's snake_case names. The fixture (tests/fixtures/work-config.shape.json) is the reply's shape from the proto descriptor and the desktop's mapping code. No reply was captured from an account; k3d1-pro in it is a placeholder id, and the fixture says so. Run: bun test packages/kimi-work (46 pass, 0 fail); with the menu call turned off by hand in index.mjs the two new list tests go red (44 pass, 2 fail); bun scripts/check.mjs kimi-work ok; git diff --check clean. Not tried: a real Work account (none on this machine or the Windows box), so neither the menu's reply nor a chat request with K3.1 Pro's id through agent-gw has been seen. The model-speed header (X-Kimi-Model-Speed) is not sent either. |
||
|
|
da079585d9 |
qoder 0.2.33: a request's task name is the prompt's first ten characters, as Qoder's own client sends, not "magpie session" (#354)
business.name went upstream as "magpie session" on every request. Qoder.app
0.4.3's worker runtime (qoder-agent-sdk qoder-worker-runtime.obf.mjs) names a
task by its prompt sliced to 10 characters (the session id only for
code_review). The plugin now does the same with the task's first user
message, kept for the task's whole tool loop. Nothing old is read back from
Qoder for this field, so existing sessions are unaffected.
Run:
- no-magpie.test.mjs: qoder and qoder-cn, sessions "", "magpie-…" and
"dsh-session-1"; URL, headers, wire body and decoded body hold no
"magpie"; short, long and Chinese prompts; name kept through tool calls.
All 7 red on the old code, green now.
- bun test (package): 209 pass. bun scripts/check.mjs qoder: ok.
- Live, sandbox HOME, the owner's Qoder account (auth.set stubbed, token
not refreshed): model "efficient", 200 with a streamed reply; business
{"name":"Reply with",…}; 11 requests recorded, none naming magpie.
Not tried: qoder-cn live (no CN account).
|