Commit Graph
244 Commits
Author SHA1 Message Date
yetone 169e4e607c workbuddy 0.1.19: an enterprise account's card shows its credits, from the enterprise meter WorkBuddy's usage page reads (magpie #1904, CnsMaple)
An enterprise (team) account's /billing/meter/get-user-resource-summary
answers with an empty Packages list, so the card had no window and no
error ("暂无额度数据"). WorkBuddy's own usage page reads
/billing/meter/get-enterprise-user-usage for such an account, which
answers credit / limitNum and the cycle's start and reset (UTC+8).

auth.usage now asks the enterprise meter when the summary gives no
credits, and shows a Credits window of credit used of limitNum, resetting
at cycleResetTime, with span from cycleStartTime; plan "Enterprise" when
the sign-in has none. A personal account's refusal of that meter (400
10001 "uid or enterpriseID is empty", seen on a real WorkBuddy AI account)
leaves the card as the summary said. An account with packages never asks
it.

Run: HOME=$(mktemp -d) bun test (1172 pass), bun scripts/check.mjs.
The new enterprise test uses the reporter's two answers byte for byte;
with the fallback turned off it fails (no window, plan Free). A real
personal WorkBuddy AI account's usage read through this index.mjs is
unchanged (same window, no enterprise request). Not tried with a real
enterprise account: none here.
2026-10-13 11:39:45 +08:00
yetone 7b09c423c8 trae 0.2.10: the sign-in page offers the enterprise (SaaS) sign-in (@shad70w0 on X)
@shad70w0 on X: "magpie + Trae 插件实测没办法走企业订阅" - a Trae enterprise
subscription couldn't be used through this plugin. The sign-in URL sent
hide_saas_login=true (copied from the relays in 6c048c7), which hides the
enterprise/SSO sign-in on www.trae.cn/authorization and
www.trae.ai/authorization, so an enterprise user could only sign in as a
personal account.

What changed:
- the authorization URL sends hide_saas_login=false.
- traeHost: a host a sign-in names is taken only when it is a well-formed
  https host (no port, credentials, query) on trae.cn, trae.ai or
  mchost.guru; anything else is ignored and the consumer host used, as
  before.
- Trae CN: a sign-in host on mchost.guru / trae-api-*, or another trae.cn
  host than www/api/grow*, is the account's model host. Trae Global: a
  trae.ai host other than www/api-*/grow* is too, after the existing
  US/coresg rules. Personal hosts (api.trae.cn, api-us-east, api-sg-central,
  growsg-normal, coresg-normal) route as before.
- the sign-in's host (host), a token host the callback names (authHost /
  auth_host / userInfo.AuthHost, on the realm's own domain only) and the
  userInfo's tenant/enterprise/login-type fields (account; no field that
  looks like a secret) are kept in the auth record. Renewal (sign-in and
  refresh) goes to authHost when one is kept. Nothing new is sent.
- README: enterprise sign-in is offered, not tried with a real enterprise
  account.

Run: bun test in packages/trae (103 pass, 6 new in enterprise.test.mjs);
the whole repo's bun test with HOME under a scratch TMPDIR (1168 pass, 0
fail); bun scripts/check.mjs. Each change broken by hand turns
enterprise.test.mjs red: hide_saas_login back to true, no enterprise CN
host, no domain check, http allowed, refresh at the consumer host, no
account kept, api.trae.cn taken as a model host, a secret-looking field kept.

