Commit Graph
30 Commits
Author SHA1 Message Date
yetone 9a4ec8600c workbuddy 0.1.24: a refused sign-in on a request over 2 MiB says the 401 and to sign in again, not ECONNRESET (wyp on Discord)
wyp's WorkBuddy AI requests worked for a while, then every turn failed as
"502 WorkBuddy AI: ECONNRESET: The socket connection was closed
unexpectedly". Measured on www.workbuddy.ai and copilot.tencent.com: the
front door answers a token it refuses with 401 only for a body up to
2097152 bytes. At 2097153 bytes and above it resets the connection with no
reply. With an accepted token, 20 MB bodies go through, and app errors
(400 11128) still come back on big bodies. So once a long Claude Code
session is past 2 MiB and the account's sign-in is refused, every turn is a
reset, and nothing about it is temporary.

Keep-alive reuse was ruled out: the server closes an idle connection with
a FIN at 60s, and Bun opens a new connection for requests at 59.99s and
59.995s.

When a chat over 2 MiB fails before any reply, the loader now asks the meter
(POST /billing/meter/get-user-resource-summary, 401 for a refused token) once.
On a 401 it returns that 401 with the reason and the remedy (sign in again,
in magpie or in the desktop app), marked kept like the plugin's other 401s.
Any other answer, a failed meter read, or an abort leaves the original
error. The chat is never sent again.

Run: HOME=<temp> bun test in packages/workbuddy: 97 pass (reset.test.mjs is
a socket fake of the front door that resets past 2 MiB). Broke it by hand
(unanswered rethrows at once): 3 of the 5 new tests go red. bun
scripts/check.mjs workbuddy: ok. Against the real endpoint in a sandbox
HOME: refused token + 2.2 MB body gives 401 with the message (0.1.23:
ECONNRESET); refused short chat gives the front door's HTML 401; good
token + 2.2 MB body gives 200. Not run: magpie's gateway end to end with
this version. Why wyp's token was refused is not yet confirmed.
2026-10-15 17:25:38 +08:00
yetone ec8ae09cc8 workbuddy 0.1.23: credits used up leave the free models counted out, so magpie doesn't put the account last for deepseek-v4.1-flash (#138, hheei)
WorkBuddy serves a model at x0.00 (deepseek-v4.1-flash) with the account's
credits used up: hheei's account at 560 / 560 was still served it. The
usage read gave one Credits window over every model, so at 100% magpie's
routing ranked the account spent for its free models too: put behind every
other account, and moved off by conversation affinity.

The Credits window (personal and enterprise) now carries notModels: the
ids the account's live list (/v3/config) prices at x0.00. A model free only
some hours (a night promotion) still counts, as the list never says it is
free. A list that can't be read leaves the window as before. magpie reads
notModels as it does for Devin's and Cursor's windows (Limit.applies), so
For(free model) no longer sees the full window, and a 14018 on a paid model
rests only that model (Pooled), as PaidBesideFree already did.

Run: HOME=<temp> bun test in packages/workbuddy: 92 pass. Broke it by hand
(no notModels set): the two new usage tests go red. bun scripts/check.mjs
workbuddy: ok. Not tried against a real account at 100% credits; the
behaviour that free models are still served there is the reporter's.
2026-10-15 13:11:46 +08:00
yetone a6bed5ec54 workbuddy 0.1.22: an MCP server's tool schemas reach Kimi and DeepSeek, not 400 11133 "Invalid request parameters" (#122, clearmann)
Cause: Kimi's tool-schema check (kimi-k3-1, also kimi-k2.7) turns away
schemas that MCP servers and plugins commonly send, with 400 11133
"the request parameters were rejected by the model provider". It is
the request's content, not the account: on the owner's China account
each shape alone in an otherwise plain chat failed every time, and the
same chat with it mended passed. Shapes refused: an enum with no type
(all strings too, under items, anyOf, an unused $defs), an empty enum,
an enum whose type lists two types besides null, true/false where a
schema goes (properties.x, items), a required that isn't a list, and an
unknown type ("any", "String"). Claude Code's own 24 tools have none of
these, which is why tool-less side requests passed for the reporter.

fitShape walks schema positions only (a property named enum or type is a
name) and gives each the shape Kimi takes, meaning the same: an untyped
enum takes its values' type, or [T, "null"]; several types become an
anyOf of typed enums; true is {}, false is {"not": {}};
additionalProperties booleans are left. An empty enum (which nothing
fits) is left out. It runs for every model, as fitTools already does.