Not tried: no real enterprise account. Which host(s) and fields an
enterprise sign-in sends back is unknown; the hosts in the tests are made
up, and whether the callback ever names an auth host is a guess.
2026-10-13 11:13:49 +08:00
yetone f98026557e grok 0.1.14: a window offered without a k (grok-4.7@131072) asks Grok for that model at that window (yetone/magpie#1679)
labelOf writes a window no multiple of 1000 as its digits alone, so
windowsOf offers grok-4.7@131072 beside grok-4.7@500k. modelOf read only
"<n>k", so that id went to Grok as an x-grok-model-override of its own
("grok-4.7@131072", a model Grok doesn't list) with no
x-grok-context-window. It now reads the digits as the window itself, and
a k as thousands, as the built-in's grokWindowed does after
yetone/magpie#1679 (ggbdpq's patch). An id with no model before the @,
or a window of 0, is no window, as the built-in reads it.

Not tried against Grok: today every window xAI lists is a multiple of
1000, so no real model is offered without the k.

Run: TMPDIR and HOME set to an empty scratch dir, bun test
packages/grok: 41 pass, 0 fail. The new test FAILs with modelOf put
back (expected { model: "grok-4.7", window: 131072 }, got the id as a
model with window 0). node --check packages/grok/index.mjs, bun
scripts/check.mjs grok and git diff --check are clean.
2026-10-13 09:53:12 +08:00
86b4760f55 factory 0.1.24: a session continued after Claude Code compaction reaches Factory (#66)
* factory 0.1.23: a resumed turn's restored skills reach Factory wherever they sit

#68 took 0.1.22, so this moves to 0.1.23.

Claude Code 2.1.292 session 1a2063e5 is the turn Factory answered 403.
Its transcript renders the post-compaction attachments, in order, as system
reminders: a token marker, a restored Read and its result, an omitted-file
note, the invoked-skills reminder, the agent-type list, MCP server
instructions, the environment paragraph and the model line. No token marker
follows the skills reminder. The snapshot's contextRendering is "announced",
so the same paragraphs also travel unwrapped in one system turn. The request
bytes were not in the routing log; the fixture is those rendered paragraphs,
unwrapped, in that order.

announcedContext used to reassemble the reminder only when a token marker
came right after it, and then treated everything up to that marker as skill
text. A reminder at the end of the turn, or followed by a Read, the
environment or a hook, kept the refused opening. A reminder with other
attachments and a later token swallowed those attachments into the skill
encoding.

The refused part is the fixed opening plus the complete IMPORTANT paragraph.
That complete reminder is rephrased wherever it sits. Skill text now ends at
the next paragraph the adapter already knows (token marker, hook, restored
Read, omitted-file note, Read result, environment, model line, skill-list
header, changed-file note, agent-type list, MCP instructions) or at the end
of the turn. Those following paragraphs stay themselves and are adapted on
their own. A second pass is byte-for-byte. Quoted fragments, an incomplete
IMPORTANT paragraph, a hook that owns the reminder and assistant content stay
untouched.

0.1.22 was not tried against Factory: the installed copy stayed 0.1.21, and
this change was not sent to Factory either.

Run: HOME set to an empty temp dir, bun test packages/factory: 120 pass,
0 fail. node --check packages/factory/index.mjs, bun scripts/check.mjs
factory, and git diff --check are clean. The new test covers the captured
order plus a reminder at the end of the turn, a reminder followed by Read,
environment and a hook, and a quoted skill body. Fetch is stubbed.

* factory 0.1.23: restored skills open a resumed turn without token metadata

A resumed turn can start with the complete invoked-skills reminder when no
files were restored and totalTokensReminder is off. restoredContext now
recognizes its exact opening and IMPORTANT paragraph through the existing
invokedSkillsMatch and attachment boundaries. A restored-file opening can
also use the complete skills reminder as evidence when it ends the turn.
Adapted openings, incomplete reminders, quotations and hook-owned output
retain their existing behavior.

Cover no-token system turns and folded user text on inference and token
counting, including standalone reminders, trailing tokens, omitted-file and
Read prefixes, exact skill decoding, cache metadata and byte-for-byte second
passes. Each of the six boundaries missing independent regression coverage
now follows a quoted skill directly. README documents the no-token forms.

Run with HOME set to an empty temporary directory: bun test packages/factory,
121 pass, 0 fail. node --check packages/factory/index.mjs,
bun scripts/check.mjs factory and git diff --check pass.
Removing each of the omitted-note, Read-result, model, skill-list, MCP and
changed-file boundaries makes the new independent regression test fail.
The whole-project test suite is left to CI. Fetch is stubbed; no request was
sent to a real Factory account.

* factory 0.1.24: main already published 0.1.23 (#71), so this change takes the next version

#71 shipped factory 0.1.23 while this PR waited, so npm has 0.1.23. This
only moves the version, so the squash publishes as 0.1.24.

Run: merged onto main a885a16, HOME=<scratch> bun test packages/factory:
124 pass, 0 fail; bun scripts/check.mjs: all pass.

---------

Co-authored-by: chenguoqing <chenguoqing@kemai.cn>
Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-13 09:05:49 +08:00
yetone a885a16190 cursor 0.2.10: a Team member with no limit of their own spends the team's on-demand pool, which is shown and counted as the limit, not as unlimited (yetone/magpie#1868)
PaSSw0rds' Team account has on-demand turned on for the whole
organization: spendLimitUsage has no individualLimit, pooledLimit
"45120000" and pooledRemaining "38785730" are int64 strings, pooledUsed
6334270 a number, and GetHardLimit answers {"hardLimit": 451200} with or
without a team id. onDemandOf read that as "unlimited", as cursor-agent's
own usage view does, so the On-demand row showed only the member's own
$198.55 at 0%, and a spent team pool never counted the account used up.

Now a team member with no individualLimit and a pooledLimit > 0 gets a
fixed On-demand window on the pool: used = pooledUsed / pooledLimit,
display "$63,342.70 / $451,200.00 (you: $198.55)", not aside, so magpie
stops routing to it when the pool is spent. A hard limit that forbids
on-demand still reads as disabled; a team with no pool and a hard limit
still reads as unlimited. Dollar figures group thousands.

Run: bun test in packages/cursor (86 pass), bun scripts/check.mjs (exit 0).
The new test, built from the payloads quoted in yetone/magpie#1476, fails
on the old index.mjs (On-demand "$198.55", used 0, aside) and on a fix
that shows the member's spend against the pool instead of the pool's own.
Not tried against a real Team account.
2026-10-13 06:00:37 +08:00
yetone 9814cca34d workbuddy 0.1.18: a desktop sign-in WorkBuddy 5.6+ keeps encrypted says so and points to the browser sign-in, not "isn't signed in" (#18)
seavenlin on #18: on WorkBuddy desktop 5.8.1 the tokens in
workbuddy-desktop[-ai].info are sealed ({$wbEncrypted: 1, envelope}), so
the desktop sign-in failed as "isn't signed in" while the app was signed
in, and one made before the app sealed it fell back to the built-in list
and its chats failed.

The sealed tokens are not opened (only the app opens them; #18's way of
running the app's binary to take its key is declined). Sign-in, usage and
chats now say the app keeps its sign-in encrypted and to use the browser
sign-in. The app's file is still only read.

Run: the new test fails on the old index.mjs and passes here; HOME=$(mktemp
-d) bun test for the repo, 1155 pass 0 fail; bun scripts/check.mjs green.
Not tried with a real WorkBuddy 5.8.1 install; the file shape is the one
in #18 and seavenlin's comment.
2026-10-13 04:46:47 +08:00
yetone 6579c01711 cursor 0.2.9: when the default's own branch stops short, an id of it asked past that goes as its nearest, not the default's id at the effort asked (#55)
With the default on the branch without thinking (thinking=false, low to
high) and xhigh only with thinking, claude-opus-5-low asked at xhigh went
as the default's slug with effort=xhigh: an id and parameters at odds.
branch() returned early whenever what was asked differed from the default
in the effort alone.

Decided: that early return now holds only when no variant at all is named
for the effort asked, so claude-opus-5-5-xhigh (no xhigh variant
anywhere) still goes at xhigh as a listed model does, and an effort
another branch has makes the default's branch go to its nearest.

Run: the new test (the issue's picker, plus every id x effort x fast
agreeing with its parameters) fails on the old index.mjs and passes here;
HOME=$(mktemp -d) bun test for the repo, 1154 pass 0 fail; bun
scripts/check.mjs green. Not seen on a real account (as the issue says).
2026-10-13 04:45:03 +08:00
yetone 0e2a52efdc trae 0.2.9: <toolcall> without the underscore is read as <tool_call>, and a reply that ends inside an opener is cut short, not the answer (#38)
XcodeFish's two leaks on 0.2.6, still on 0.2.8: glm-5.3-flash wrote
<toolcall></toolcall>, and a reply ended at "<tool_call name". Both went
out as the answer with a 200.

- The opener, close, leftovers and held marks take <toolcall> and
  </toolcall> too; an empty block is dropped as <tool_call></tool_call>
  is, one with JSON or parameters is a call, one that can't be read is
  the error it is for <tool_call>.
- At the end of a reply, an opener still open (<tool_call, <tool_call
  name) outside backticks or a fence ends the turn with the cut-short
  error.

Run: the issue's repro (A-G) on main and on this; the new test fails on
the old index.mjs (1 fail) and passes here; HOME=$(mktemp -d) bun test
for the repo, 1153 pass 0 fail; bun scripts/check.mjs green.
2026-10-13 04:40:26 +08:00
yetone 66facacf14 kiro 0.1.9: a tool's images reach the model, as the built-in sends them (yetone/magpie#1861)
What: buildKiro read a tool_result's content for its text alone, so an
image a tool returned (Codex's view_image, a computer-use screenshot,
Claude Code's Read of a PNG) never reached Kiro: the model got
"(no output)" and said it saw nothing. Its image blocks (base64) now go
with the message that answers the call, beside any image the user sent,
as magpie's built-in has sent them since yetone/magpie#369. Kiro's tool
results hold text alone. The "only the latest images" rule is unchanged;
an image named only by a URL still has no bytes to send and is left out.

Why: simonsmh reported Codex's view_image unreadable through Kiro on
magpie v0.1.1215 (#1861). A moved Kiro is served by this plugin, which
never got #369's fix.

Run: HOME=<scratch> TMPDIR=<scratch> bun test (1152 pass, 0 fail) and
bun scripts/check.mjs. tool-images.test.mjs's fixture is the Anthropic body
magpie's gateway hands the plugin for Codex 0.162's view_image output
([{"type":"input_image","image_url":"data:...","detail":"high"}]), dumped
from magpie's buildAnthropic; 3 of its 4 tests fail on 0.1.8. Not tried
against a real Kiro account (none signed in here); #369 checked the same
body shape on the built-in against a real account.
2026-10-13 03:40:07 +08:00
yetone caf3908eff workbuddy 0.1.17: a restricted account's 403 11140 says it is restricted, so magpie rests it for hours (magpie #1849)
WorkBuddy answers an account it restricted for "unusual activity" with
403 {"code":11140,"msg":"request illegal","displayMsg":{...}}. explained()
let it through as it came, so magpie saw "request illegal" and retried
the account every few minutes.

explained() now knows the restriction by its code 11140 (top level, under
data or error, number or string, matched whole so 111400 isn't it) or by
its displayMsg words, and ends the message with RESTRICTED_HINT, word for
word magpie's provider.WBRestrictedHint. magpie's routing rests an account
whose error carries that hint for 2h and tells it as restricted, with the
appeal as the way back. type permission_error, code 11140; the sign-in is
kept.

Run: HOME=$(mktemp -d) bun test (1148 pass, 0 fail), bun scripts/check.mjs.
refused.test.mjs uses the reporter's literal body. With detection removed
by hand, 2 of the new tests went red. Not tried against a real restricted
account.
2026-10-13 02:32:10 +08:00
yetone cb9093181d workbuddy 0.1.16: WorkBuddy AI's GLM models are text-only, so magpie's image-describing model reads their images (Yirasumi on Discord)
What: for the workbuddy-ai provider only, a model whose id starts with
glm- is listed without image input (capabilities.input.image and
attachment false), whatever /v3/config's supportsImages says.

Why: checked on 2026-10-13 with a real WorkBuddy AI account. Its
www.workbuddy.ai/v3/config marks every model supportsImages: true, but
an image sent to glm-5.3-flash, glm-5.3 or glm-5.2 is taken out by the
server and replaced with "[System reminder: the current model does not
support images. Content filtered. ...]". Its other models
(deepseek-v4.1-flash, kimi, gemini, grok, gpt) read images, and WorkBuddy
(China, copilot.tencent.com)'s glm-5.3-flash does too. Listed as taking
images, magpie sent them straight through and the model never saw them;
listed text-only, magpie's image-describing model reads them first. A
user who set the model's image support by hand in magpie keeps it
(magpie's ModelImages setting is applied over the provider's list).

Scoped by site (SITES["workbuddy-ai"].noImages = /^glm-/) and family,
not a list of three ids, so a later GLM on WorkBuddy AI is covered.

Run: TMPDIR=<scratch> HOME=<scratch>/home bun test in packages/workbuddy:
68 pass. The new test fails on the old index.mjs (glm-5.3-flash listed
with images). bun scripts/check.mjs green. Not run: a live chat through
the plugin with an image (the account check above was done before this
change).
2026-10-13 01:48:32 +08:00
yetone 49e9d89d59 commandcode 0.1.12: each plan lists only the models it may use; a Go account no longer lists GOAT's (01huadalang on Discord)
01huadalang, signed in on the Go plan, was shown models only GOAT and above
may use. Command Code's /provider/v1/models is the same 87 models for every
plan (read with a GOAT key and without one on 2026-10-13: the same but for
"created"); which of them a plan may use is the CLI's own table (command-code
1.79.2, evaluateModelAccess: each model's category, premium or open, and
each plan's allowedCategories and blockedModels), and the Provider API turns
the rest away only when asked (403 "MODEL_NOT_IN_PLAN: Claude Opus 5.5
available in Provider and above plans or extra on demand usage").

Cause: the plugin filtered Go's list by a copy of CLI 1.73.0's table, which
didn't have Claude Haiku 5.5 (1.79.2: "haiku 5.5 in goat plan", blocked for
Go), and didn't filter any other plan at all, so GOAT, Pro and Provider were
shown models their plan refuses (a real GOAT account listed all 87, Claude
Opus 5.5 and GPT-6 Sol among them).

Now:
- PLAN_MODELS is CLI 1.79.2's table by plan name: Go and GOAT the open
  models only, Go also blocked from GOAT's (Sonnet 5.5, Haiku 5.5, GPT-5.6
  Sol, Grok 4.6/4.7, Muse Spark 1.2/1.3, Gemini 3.7/3.8 Flash, MiMo V2.6 Pro
  UltraSpeed), Pro blocked from Opus, Fable, GPT-6 Astra, GPT-6.1 Sol and
  Fugu Ultra, Provider from GPT-6.1 Sol, Max/Ultra/Teams Pro everything.
  GO_REFUSED is derived from it. Blocks are by id: the CLI's own block of
  "vercel-ai-gateway:xiaomi/mimo-v2.6-pro-ultraspeed" misses its "cai"
  model, and Go stays kept off it as before.
- provider.models filters every plan's list (and the default list standing
  in when the list can't be read) by it.
- A plan not read (billing/subscriptions failing, nothing saved), "No plan",
  or a plan name the table doesn't know keeps the whole list.
- Bought or free credits (billing/credits) let every model, as the CLI does;
  credits not read are taken as last read, else none, so the plan's list
  stands and a model it leaves out is still refused by Command Code.
- The refusal itself is unchanged: the Provider API's 403 reaches the agent
  as it came, and on Go's endpoint failure() says "Model not in plan: …".

Tests: plan-models.test.mjs is new, built from real bytes in testdata
(models-2026-10-13.json, a GOAT account's subscriptions and credits replies
with its ids zeroed, the two MODEL_NOT_IN_PLAN refusals). The Go case uses
the GOAT reply with Go's planId: there is no Go account here. All 7 fail on
0.1.11. Broken by hand, each goes red: Haiku 5.5 unblocked for Go (Go test),
no plan filter (5 tests), credits ignored, an unread plan refusing premium,
the stand-in list unfiltered, credits unread taken as extra.
models.test.mjs's pictures test moves from Pro to Max, since Pro's list no
longer has Claude Opus 5.5.

Ran: TMPDIR=<scratch> HOME=<scratch>/home bun test (all packages, 1144 pass,
0 fail) and bun scripts/check.mjs commandcode. The new provider.models hook
against the owner's real GOAT account (saved plan and none) lists 66 models:
Sonnet 5.5, Haiku 5.5 and GPT-5.6 Sol in, Opus 5.5, Sonnet 5 and GPT-6 Sol
out; a 1-token request confirmed GOAT gets Haiku 5.5 (200) and is refused
Sonnet 5 (403 MODEL_NOT_IN_PLAN).
Not tried: a real Go account (none here), an account with bought credits,
and the new version inside a running OpenCode/magpie; magpie needs the
mover's min raised to 0.1.12 for moved users to get it.
2026-10-13 00:44:50 +08:00
yetone f573cfdcba qoder: Qoder's queue (code 10605) is a 503 to retry after its wait, not a lapsed sign-in (#98); 0.2.14
failure() turned every 401/403 into "the sign-in lapsed — sign in again".
Qoder answered every chat on a real trial account (2026-10-12) with
403 {"code":"10605","message":"{...\"retryAfterSeconds\":30,
\"serviceAvailable\":false...}"}: its queue for the model, while the same
token read the models and usage.

Codes are now read as Qoder's own client reads them (the QoderErrorCode
table in Qoder.app's qoder-agent-sdk worker), whatever the HTTP status:
- 10605, or a queue state with isQueued or serviceAvailable false: 503
  with Retry-After from retryAfterSeconds (30 when absent), no
  X-Magpie-Sign-In. magpie's gateway counts a 503 as busy and asks again
  after Retry-After (patience.go busy/noteBusy).
- 110, 112-119, 122 (usage/credits used up): 429.
- 406, 416, 430, 80411, 80412, 100400-100403 (refusals of the request): 400.
- 105 (loginExpired) or no code: the 401 as before.
Both the HTTP status path and the in-stream statusCodeValue path go
through failure(); errorResponse sends Retry-After.

Run: bun test (sandbox HOME) 1137 pass 0 fail; bun scripts/check.mjs ok.
busy.test.mjs uses the literal body as testdata; its 4 tests all fail
against the previous index.mjs and pass with this one. Not tried: a real
10605 after the change (the account's queue was open again by then: a
real chat on fast answered "ok"); the quota and request codes' HTTP
status from Qoder is not seen, only their meaning from Qoder's client.
2026-10-12 21:22:50 +08:00
yetone 04e188aaec qoder 0.2.13: an account lists the models Qoder's app shows, Fast (0.8×) among them, and keeps Performance (#97)
Qoder's model listing (/algo/api/v2/model/list) has a list per scene. The
plugin read only "chat", while its requests are sent as Qoder's app
(product and session_type "app"). On 2026-10-12 the app scene lists Fast
(key fast, 0.8×) where chat still lists Performance (1.1×), so magpie
showed Performance and never Fast, which Qoder's app shows (yygutn, #97).

The models hook now lists the app scene in its order and adds each model
only chat still lists after the model it follows there, so a pick of
Performance stays served. Each key once; the app's entry wins. A listing
with one scene gives that one. New app models show from the account's
own listing without a plugin release. The fallback list gains Fast.

Verified:
- The real listing read through the plugin on the owner's Qoder account
  (sandbox HOME, credential copied in memory, nothing written, no token
  renewed): fast "Fast" rate 0.8 and performance rate 1.1 both listed.
- models.test.mjs runs on that real listing (testdata/listing.json, the
  chat and app scenes); all 4 tests fail with modelInfos put back to
  listing.chat, and pass with the change.
- bun test (sandbox HOME/TMPDIR): 1133 pass, 0 fail. bun scripts/check.mjs ok.

Not verified: a real chat on fast. Every model on that account (fast,
performance, efficient, qfmodel) was refused with 403 code 10605
(serviceAvailable false, queueType p3, retryAfterSeconds 30) though the
trial has 143/300 credits; the plugin reports that as a lapsed sign-in,
filed separately. Qoder CN's listing wasn't read (no CN account).
2026-10-12 21:04:10 +08:00
yetone 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 (6a5dd01). magpie's gateway goes on
with an Anthropic or Responses reply that was cut short, but not with a
Chat Completions one. For those, the error frame after a 200 threw away
the reply the client had already been shown.

Now, when a chat stream loses Zed's stream_ended, the plugin looks at what
the choices already said:
- If no choice is still open, only [DONE] is added.
- If a choice said text or reasoning and has no tool call half written,
  each open choice gets the note and a `stop`, then [DONE].
- If nothing was said, or a tool call is still unfinished, it fails as
  before.
Anthropic, Responses and non-streamed replies are unchanged.

Run: HOME=$(mktemp -d) bun test packages/zed gave 31 pass. The whole
repo's bun test gave 1129 pass, 0 fail. bun scripts/check.mjs passed. On
the old index.mjs, the 2 new tests that cover the cut-short endings fail.
With the tool-call guard removed by hand, the tool-call test fails.

Not tried: a real Zed account (there is none to test with). The
upstream's cut can't be triggered.
2026-10-12 20:31:33 +08:00
yetone ff2d815249 commandcode 0.1.11: a streamed Go reply Command Code stops before its finish line ends cut short, with a note, instead of failing the turn (#91)
This is the sibling of zen-free 0.1.4 (6a5dd01). /alpha/generate's reply
is turned into a Chat Completions stream, which magpie's gateway can't go
on with, so the error frame threw away what the client was already shown.

Now a streamed reply that said something (text, reasoning or a tool call)
and then lost its finish line ends with the note, a finish (`stop`, or
`tool_calls` after a call) and [DONE]. Tool calls arrive whole here, so
none can be half written. A reply that said nothing, or one that wasn't
streamed, is still a 502, so magpie retries it.

Run: HOME=$(mktemp -d) bun test packages/commandcode gave 37 pass. The
whole repo's bun test gave 1129 pass, 0 fail. bun scripts/check.mjs passed.
On the old index.mjs, 3 of the 4 new tests fail. With the cut branch
disabled by hand they fail again.

Not tried: a real Go account. The owner's two Command Code accounts aren't
on Go, and the real upstream can't be made to cut a stream. A streamed
request through the patched loader on those accounts still takes the
Provider API path, which this commit doesn't touch.
2026-10-12 20:31:33 +08:00
YuCreate 80bd2d9241 workbuddy 0.1.15: normalize chat request fields (#96) 2026-10-12 20:26:02 +08:00
yetone 6f1605f01d grok: the login and refresh tests' fake CLI is /bin/sh, not a script just written, so a busy Mac doesn't time them out (#65)
What waited was not a timer in the tests. On macOS the first run of an
executable just written waits for the system's scan of it: 4-15s each
here on a busy machine (a fresh `#!/bin/sh` file timed at 3.8-15.4s on
its first run, 0.00s after; a hard link or symlink to a scanned file, or
the same file read by sh, 0.00s). login.test.mjs wrote a new fake per
test, refresh.test.mjs one per file, so each paid it inside a test.

The fake grok is now a symlink to /bin/sh, and the plugin's own
`grok models` / `grok login --device-auth` become `sh models` /
`sh login …`, which read a plain script in the folder the plugin runs
the CLI in (root above the account's home; the home folder for login,
which login.test.mjs now only uses when HOME is a temp home). No
timeout was raised; refresh's `sleep 0.2` (for the joined-run test)
stays.

Run:
- With 14 `yes` burners of mine (load ~45): origin/main's two files
  5 and 6 fail (bun's 5s), this commit 0 fail in 1.5-1.9s, 3 runs.
- Idle: 10 pass, ~1.2s, 3 runs. Linux (oven/bun:1.4.2, /bin/sh = dash):
  10 pass.
- Broken by hand: links not taken (1 red), the CLI's last line not the
  reason (2 red), renewals not joined (1 red).
2026-10-12 18:22:47 +08:00
yetone b033987516 zen-free: a declared name of separators only matches only itself, and the unused injected set is gone (#76 follow-up, tkhs101)
foldsTo kept a declared name whose fold is "" (an agent declaring "_"),
so any call of separators only ("--", "-", "__") was handed that tool:
an empty fold matching an empty fold, not a name matching a name. Such a
name is now skipped in the fold maps, so it matches only itself and the
other calls are left out with the note like any unknown name.

normalizeTools still built and returned `injected`, which nothing has
read since the guard folds over `declared` alone; it is gone. The "Never
call this tool" stubs are sent as before.

Run: packages/zen-free `bun test` 162 pass; the new test goes red with
the foldsTo change taken out. Whole repo `bun test` (temp HOME and
TMPDIR) and `node --test packages/zen-free` pass; `bun scripts/check.mjs
zen-free` ✓. Rides in 0.1.4 with the #91 change.
2026-10-12 18:18:36 +08:00
yetone 6a5dd01d5d zen-free 0.1.4: a streamed Chat reply Zen closes before its [DONE] ends cut short, with a note, instead of failing the turn (#91, tkhs101)
Zen now and then closes a space-bunny-free Chat Completions stream after
some frames, with no finish_reason, usage or [DONE] (~0.1% of turns in
the reporter's logs). The tool guard turned that into an error frame at
the end of the 200 stream, so the agent threw away the reasoning and text
it already had, and magpie can't ask a Zen Chat reply to go on.

Now, for a client that streams, a Chat reply cut short that has said
something (text or reasoning) and has no tool call pending ends as an
ordinary answer: each open choice gets the note "(The reply was cut
short: Zen closed the stream before it finished. Ask again to go on.)"
and finish_reason "stop", then [DONE]. A reply whose every choice had
finished only gets its [DONE]. It still fails when a tool call is
pending (its arguments may be half written), when nothing was said
(an empty reply), and when the reply is collapsed for a client that
doesn't stream (nothing reached the client yet, so magpie can ask
again). Anthropic Messages and Responses streams cut short still fail:
magpie's gateway tells such a reply from a whole one itself (#370) and,
for an Anthropic upstream reached through translation, goes on with it
(continuation.go); a made-up message_stop or response.completed here
would stop that. The error that remains names the reply's id, the
events and bytes received, and an unfinished tool call, as the reporter
asked. The README also says the free tier needs tools, which is why the
five core tools are sent.

Run: packages/zen-free `bun test` and `node --test` (161 pass). The new
tests use the reporter's three frames byte for byte, at chunk sizes 7, 31
and 4096; all 6 go red on the old tool-response.mjs/provider.mjs.
Broken by hand: dropping the pending-call check turns the "still fails"
test red; ending cut short for non-streaming clients too turns the loader
test and the "still fails" test red. Whole repo `bun test` with a temp
HOME and TMPDIR: 1109 pass. `bun scripts/check.mjs`: all ✓. Through the
plugin's loader against a node fake upstream on 127.0.0.1:3720 that sends
role, reasoning and two text frames 50 ms apart and FINs: streamed → 200
with the text, the note, stop and [DONE]; not streamed → 502 "Upstream SSE
ended without a completion marker (reply x2, 4 events, 659 bytes
received)". Not run: real Zen (the cut can't be provoked) or magpie's
plugin host.
2026-10-12 18:18:35 +08:00
moxuunandyetone 01fdc091c0 grok 0.1.13: import a CLIProxyAPI (CPA) xAI account from its file (#92)
* grok 0.1.13: import a CLIProxyAPI (CPA) xAI account from its file

CPA (CLIProxyAPI) keeps each of its accounts in ~/.cli-proxy-api as a flat
JSON file: {type: "xai", auth_kind: "oauth", access_token, refresh_token,
expired, last_refresh, sub, email, disabled, …}. Its xAI accounts sign in
with the same OAuth client Grok Build does, so such an account is a sign-in
Grok Build can hold — but the plugin could only take the CLI's own sign-in
or make a new one, so an account that lives in CPA could not be used here.

The third sign-in method takes the path to one of those files, reads it and
writes Grok Build's own shape (key, auth_mode: "oidc", create_time,
user_id, email, refresh_token, expires_at, oidc_issuer, oidc_client_id)
into a home of the plugin's own, as a device-code sign-in does. The
imported file is only read, and only the fields above are carried over:
base_url is not honored and expires_in is not turned into a lifetime
measured from the import.

A file is refused, before any home is made, when it is not an enabled
(type xai, auth_kind oauth, not disabled) xAI account with tokens, identity
and timestamps, or when the token's own iss/aud are not the Grok Build
xAI ones. The refresh token rotates and both clients would spend it, so the
prompt and the README say to stop using the account in CPA first. Nothing
here refreshes a live token or touches CPA.

bun test: 39 pass on the grok package (4 new in import.test.mjs: the
translated home, the refusals, no Grok Build, and a home that can't be
made). bun scripts/check.mjs grok and node --check pass.

* grok: string timestamps, and import.test.mjs off POSIX

`Date.parse` coerces, so a `last_refresh` or `expired` that was a list or an
object read as a date: the file must say a string before it is parsed.

The test's fake CLI is named for the platform (`grok.exe` on Windows), PATH
joins with the platform delimiter, and the 0600 file is only checked where
POSIX gives it. The mkdir that fails is what the last test covers, not the
cleanup after a write that fails, and it now says so.

* grok: the import's placeholder names the file CPA writes, xai-<email>.json (review of #92)

CLIProxyAPI's xAI sign-in saves each account as xai-<email>.json
(internal/auth/xai/token.go CredentialFileName), not cpa_*.json.
Text only; import.test.mjs still 5 pass.

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-12 18:16:23 +08:00
yetone 08614da5c5 cursor 0.2.8: an empty reply says what the Run sent before it (#60, congee949)
An "an empty reply" (502) said nothing of why, so #60's 14 empty replies
on grok-4.7-fast over seven days can't be told apart: a turn of thinking
only, a turn spent asking for Cursor's own tools (which the plugin
refuses), something Cursor now sends that decode doesn't read, or an end
frame that carried words without a Connect code (which failure() treated
as a clean end and dropped). Its message now names them, e.g.

  an empty reply (Cursor ended the turn; after 31 chars of thinking, no
  text and no tool call; Cursor counted 41 output tokens; Cursor's own
  tools asked for and refused: #14; try again)

and, when the stream itself ended, the end frame's JSON (cut at 300
chars). Field numbers are agent.v1's. Status, retry and behaviour are
unchanged: magpie's gateway retries on the 502, not on the words.

Run: HOME=<tmp> bun test, 1103 pass, 0 fail (a first run under load
average 16 had 7 bun 5s timeouts in other packages' CLI/login tests,
#65's class; the rerun was green); bun scripts/check.mjs cursor passes.
The two decode tests go red with the old index.mjs. Through the plugin's
loader against a local HTTP/2 fake Run (thinking, an own-tool exec,
TurnEnded, no text): the unstreamed 502 and the streamed error frame
both carry the message above. Not tried against real Cursor: no cause is
proved; this is to name it on the next occurrence.
2026-10-12 18:14:57 +08:00
yetone d2be892d70 zcode 0.1.16: the ZCode app's sign-in follows ZCode only while it is signed in to the same account (LingYi_Stu on X)
The app's sign-in stores the account ZCode is signed in to, and stateOf
read ~/.zcode/v2 again for every request. After ZCode switched to account
B and the app's sign-in was added again, both entries read B's
credentials: A's sent B's requests and its usage card showed B.

stateOf now follows ZCode's own credentials only when ZCode's user is the
entry's accountId. Otherwise (ZCode signed out, or on another account) it
uses the snapshot saved at sign-in, which holds the coding plan key, the
Start Plan JWT, the team project and the device. A snapshot whose JWT has
run out says EXPIRED (sign in again), as a lapsed sign-in already did,
instead of borrowing B's session.

own.test.mjs: two app sign-ins (A, then B) with ZCode on B; A's request
carries A's key and no request (messages, plan, usage) carries B's key or
JWT; and A with only an expired JWT says sign in again without sending
B's. Both fail on 0.1.15 (A sent idB.secretB; the expired case was served
with B's JWT). The first test now keeps the account's user_info as ZCode
signs in again. HOME=$(mktemp -d) bun test packages/zcode: 79 pass.
bun scripts/check.mjs zcode passes.
2026-10-12 14:41:07 +08:00
yetone 7e67b980aa commandcode 0.1.10: a Go request says the agent's folder and git repository, not the home's (#86)
Found beside #86. A Go key's chat completion goes to /alpha/generate with
the CLI's config, which said workingDir: homedir() and isGitRepo: false
whatever folder the agent worked in. It now takes the folder and the git
state magpie tells the plugin's fetch (x-magpie-work-dir,
x-magpie-work-git). Untold, it is the CLI's config outside a project in
the home, as before (a git word without a folder means nothing). The
headers are taken off every request, the Provider API's too.

Run: bun test in packages/commandcode (33 pass, new workplace.test.mjs),
bun scripts/check.mjs commandcode. With the old index.mjs both new tests
fail. Not tried with a real Go account.
2026-10-11 21:36:02 +08:00
yetone baa788b1e4 zcode 0.1.15: a Start Plan request says the agent's folder, not magpie's, and leaves out what it doesn't know (#86, Hipple)
The plugin runs in magpie's plugin host, so process.cwd() is magpie's own
folder (C:\Users\<user>\.config\magpie on Windows). The Start Plan's
"# Environment" section said it as "Primary working directory", with a
constant "Is a git repository: no" and magpie's shell, and the model went
looking in magpie's folder.

Now the folder and the git state are the agent's, as magpie tells the
plugin's fetch in x-magpie-work-dir (percent-encoded) and
x-magpie-work-git (yes/no) (yetone/magpie, provider.WorkDirHeader). Each
line is left out when magpie doesn't tell it (an older magpie, an agent
that names no folder, a folder not on this computer). The Shell line is
gone: the agent's shell isn't known here. Platform and OS Version stay;
they are this computer's, as the X-Os-* headers already say. The headers
are taken off before anything is sent, on the coding plan too.

Run: bun test in packages/zcode (77 pass), bun scripts/check.mjs zcode.
With the old index.mjs the new tests fail (6 fail). One real request
through the plugin with the owner's z.ai account (coding plan; its Start
Plan balance is empty, so the dressed Start Plan path was not tried
against the real service): 200.
2026-10-11 21:36:02 +08:00
yetone f0274d69f7 workbuddy 0.1.14: the Credits window says when the soonest credits left run out (runsOutAt, runsOut), for magpie's smart routing to spend those first (cdredfox on X)
cdredfox: with several WorkBuddy accounts in one smart routing group, the
account whose credits expire soonest should be used first. WorkBuddy's own
client lists each package with its end (the billing page's paid and free
package lists); the plugin now reads them too.

- /billing/meter/get-user-resource-paid-packages and -free-packages, asked
  as the client asks: PageSize 200 up to 10 pages, Status [0,3], its
  COMMODITY_CODES (without them the API answers 10001 "PackageCodes
  required"), NeedRenewInfo / today's SlicePeriod (UTC+8).
- A package's end is DeductionEndTime, else ExpiredTime, else CycleEndTime
  read as UTC+8 (the API's own DeductionEndTime for the same package says
  so). Only packages the summary counts, with credits left; the daily Free
  Plan slice (CapacityType 4, code 001) is left out, since it ends at the
  same midnight on every account.
- The soonest end goes on the Credits window as runsOutAt (RFC 3339) and
  the credits lost then as runsOut. A list that can't be read leaves both
  out; the card stands as before.

Run: HOME=<tmp> bun test in packages/workbuddy, 63 pass (3 new); with
index.mjs back at 0.1.13, 2 of the 3 new go red. Tried live on a real
WorkBuddy AI account: packagesOf + runsOutOf gave the Bonus Pack's 232.4
credits ending 2026-10-12T16:39:27Z, before Pro's 10-28T16:40:52Z, with
the Free Plan slice left out. Not tried on a CN workbuddy account (its
stored token here is stale); the paths and body are the same on both.
2026-10-11 19:39:13 +08:00
8260d97941 grok 0.1.12: a model Grok lists at two windows is offered at each (#83, guoqchen1001)
* grok 0.1.12: a model Grok lists at two windows is offered at each

context_window stays the plain id, so a saved grok-4.7 keeps the default
256k window. Each other size in context_windows is listed beside it
(grok-4.7@500k) with that window. A request for it sends the plain model
and x-grok-context-window: 500000, which is the window a client such as
Claude Code compacts against. The proxy serves up to its largest window
either way and refuses past it.

* grok: a window model's api.id keeps its @size, so x-grok-context-window is sent

The models hook gave grok-4.7@500k the api.id grok-4.7. magpie
(internal/provider/plugins.go, modelAPIID + withModel) and OpenCode's AI
SDK both put api.id in the request body, so the plugin's fetch only ever
saw grok-4.7 and never sent x-grok-context-window. api.id is now the
offered id; fetch strips the window (modelOf) before Grok sees the body.

Run: HOME=$(mktemp -d) bun test packages/grok (35 pass);
bun scripts/check.mjs grok. The new round-trip test (models hook ->
api.id -> fetch) is red on f4872fb and red again with the body rewrite
removed by hand. Real use against the owner's Grok account (copied
home): /v1/models lists 4 models at 256k and 500k; grok-4.7 and
grok-4.7@500k each answered 200, the latter with x-grok-context-window:
500000 and model grok-4.7 in the body.

---------

Co-authored-by: chenguoqing <chenguoqing@kemai.cn>
Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-11 19:37:48 +08:00
yetone 379ec96615 cursor 0.2.7: an assistant turn's reasoning_content is kept across a tool continuation (#82, nicegui)
Releases #82 (126b105): a Chat request's assistant reasoning_content (or
reasoning) goes into the next Run's transcript as an AI SDK reasoning part,
beside the text and tool calls, also when a turn's parallel calls are split
over two assistant messages; the input estimate counts it.

Run: bun test packages/cursor (83 pass), bun scripts/check.mjs. Live with a
real Cursor Pro account through this fetch: a tool continuation carrying
reasoning_content answered 200 on auto, claude-haiku-5-5-thinking and
gpt-5.5.
2026-10-11 19:03:32 +08:00
niceguiandluolingpeng 126b105df1 fix(cursor): preserve assistant reasoning across tool continuations (#82)
Co-authored-by: luolingpeng <luolingpeng@lovart.ai>
2026-10-11 19:02:58 +08:00
yetone da7e2f67a5 zen-free 0.1.3: a call of a tool the agent doesn't have is left out with a note, not a failed turn (#76, tkhs101)
#76: Zen's free models sometimes call a tool by a name the agent never
declared (tkhs101's table: bedit, bcp, ash, mcp__netcatcatty__unused,
beside declared edit, bash, mcp__netcatty-external__list_hosts). The
guard answered each with "Upstream called a tool not declared by the
client", which failed the whole turn. The rows without a name are from
before 0.1.1 (published 10-10 11:51 UTC), which added the name.

Now such a call (or one with no name) is left out of the reply instead:
- chat: dropped from tool_calls/function_call; the reply's content says
  "(The model called a tool this agent doesn't have: "bedit". The call
  was left out.)"; kept calls are renumbered from 0; finish_reason
  becomes "stop" when no call is left, including a repeated finish.
- responses: the function_call item becomes a message item with the
  note (added, text deltas, done, and in response.completed); its
  argument events are not passed on.
- anthropic: the tool_use block becomes a text block with the note; its
  input deltas are not passed on; stop_reason tool_use becomes end_turn
  when no call is left.
A call of an unsupported type (custom tools, non-object input) still
fails as before.

Run:
- bun test packages/zen-free: 155 pass, 0 fail; node --test
  packages/zen-free/*.test.mjs: 155/155; bun scripts/check.mjs zen-free.
- The new tests on the old tool-response.mjs: 35 fail.
- Breaking the finish rewrite by hand: 5 fail.
- Chat stream fixtures use the shape a live step-5-preview-free stream
  sent (name whole in the first delta, arguments in pieces, two
  tool_calls finishes). Zen sends names whole, so the names in #76 are
  the model's own; a real misnamed call was not reproduced live.
2026-10-11 08:06:44 +08:00
yetone bcc94e5933 aider: Aider's own icon (aider.chat's) on its market card, plugin row and Agents row; 0.1.1
The market card showed the generic agent glyph: neither the registry nor
the package gave a picture. package.json's magpie.icon gives it to the
market card (magpie reads it from npm), and agent.icon to the agent magpie
adds. Ran: bun test packages/aider, bun scripts/check.mjs; the URL answers
200 image/png.
2026-10-10 23:19:06 +08:00
yetone 6aca699263 registry: Aider (agent-aider 0.1.0) under Agents, the market's first agent
Checked on npm first: npm view @magpie-community/agent-aider@0.1.0 resolves
(published by publish.yml over OIDC, 6e72030).
2026-10-10 22:58:15 +08:00
yetone 6e720301aa agent-aider 0.1.0: Aider as a magpie agent plugin, the first of the new agent kind (#78)
magpie (cb406c84) lets a plugin add an agent it has no setup of its own
for. This one writes Aider's ~/.aider.conf.yml: the model under litellm's
openai/ prefix, magpie's /v1 and Aider's own key. check.mjs skips agent
packages as it does middleware; README gains an Agents section.

Run: bun test packages/aider (2 pass); bun scripts/check.mjs; the module
loaded through magpie's agentplug.Compile and its connect returned the
three keys. The same module, in a sandbox magpie, wired a real aider
0.86.2 that answered from a real DeepSeek account, and Disconnect put
the file back byte for byte.
2026-10-10 22:52:47 +08:00
yetone 98e91cc4a2 zen-free 0.1.2: a model Zen no longer gives free is answered 404 naming the free ones, and one made free since is served (Jeremy.Zhou on magpie's Discord)
Jeremy.Zhou asked that dropped free models leave the list by themselves
and new ones join it. The list was already read from Zen's /models each
time the host lists models (magpie's start, refresh, and now its hourly
relist), with the last list kept when Zen's can't be read. Two request-time
gaps remained:

- A model not in the list (Zen dropped it) threw, which the host reports as
  a transport failure, so magpie rested the whole account. It is now a 404
  not_found_error, "Model X is not available as an OpenCode Zen free model
  now. Free models: ...", which magpie reads as that model alone refused.
- After the first list, a model not in it never asked Zen again, so one
  made free since stayed refused until a relist. Now it asks again, at
  most once a minute, so a hand-typed id doesn't list on every request.

A model on the wrong protocol still throws as before. README's Models
section says how the list stays current.

Run: bun test in packages/zen-free (32 pass; 3 of the new tests fail on
0.1.1's provider.mjs), bun scripts/check.mjs (ok). Real use against Zen
with the public key: glm-5-free gets the local 404 listing Zen's 11 free
models, big-pickle answers 200.
2026-10-10 22:51:40 +08:00
yetone f2e6f87984 zen-free: the CRLF event-limit test gets 60s, not bun's 5s
The test sends a 32 MiB SSE event through guardToolResponse twice (64 MiB
in all). On a loaded machine (load average ~110) it ran past bun's default
5s and failed, though it passes on an idle machine and on CI. The timeout
now leaves room for load; the assertions are unchanged.

Run: bun test in packages/zen-free (all pass).
2026-10-10 22:50:33 +08:00
yetone 1897d34ce3 devin 0.1.14: a week used up shows at 100% beside the day, and holds the account until the week's reset (面条 on magpie's Discord)
Devin plans billed by quota have a daily and a weekly quota. GetUserStatus
answers in proto JSON, which leaves a 0 out, so a week with nothing left
came as no weeklyQuotaRemainingPercent at all beside the day's 100. usage
skipped a window whose share was left out, so the card showed "1 day 0%"
alone and magpie's routing, seeing no full window, kept sending to an
account Devin refuses until the week resets.

On a BILLING_STRATEGY_QUOTA plan a window with a reset time and no share
is now used up (100%, its reset kept), so routing holds the account until
then. A hidden quota and one with no reset are still not shown, and a plan
billed otherwise still has no quota windows from a share left out.

usage.test.mjs: the new test (the week left out beside the day's 100, and
both left out) fails on 0.1.13 and passes now; the old test that took a
left-out share for "no quota" on a quota plan is replaced.
HOME=$(mktemp -d) bun test packages/devin: 50 pass, 0 fail.
bun scripts/check.mjs devin passes. Against the owner's real Devin Teams
account (read-only GetUserStatus): both windows are read as before
(1 day 0%, 7 days 1%), so present shares are unchanged. A real account
with the week used up wasn't available; the left-out field is how the
reporter's card lost its week.
2026-10-10 20:38:54 +08:00
yetone d335db0a6e cline 0.1.7: ClinePass limits that fail to read say why on the card, and limits read are kept when the balance fails (#79, AkaChou)
usage read /users/me/plan/usage-limits with .catch(() => null), so every
failure there (401, 403, 429, 5xx, a timeout, a {success:false} envelope)
looked like an account without ClinePass: the card showed the balance
alone and said nothing. Only a 404 means no ClinePass (AxonHub's Cline
checker reads it the same way); any other failure now sets the usage
error "ClinePass limits couldn't be read (HTTP n: ...)" beside the balance,
the sign-in kept. clineApi's errors carry the HTTP status for this.

When /users/me or the balance failed, usage returned an error alone and
dropped the limits already read. Now the windows read are returned with
no error when the balance can't be; a failed /users/me still tries the
signed-in account's uid for the balance, and only a lapsed /users/me is
the sign-in gone. With nothing read at all, the balance's failure is the
error as before.

Tests (real reply shape {success, data: {limits: [{type, percentUsed,
resetsAt}]}}, 404 for no ClinePass): limits failing with 403, 401, 500,
429, a refused envelope and a network error; balance failing with
limits read; /users/me failing with limits read; neither read. The 8 new
cases fail on 0.1.6 (bun test: 70 pass, 8 fail) and pass now (78 pass);
bun scripts/check.mjs passes. Not tried against a real Cline account
(none at hand).
2026-10-10 20:14:47 +08:00
yetone d7e7eaf5f8 trae 0.2.8: a tool call's arguments wrapped once more by the model reach the agent bare (bee2an on X)
Asked to write each call as {"name":…,"arguments":{…}}, a model on Trae
sometimes wrote the arguments wrapped again, {"arguments":{…}}, and the
plugin passed that on: bee2an's agent got
{"arguments":{"content":"P\n\n","path":"…/trail2.txt"}} for its write and
wrote nothing useful.

Every call, from a block in the text or from Trae's native tool_calls,
streamed or not, now goes through one step in parts(): a lone arguments,
input, parameters or args key holding an object (or a JSON string of one)
is taken off, up to three layers, when the request's tool has no
parameter of that name. A tool whose own parameter is called input keeps
it, and a call to a tool the request doesn't list is left as it is.

Run: bun test in packages/trae, 96 pass. unwrap.test.mjs uses the
reporter's arguments byte for byte; its three tests fail with the step
stubbed out.
2026-10-10 18:14:24 +08:00
yetone 07897c8c58 factory 0.1.23: a streamed Claude Code request with context management is no longer refused (#71, Vigilans)
Claude Code with the context-management beta sends context_management
(here clear_thinking_20251015, keep all). Factory's streaming route
answers it with 400 "context_management: Extra inputs are not permitted";
the same body with stream false, or without the field, gets 200 (the
reporter's three cases). A streamed /messages request now goes without
the field; an unstreamed one keeps it. The server then clears nothing,
and Claude Code's own compaction still runs.

The version bump also releases the previous commit's #72 fix.

Run: HOME=<tmp> bun test in packages/factory, 119 pass (1 new from the
reporter's body; the existing all-fields test now expects the field gone
on its streamed request). With the deletion disabled by hand both go red.
Not sent to Factory: no Factory account here.
2026-10-10 17:55:54 +08:00
yetone 9d4bc83400 factory: a skill list Claude Code sends alone as a system message is no longer refused over update-config's "not Claude" (#72, Vigilans)
Claude Code also sends the skill list as a standalone system message with
only its entries: no header, no <system-reminder> wrapper, no
<total_tokens> tail, as text blocks and (later in the same session) as a
plain string. The adapter only knew the headed and token-terminated forms,
so the update-config line went through unchanged and Factory answered
403; the reporter got 200 with only "not Claude" -> "not the assistant".

bareSkills applies that same known-line change to a system message that
opens with a "- " entry, both content shapes. User messages, quoted lists
and other skills' lines are left alone.

Run: HOME=<tmp> bun test in packages/factory, 118 pass (2 new, the
reporter's body byte for byte as fixture). With bareSkills made a no-op
by hand the new test goes red. Not sent to Factory: no Factory account
here.
2026-10-10 17:55:26 +08:00
yetone 00b06db784 workbuddy 0.1.13: an enterprise account lists and uses the enterprise's models, not the personal plan's (#75, seavenlin)
WorkBuddy answers as the personal account unless a request names the
enterprise. Its own client (codebuddy.js in WorkBuddy.app: the auth
interceptor and buildAuthHeaders) sends X-Enterprise-Id and X-Tenant-Id,
both the account's enterpriseId, on every request; the plugin sent
neither, so /v3/config gave the personal plan's list.

- A browser sign-in keeps the enterpriseId /login/account names. When it
  names a non-personal type without one, the id is taken from
  /v2/plugin/accounts the way the client's mergeCurrentAccountDetails
  picks (same uid and type, else the one last signed in to).
- Desktop's sign-in reads account.enterpriseId from the app's file.
- sign() (chats, /v3/config), the usage meter and the token refresh carry
  the two headers; a personal account sends none.

Run: HOME=<tmp> bun test in packages/workbuddy, 60 pass (6 new). With the header
loop and the sign-in lookup removed by hand, 4 of the 6 new tests go red.
Not tried against a real enterprise account (none here); the field names
are the ones WorkBuddy's own client reads.
2026-10-10 17:53:36 +08:00
yetone cdbaff644a zen-free 0.1.1: an OpenCode tool name is given the agent's own spelling, and a refused call names its tool (#76, tkhs101)
Zen's models open multi-step work with OpenCode's own todowrite, while
DeepSeek Harness declares todo_write. The guard folded names only for the
five core tools the plugin injects, so with an agent that declares all
five nothing was injected, nothing folded, and the whole turn died with
"Upstream called a tool not declared by the client" - without saying
which tool.

Now any call is given the agent's tool whose name differs only in case,
or else only in case and separators (todowrite -> todo_write, webfetch ->
web_fetch, BASH -> bash), when exactly one declared tool folds to it; a
name two declared tools fold to is still refused rather than guessed.
A refused call's error ends with the tool's name.

Run: bun test and node --test in packages/zen-free (141 pass; under a
load average of ~140 bun's 32 MiB buffer tests sometimes hit their 5s
timeout, the same on the old code, one run fully green); the new #76
tests fail on the old tool-response.mjs (6 red). bun scripts/check.mjs
zen-free. Live against Zen (step-5-preview-free, chat, stream): calls
pass with the folded names; the model didn't emit todowrite in 6 tries,
so the mapping itself is shown by the tests.
2026-10-10 17:46:44 +08:00
yetone a298e5430f cursor 0.2.6: an account that may spend on-demand is not used up when its included usage is (fottencity on Discord)
A Cursor team (or personal plan) with on-demand spend allowed keeps being
served once Cursor Models / Other Models reach 100% of the included usage.
The usage read gave only those pools, so magpie counted the account used
up: smart routing put it last, and any failure while a pool read 100%
rested it until the billing period renewed (held to 8 days).

usage now also reads GetHardLimit and the period's spendLimitUsage, and
derives the On-demand state exactly as cursor-agent 2026.10.01's usage
view does (fixed limit, unlimited, disabled, unavailable). When on-demand
is fixed or unlimited, the pools are still shown but marked aside, and an
On-demand window ($used / $limit) is the allowance: used up at its limit,
never when there is none (then aside too). Disabled or not known: the
pools are the allowance, as before. Bot stays before Total.

Verified: bun test (77 pass); the three new on-demand tests fail on the
old index.mjs (pools not aside, no On-demand window); bun
scripts/check.mjs cursor. Fixture shapes come from cursor-agent's own
protobuf schema (GetCurrentPeriodUsageResponse.SpendLimitUsage,
GetHardLimitResponse); not tried against a real enterprise account.
2026-10-10 15:09:34 +08:00
moxuun 7e79ad90b0 cline: reuse task ID per chat session for prompt caching (#69)
* cline: preserve ClinePass prompt cache across requests

* cline: limit task ID omission to affected models

* cline: reuse one task ID per chat session
2026-10-10 15:06:48 +08:00
Morgan 6bed2c1c32 cursor 0.2.5: a Cursor account with a Grok Bot allowance shows it on its Usage card (#64)
Grok Bot has an allowance of its own, apart from Cursor's monthly usage,
and it shows on cursor.com's dashboard only. auth.usage now also reads
https://cursor.com/api/dashboard/get-sand-usage-status with the sign-in
as the dashboard session (WorkosCursorSessionToken, as Cursor's dashboard
and CodexBar's CursorSandUsage.swift send it), and adds a "Grok Bot"
window: a paid grant with its weekly reset, a live trial as
"Grok Bot (trial)" without one. The window is aside, so Bot running out
never stops Cursor model requests, and it comes before Total so it is
among the Usage card's three rings. No grant, an expired trial, a
non-2xx, a redirect (not followed), a hang past 5 s or a reply that
isn't JSON each leave Cursor's own windows as they were.

Rebased onto main after cursor 0.2.4 (7516d63); package version is 0.2.5.
Optional pins for the 5 s AbortSignal.timeout and the Origin header are
not in this commit (Codex CLI unavailable for the edits); the runtime
guards stay.

Tests: usagePercent 130 is shown as 100 (and -5 as 0), and a 307 to a
login page is refused rather than followed; each fails with its guard
removed from botUsage.

HOME=$(mktemp -d) bun test packages/cursor: 73 pass, 0 fail.
HOME=$(mktemp -d) bun test (whole repo, on this commit atop main
7516d63): 1033 pass, 0 fail. bun scripts/check.mjs: all 15 ok. Checked
by hand once before an earlier squash: a Free Cursor account linked to
SuperGrok showed the Bot ring in magpie. Not tried with a paid Cursor
grant.
2026-10-10 11:49:29 +08:00
yetone 7516d636d8 cursor 0.2.4: a model asked for by its bare name (grok-4.7) counts in the pool its sized ids (grok-4.7@256k) are in (Will on Discord)
The model list offers Grok 4.7 only at its context sizes, grok-4.7@256k
and grok-4.7@500k, while a routing group picked before the list had sizes
still asks for bare grok-4.7, which named() runs at its default size.
usage() built the Cursor Models window's models (and Other Models'
notModels) from the listed ids only, so magpie counted bare grok-4.7 in
Other Models: used up, 0% left on the Routing page, ranked last, while
Cursor Models had ~84% left. The pool now also names each listed id's
bare name; inPool still decides which pool it is in.

magpie 99009b93 makes the same match on its side for every plugin (a bare
id and its id@size count as one); this release covers magpie versions
before it.

Verified: the new usage.test.mjs case fails on 0.2.3's index.mjs ("Grok
4.7" counted false/true) and passes now; packages/cursor 67 pass;
check.mjs green. The whole-repo bun test needs HOME=$(mktemp -d) (CI does
it), not run here that way.
2026-10-10 10:58:09 +08:00
kazecreator 5b67ff41aa cursor 0.2.3: a Run HTTP/2 can't open goes over HTTP/1.1, as RunSSE + BidiAppend on api2 (#59, kazecreator)
Where a proxy or network blocks HTTP/2, a Cursor Run goes over HTTP/1.1 on api2: RunSSE down, a BidiAppend for each client message up. A failure that says HTTP/2 itself can't be had keeps later Runs on HTTP/1.1 for 10 minutes; a refused connection or a reset stream falls back for that Run only. Reviewed at f5c11b7, merged onto 0437abb: cursor 66 pass, whole repo 1026 pass, check.mjs all 15; each guarded piece broken by hand turns http1.test.mjs red.
2026-10-10 09:33:23 +08:00
yetone 0437abbe30 factory 0.1.22: Claude Code's restored-context turn after /compact reaches Factory adapted (#68, Vigilans)
After /compact, Claude Code 2.1.280 sends the files it restores and the
session's runtime context as one system text block with no reminder
wrappers and no opening token marker: restored-file notes ("Note: <path> was
read before the last conversation was summarized…"), "Called the Read tool
with the following input: {…}" and its result, "# Environment\nYou have been
invoked in the following environment:", the model line, token and date.
The reporter's bisect shows Factory 403s on each of those fixed fragments,
and 0.1.21 matched none of them: SYSTEM_ENV_CONTEXT is anchored at the
block's start, COMPACT_READ / COMPACT_FILE need a standalone wrapped
reminder, and the token-prefixed bundle path needs a leading token marker.

restoredContext recognizes the complete turn: its first paragraph is a
generated restored-file note or Read call (as COMPACT_FILE / COMPACT_READ
would match it wrapped), and a later paragraph, before any hook output, is
the generated environment paragraph or a token marker. Then
announcedContext adapts every paragraph from the first on, with the
existing compat spellings (Previously read file…, # Runtime context / The
session environment is:, Current model name / Model ID / Model knowledge
cutoff) and the lossless JSON encoding of Read results; everything else
stays byte-for-byte. It runs for system-role strings and text blocks and
for the same block folded into user text. An adapted turn no longer opens
with the generated note, so a second pass is byte-for-byte.

Quoted, incomplete (no environment or token), hook-owned and assistant
forms are left untouched.

Run: bun test (packages/factory: 116 pass; repo: 1010 pass, 0 fail),
bun scripts/check.mjs (all pass). The two new tests use the issue's literal
fragments (several notes, Read call + result, environment, model line with
claude-opus-5-5[1m], token, date); the adapting one fails on 0.1.21's
index.mjs, and removing the env/token requirement, the hook guard, the
user-text path or starting at paragraph 1 each turns a test red. PR #66
applied on top passes too (119 factory tests). Stubbed fetch only; no
request was sent to Factory (no Factory account here).
2026-10-10 03:37:05 +08:00
yetone aa2d99bd13 qoder 0.2.12: a chat Qoder refuses (401/403) keeps Qoder's own reason in the error
Yayoi_no_yume on X: a request made right after signing in came back
"Qoder: the sign-in lapsed — sign in again" (401), and only installing and
signing in to Qoder CLI made it work. failure() replaced whatever Qoder said
with that fixed text, so the real reason for the refusal could not be seen.
The message is the same, with "(Qoder said <status>: <its message>)" added
when Qoder gave one; the account is still left unmarked (X-Magpie-Sign-In:
kept), as before.

usage.test.mjs gains the case (a 401 whose body says why); it fails on
0.2.11 and passes. bun test (89 pass) and scripts/check.mjs qoder under a
scratch HOME pass. Not tried against Qoder itself (no Qoder account here),
so the cause of the reporter's 401 is not known yet.
2026-10-10 01:10:39 +08:00
yetone 5189b287e7 grok 0.1.11: a plain Codex agent_message (a subagent's task or reply) reaches Grok as a user message (#61, congee949)
Releases #61 (13e813d), which merged without a version bump: Grok's
Responses backend turned these requests away with 422 unknown item type
"agent_message". Sealed tasks are still sent as they came.

Verified at #61's head merged onto e1efc3d: bun test packages/grok 31 pass,
the whole repo 1007 pass, bun scripts/check.mjs ok. Without the change in
index.mjs, agent-message.test.mjs fails 2 of 4. Sent through
loader().fetch to a local fake of cli-chat-proxy.grok.com: main gives 422,
this version gives 200.
2026-10-09 22:32:53 +08:00