WorkBuddy 5.5.6's own CLI (codebuddy.js, read-only) only cleans schemas
for Gemini and only drops temperature for kimi-k3, so it would hit the
same 400 with such an MCP tool.

Ran, real account (China build, plugin loader fetch, old vs new):
- 14 refused shapes on kimi-k3-1: each 400 11133 before, 200 after.
- one MCP-like tool holding all of them: kimi-k3-1 and kimi-k2.7 400
  11133 -> 200; deepseek-v4.1-flash and deepseek-v4-pro 400 11129 ->
  200; glm-5.3 400 11133 -> 200; minimax-m3 and hy3 200 both.
- HOME=$(mktemp -d) bun test in packages/workbuddy: 89 pass; the new
  tests go red (4 fail) with the fitShape call taken out.
- bun scripts/check.mjs: ok.
Not tried: WorkBuddy AI (international) models, and a real MCP server
through Claude Code end to end. glm-5.1 answers 11150 to every chat on
this account (unrelated, also before).
2026-10-14 21:15:24 +08:00
yetone 15d16f5ff0 workbuddy 0.1.21: a model free only at night is never said free; a whole-day discount shows the price before it (#121)
WorkBuddy's /v3/config prices a model by its "credits" and by a
modelPromotions list the picker reads for its badges: Hy3 限时免费 (whole
days to 10-31), Step-5-Preview 独家限免 (10-12..10-25), Hy4 preview 夜间免费
(free 23:00–8:00 only), GLM-5.2 and DeepSeek 夜间折扣. The plugin read only
"credits", and magpie keeps a plugin's model list until it next asks, so a
list read at night said Hy4 preview was free all day (#121's screenshot:
免费 in magpie, 0.29x and 夜间免费 in WorkBuddy).

priceOf now reads both. A model under a promotion with daily hours is given
at its full price and never as free (unpriced when the credits read 0 under
a night discount). A running whole-day discount is the price now, with the
credits before it as rateWas, which magpie already shows struck through.

Run:
- bun test across the repo (TMPDIR+HOME in the scratchpad): 1219 pass. The
  new price.test.mjs, built from the promotions copilot.tencent.com gave on
  2026-10-14, fails 3 on the old code.
- The owner's real WorkBuddy and WorkBuddy AI accounts through liveModels
  (17:10 CST): Hy4 preview 0.29, Hy3 and Step-5-Preview free, the rest at
  their credits, matching WorkBuddy's picker.

Not tried: the config as served at night (whether "credits" itself reads
x0.00 then); the unpriced branch covers that case.
2026-10-14 17:16:39 +08:00
yetone a4f81786a7 workbuddy 0.1.20: tool results followed by the user's message reach WorkBuddy AI's gemini-3.8-flash (#113)
WorkBuddy AI's gemini-3.8-flash answers 400 code 11153 "the conversation
must end with a user message" to a chat whose tool results are followed by
a user message. magpie sends exactly that for Claude Code's tool_result
plus reminder text, a user's words typed mid-task, and a tool's images, so
Claude Code on that model failed on its first tool result (wuasakura).

The loader now sends such a chat again with an empty assistant message
between the results and the user's message, and does so up front for a
model that refused it once in this run. Any other refusal, and a chat
ending with the assistant's message (a prefill), passes on as before.

Verified with the owner's real WorkBuddy AI account (direct to
www.workbuddy.ai through the plugin's loader):
- 17 models with tool results then a user message: only gemini-3.8-flash
  refuses (11153); the rest serve it.
- On gemini-3.8-flash: tool->user, tool->user(parts), two tools->user,
  tool->user->user and tool->user(image) are refused before, served after.
  With the empty assistant message the model follows the user's ask ("Red
  PINEAPPLE"); folded into the tool result instead, it ignored the ask, so
  folding was not used.
- Through magpie's gateway (main eb0d5750f, nogui build, sandbox HOME, the
  local package added): a Claude Code-shaped /v1/messages request
  (tool_result + system-reminder text) gave "WorkBuddy AI: the conversation
  must end with a user message" with 0.1.19's index.mjs, and "3 PINEAPPLE"
  with this one.

Tests: HOME=$(mktemp -d) bun test in packages/workbuddy, 80 pass; bun
scripts/check.mjs workbuddy passes. aftertools.test.mjs: with 0.1.19's
index.mjs the retry and up-front tests fail (Expected 200, Received 400);
with the remembering removed, the up-front test fails.

Not tried: WorkBuddy (China), whose model list has no Gemini.
A prefill to gemini-3.8-flash is still refused with the same 11153.
2026-10-14 13:14:32 +08:00
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 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 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
YuCreate 80bd2d9241 workbuddy 0.1.15: normalize chat request fields (#96) 2026-10-12 20:26: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
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 17e75329b1 workbuddy 0.1.12: a chat's tools get shapes WorkBuddy AI's models take, so ZCode's and DeepSeek Harness's chats on deepseek-v4.1-flash aren't 400 "Invalid request parameters" (wyh on Discord)
WorkBuddy AI answers 11133 "Invalid request parameters" (the model
provider rejected them) when a tool's parameters or name are of a shape
its model turns away. Tried on the owner's account through magpie:
deepseek-v4.1-flash and -sg refuse each of a pattern's \0, a root anyOf,
parameters with no type, empty parameters, a tuple's items, and a name
holding . : / a space or CJK; Kimi, GPT, Gemini and GLM refuse some;
MiniMax none. Every client protocol reached the same error, so it is the
tools, not the protocol.

fitTools now gives each the shape that passes: an object root (unions
merged as magpie's provider.ObjectRoot does), \0 as \u0000, a tuple's
items as one anyOf, and a safe name, with the model's calls named back in
JSON and streamed answers and the history's calls named as sent. A clean
chat goes as the same bytes.

Run: HOME=$(mktemp -d) bun test packages/workbuddy (54 pass), bun
scripts/check.mjs workbuddy; through a sandbox magpie gateway with this
package, deepseek-v4.1-flash, -sg, glm-5.3, gpt-5.4, gemini-3.5-flash and
kimi-k3 answer 200 to every shape above (400 before), and an Anthropic
Messages call of a tool named fs.read, streamed and not, comes back as
fs.read. wyh's own ZCode/DeepSeek Harness tool set was not seen.
2026-10-08 17:39:00 +08:00
tearsleeandtearslee 5d1beb37e0 workbuddy: one user send, one X-Conversation-Request-ID (#48)
WorkBuddy's backend counts a user send as one request by
X-Conversation-Request-ID. The China build was sent no conversation headers
at all, and the international build a new pair on every request, so one send
that takes several steps — a tool result sent back, a retry, another account
answering — was counted as a request of its own: one conversation showed up
in the usage detail as many requests.

The ids are now made as workbuddy2api's fix makes them: the turn's from the
body's last user message (its place and its signature, a tool result's part
left out), the conversation's from the session magpie or OpenCode names —
the chat.headers hook now carries it — else from the chat's first user
message; nothing is made up when neither names one. The message and request
ids stay each request's own, and both builds carry the ids now.

Co-authored-by: tearslee <16331052+tearslee@users.noreply.github.com>
2026-10-08 16:41:53 +08:00
midasandyetone ac3b697e5b workbuddy 0.1.10: explain credits exhausted (code 14018) errors with hint and extract nested error message (#25)
* workbuddy 0.1.10: explain credits exhausted (code 14018) errors with hint and extract nested error message

When calling WorkBuddy / WorkBuddy AI models (including 0-rate / free models), accounts with no active packages or depleted credits receive 429 code 14018 ('Credits exhausted...').

- Extract nested error message from v?.error?.data?.msg and v?.data?.msg
- Match code 14018 on parsed fields (error.data.code, code, error.code) or 'code':14018 to avoid false positives on requestId/timestamps
- Append EXHAUSTED_HINT explaining that WorkBuddy requires an active credit package even for 0-rate free models
- Return standard OpenAI-shaped { error: { message, type: 'insufficient_quota', code: 14018 } }
- Add tests in refused.test.mjs covering code 14018, error.data.msg extraction, and untouched pass-through of unrelated errors with 14018 in requestId

* workbuddy 0.1.10: match code 14018 whole, so a code that only begins with it (140185) passes through instead of resting the account as out of credit

---------

Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-07 18:47:32 +08:00
yetone 697803308a workbuddy 0.1.9: Codex and Claude Code chats pass WorkBuddy's channel check (magpie #182)
WorkBuddy answers "Illegal API invocation from an unapproved channel" to a
few exact phrases anywhere in a chat, case-insensitively: Claude Code's
billing header and identity line, its gitStatus "Main branch (you will
usually use this for PRs)", and Codex 0.159.2's first paragraph as a whole.
The plugin rewrites each to words that say the same and pass (each tried
against both builds), drops the billing header, and leaves every other
message as it was. Tested with real accounts through Cindy's bundled Codex
0.159.2 and Claude Code 2.1.280: workbuddy/glm-5.3-flash and
workbuddy-ai/deepseek-v4.1-flash answer from both; before, Codex got the
refusal. unflag.test.mjs fails 3 of 4 without the change.
2026-10-06 03:09:56 +08:00
yetone 873449a2f4 workbuddy 0.1.8: the credits window tells its count, amount of limit in credits, beside its share and display — for magpie to say how many credits are used or left on the Routing page, the Usage page and the menu bar as it says the share (yetone/magpie#659). usage.test.mjs checks the count for a paid, a free and a fractional account; it fails on the old code and passes. Tried with the real WorkBuddy and WorkBuddy AI accounts in a sandbox magpie: 33.29 / 3900 and 13.47 / 2250 credits come through the host. 2026-10-03 16:40:09 +08:00
yetone 319eee27ea workbuddy 0.1.7: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 5 minutes (in-fetch: 1) for browser
sign-ins, on both sites; Desktop's (no expiry stored) is renewed as before.
A refresh now runs once per site and refresh token, and its result answers
for the old token a minute, shared by the request path and the hook. Every
failure, an ended refresh token included, throws plainly and doesn't mark
the account, as the built-in never did.

The check before each request stays for OpenCode, which doesn't call the
hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change;
HOME=$(mktemp -d) bun test passes (396 across the repo).
2026-10-03 12:07:23 +08:00
yetone 8f25b63718 publish from GitHub Actions with npm's trusted publishing, no one-time password [skip ci]
.github/workflows/publish.yml runs the tests (in a throwaway HOME) and
scripts/publish.sh on each package.json change pushed to main, or by hand;
npm's OIDC exchange stands in for a token and an OTP. Every package now
names magpie-community/plugins' publish.yml as its trusted publisher on
npmjs.com, and gets the repository field npm checks it against.
2026-10-03 00:00:23 +08:00
yetone ef81d34320 tests: a usage test's offline fetch is put back when its file is done, so the next file doesn't inherit it
bun test runs every file in one process, and three usage tests left
globalThis.fetch on a fake of theirs: zcode's (offline, set in a
beforeEach, never restored), kiro's and workbuddy's (offline, set at
import, never restored). A file run after them got that fake:

- minimax's tests (27/27 alone) failed 19 after zcode's usage test: the
  plugin's requests to the local fake MiniMax went to zcode's offline and
  threw "no network in tests".
- qoder's cn.test.mjs takes globalThis.fetch as the real one when it loads;
  after kiro's or workbuddy's usage test that was offline, so every request
  meant for its Bun.serve stand-in threw. The CN sign-in, which polls on
  through errors, timed out at 10 s and kept polling, and the job-token test
  timed out too, so a full bun test never finished.

Each of the three now keeps the fetch it found and puts it back in
afterAll. Test-only; no package version changes. HOME=$(mktemp -d) bun
test: 341 pass, 0 fail across 42 files (8.5 s); bun scripts/check.mjs
passes.
2026-10-02 23:13:06 +08:00
yetone e2c72b2ae7 qoder 0.2.2, workbuddy 0.1.6: each model's credit rate goes to magpie (rate, rateWas), as magpie's built-ins read it (yetone/magpie 33acb6bc, v0.1.667)
magpie now shows each model's credit rate in the provider's model list and an agent's picker (01huadalang on Discord: pick the cheap models without opening Qoder or WorkBuddy); a plugin gives it beside free on each model its provider.models hook lists. Qoder and Qoder CN: rate is the price_factor (priceFactor); rateWas an active promotion's before_promotion_price_factor, else an original_price_factor above the price (Qwen3.8-Flash: 0x, 0.1x struck through); a promotion's 0 that isn't free is its price before times its discount_factor; a listing with no price gives none — the rule of internal/qoder/models.go's ModelInfo.free. WorkBuddy and WorkBuddy AI: rate is the model's credits ("x0.03" is 0.03; x0.00 stays free; an unreadable, negative or infinite rate is neither free nor rated), as wbCredits reads it.

usage.test.mjs in each package gets a test fed a fake listing / fake /v3/config (the cases of core's TestParseModelsRate and TestWBCreditsRate); both fail against the previous index.mjs and pass now. No request was made to Qoder or WorkBuddy. bun test (HOME a temp dir) and bun scripts/check.mjs pass.
2026-10-02 22:54:55 +08:00
yetone 01aee5da28 all: a usage read says what it means for the sign-in, and a renewal clears the mark whatever follows, as the built-ins did (要保证插件跟内置的所有逻辑都要一模一样) — auth.usage returns signIn on every path: expired where the built-in's quota read marked the account (Zed's /users/me 401, Factory's and MiMo's refused renewals, Qoder's refused job refresh), renewed after a renewal, which took the mark off, kept everywhere else, so magpie no longer guesses from the words 'sign in again' (Kiro's, Devin's and ZCode's usage errors marked accounts their built-ins never did) nor clears on a clean read. A request after a renewal says renewed on any status; one without says kept, as the built-ins cleared only on renewal. Kiro, Cursor, Devin, Command Code, WorkBuddy, Grok and ZCode, whose built-ins never marked an account, say kept on every answer. New tests fail against 85d7dd0's index.mjs. 2026-10-01 04:53:29 +08:00
yetone 85d7dd0d0a all: each plugin fails with its built-in's status and marks the sign-in as it did, through X-Magpie-Sign-In (要保证插件跟内置的所有逻辑都要一模一样) — Factory's and MiMo's refused renewals are the built-ins' 502 marked expired, not 401s; Qoder's vendor 403 is the built-in's 401 kept, its model list's failure a 400, its job refresh refused marked expired; Zed's retried 401 is a 401 kept, not a 403; Kiro's unreachable refresh a 401 kept; Cursor's expired trial a 401 kept; a vendor 401 WorkBuddy, Grok, Devin, Command Code and ZCode passed on no longer marks the account, as their built-ins never did, and Grok and MiMo no longer retry what their built-ins sent once. Messages take the built-ins' words. New tests fail against the previous index.mjs. 2026-10-01 04:47:03 +08:00
yetone 0b425bee69 workbuddy 0.1.4: every refused meter status is an error with words, Go's http.StatusText in full (a 409 was an empty error), "HTTP <n>" for one Go has none for; a refusal in WorkBuddy's own {code, msg} reads its msg before the hint, as wbExplain's; a chat body handed over as bytes is read, so it still gets WorkBuddy's system message 2026-10-01 03:05:22 +08:00
yetone 826d487839 workbuddy: the refusal of Codex's and Claude Code's prompt carries magpie's hint, and a model of no credits is marked free; zcode: sign in as the ZCode app, following its own sign-in and team switches
- workbuddy: 'Illegal API invocation from an unapproved channel' ends in the hint magpie's built-in added (provider.WBRefusedHint), where magpie's routing page finds it; models with credits x0.00 carry free: true
- zcode: a new sign-in, "ZCode app's sign-in", reads ~/.zcode/v2 (credentials decrypted as ZCode keeps them, setting.json's team plan) for every request, as magpie's built-in did; magpie moves ZCode's own account marked source: zcode
2026-10-01 01:21:06 +08:00
yetone c8f4d448df Parity with magpie's built-ins: a failed sign-in says why, CLI-backed Command Code and Devin accounts follow the CLI's key, Factory's refused renewal is a 401 in the caller's API shape
- every {type:"failed"} carries an error reason magpie shows
- commandcode/devin: accounts taken from the CLI are marked metadata.cli and re-read its credentials on each request, usage and models
- factory: a refused refresh answers 401 authentication_error (Anthropic shape on /llm/a/, OpenAI's elsewhere) instead of throwing; the whoami back-off is per account; 403 hints name the account to sign in again
- versions: factory/devin/commandcode/cursor/kiro/mimo/zed/zcode 0.1.2, workbuddy 0.1.3
2026-10-01 00:55:50 +08:00
yetone 8c419105c0 workbuddy 0.1.2: usage shows as magpie's built-in did — plan, period, windows and what they count, balanceworkbuddy 2026-09-30 23:03:10 +08:00
yetone 8f19f2e132 workbuddy: desktop's sign-in is read where the app keeps it, not copied — a copied refresh token was the app's and the plugin's both, and the first to use it signed the other out. The sign-in keeps a marker ({source: "desktop"}); each request reads the app's .info, and a token the app let lapse is renewed in memory only, as magpie's built-in does. 0.1.1. 2026-09-30 21:04:07 +08:00
yetone 5a18bbdac4 Name the scope @magpie-community (the org's name, spelled right) 2026-09-30 17:04:47 +08:00
yetone 3e38d08125 workbuddy: WorkBuddy (China build) and WorkBuddy AI (www.workbuddy.ai) — browser sign-in polled as the app does, or the desktop app's sign-in; token refresh, WorkBuddy/<ver> User-Agent, chat completions at <endpoint>/v2, the account's model list 2026-09-30 16:59:53 +08:00