7b42e404f5f656d7bfb4aa5c7ddbcd1031264a86
92
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
92c20ffef6 |
Eight auth hooks declare rotating refresh tokens (#1027)
Eight auth hooks declare `rotating: true`: cline, codearts (and OfficeAce), factory, minimax, nous, qoder, sensenova, workbuddy. Each package's own code says the vendor refuses a spent refresh token. magpie then stops carrying these sign-ins to another computer through Sync, a backup or a Restore (internal/provider/signins_carry.go). Trae was dropped: its refresh keeps the old token when the answer has none, and there is no evidence it rotates. Each package's patch version is bumped (cline 0.1.15, codearts 0.3.13, factory 0.1.46, minimax 0.2.9, nous 0.1.3, qoder 0.2.66, sensenova 0.2.3, workbuddy 0.2.30). Each was checked against npm, or against origin/dist for the dist-only packages, before the merge. Fixes #884. Run at cc2f9199 (a fast-forward of origin/main), on mica with a temp HOME: bun test over the eight packages gave 1588 pass, 0 fail, and scripts/check.mjs exited 0. CI's test and on-npm jobs pass. At 45c8fdb4, mote gave 1834 pass with Trae included. Not tried: a real refresh against each vendor. Co-authored-by: yetihan <yetihan@users.noreply.github.com> |
||
|
|
1492d9c3be |
workbuddy 0.2.29: a routed-over refusal pins the free window (#1022)
A WorkBuddy AI 429 that magpie routed past to another member was never in the usage ledger, so the free window's estimate never learned the vendor's reset (#910). The plugin now reads magpie's routing trace (routing/YYYY-MM-DD.jsonl and .jsonl.gz, three days, both files when a day has both) for WorkBuddy 429 tries and pins the window at the reset they name.
- A gateway rest pins the window only when rest.by is "resets" (the vendor named it). cooldown, backoff, quota, window and retry-after leave it alone.
- The rest key's account (lowercased by magpie's restKey) is compared case-insensitively. order[].who's spelling is kept, and a who/key conflict drops the try.
- The parse cache is one entry per path, provider and model, with the file's fingerprint inside it. Paths outside the current three days are dropped.
- Lines without "status":429 are skipped before JSON.parse.
What was run at b48fd3fcc494a708aba65e47643738dfd6a34e80 (temp HOME, fake data only, nothing reached WorkBuddy):
- mote (macOS): bun test packages/workbuddy, 360 pass, 0 fail, under TZ=UTC, Asia/Shanghai, America/Los_Angeles, Pacific/Pago_Pago and Pacific/Kiritimati. bun scripts/check.mjs passes.
- Windows 11 (xiaomi-gpu): 360 pass, 0 fail.
- Broken by hand, one at a time, each turned at least one test red: any rest kind pins (1), exact-case account match (2), no stale-path drop (1), fingerprint back in the cache key (1), no who/key conflict check (1), no provider prefix check (1).
- Merges cleanly onto main
|
||
|
|
51f24a363a |
workbuddy 0.2.28: list an enterprise's custom: models (#1015)
An enterprise account's own models ("custom:<name>|<name>", modelType
"enterprise") come in /v3/config's models but not in the cli agent's
list. WorkBuddy's CLI (bundled in WorkBuddy 5.5.6, AgentManager.
computeModels) appends every config model whose id starts with
"custom:" to the agent's list itself, after the agent's own ones.
liveModels read only the agent's list, so the models were missing
entirely, and a forced chat to them worked. They are now appended in
the config's order with their context, output, images, price and
efforts, and the id goes to WorkBuddy as given, "|" and all. They stay
on chat (nativeOf matches only a bare claude- id), where the reporter's
chat was served. Both sites share liveModels; nothing else enumerates
the config. The CLI also appends models tagged "custom" or "chat":
those in a desktop's cached config are its local models with their own
url and apiKey, so they stay out.
PR #1016 (yetihan) joined the two spellings instead (an agent-listed
custom:x|x against a bare detail id x); the issue's literal entry,
run against d2e21b7b, lists neither model (expected 2, got 0).
Run (mica, HOME=$(mktemp -d), at a181b898, this change on edc6dbcd;
the rebase onto
|
||
|
|
9452521770 | workbuddy 0.2.27: version bump for the check-in expiry change (cdredfox on X) | ||
|
|
3d7b67aeb3 |
workbuddy 0.2.27: check-in rewards the summary doesn't list say when they lapse (cdredfox on X)
The Credits and Total windows said when the soonest credits left run out (runsOutOf), but only over the packages the resource summary lists. A daily check-in reward (code 007, each with its own end) that only the detail lists have, beside extra credits the summary does list, was in no window and in no expiry, so Smart routing never saw those credits lapsing. runsOutOf now also counts the extra codes WorkBuddy's panel counts (EXTRA_CODES, plus the free month and gift on WorkBuddy AI) when given the site, on the extra window, and on the single window when no window of its own holds them. Run: bun test packages/workbuddy (336 pass, HOME=$(mktemp -d)); the new test fails on the old code (broken by hand: stashed index.mjs, red). Not tried: a real account (the desktop sign-in on this machine was stale, so the real list shape of a check-in reward is the 2026-10-26 fixture's, 007 "赠送积分", not seen live today). |
||
|
|
7e01fa8118 |
workbuddy 0.2.26: the declared list gives each model the config's reply limit
The list declared before an account's own config is read (a key whose CLI reads no config, a config WorkBuddy doesn't answer) said output 0 for every model, and magpie filled in models.dev's: 384000 for deepseek-v4.1-flash, where WorkBuddy's /v3/config says maxOutputTokens 128000. Agents were told a 384000-token reply. The declared tuples take a fifth field, the output, for every model a real config in testdata names: deepseek-v4.1-flash and deepseek-v4-pro 128000 and glm-5.3-flash 131072 on workbuddy; default-model 24000, fast-model 32000, primary-model 72000, hy3 64000, gemini-3.5-flash 65536, glm-5.2 48000 and kimi-k3 32000 on workbuddy-ai. The rest stay 0 (left to models.dev, as before). The live list already carried the config's value. Run: HOME=$(mktemp -d) bun test packages/workbuddy/ on mote, 335 pass; bun scripts/check.mjs ok. Broken by hand: with index.mjs back at 0.2.25, the new test fails (hy3 64000 expected, 0 received; deepseek-v4.1-flash 0 for 128000). Not tried: a real WorkBuddy sign-in or key; the outputs of models no saved config names (hy4-preview-f, glm-5.3, kimi-k3-1, ...). Reported-by: sayagoodbyeplz (Discord) |
||
|
|
49d4042e5b |
workbuddy 0.2.25: Hide DeepSeek Harness's name leaves the user's words and paths alone (liby233)
liby233 on Discord: in DeepSeek Harness on DeepSeek-V4.1-Flash · WorkBuddy, a user asked the model to repeat "/root/DSH/Work/OC-182.92.66.95/" word for word and got "/root/the agent harness/Work/OC-182.92.66.95/" back; another model was fine. hide_dsh (0.2.23, on by default) ran /\bDSH\b(?!_)/ and the bare "DeepSeek Harness" rule over every user and assistant text, so a path's DSH segment went to WorkBuddy rewritten. The switch's own description already promised "Paths ... stay as they are". - The bare name is taken out only where dsh wrote it: system/developer messages, Messages' system, tools' descriptions (DSH_PROSE). - User and assistant text get dsh's own lines alone (DSH_LINES: the opener, the checkout and Web GUI lines, "DSH itself"), so the runtime context dsh sends as a user message still loses the name. - Even in the system prompt, a name in a path, file name or identifier (/root/DSH/, C:\DSH\, ~/DSH, DSH.md, DSH-2, @DSH, file:DSH, "/srv/DeepSeek Harness/bin") is left: IN_PATH_BEFORE/AFTER guards. - Siblings: FLAGGED and OPENERS rewrite whole known lines (a comma), not a bare word; no other plugin has a DSH scrub (git grep). - README updated. Run on mote at this tree (mote-run): HOME=$(mktemp -d) bun test packages/workbuddy: 334 pass, 0 fail; bun scripts/check.mjs: all ok. New tests use the reporter's literal path. Broken by hand, each red: user/assistant text through DSH_PROSE again (5 fail, the reporter's case among them); IN_PATH_BEFORE as \b (the path test fails). Not tried: a real dsh request on a real WorkBuddy account. Whether the narrower hide still matters for a ban is unknown, as before. Reported-by: liby233 |
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id `intern-inkstone`. Community package by yunwang2442-creator. What it does: - Browser sign-in (Edge/Chrome, its own profile under $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no debugging port. A headless CDP read takes the uaa-token cookie, and the same read renews it silently later. - Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs. - Chat: a pasted ink-* API key, or one the sign-in creates, named ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An idempotency clash (-15109) retries with a fresh name, up to three times. Pruning is on by default. It only touches this machine's and account's prefix, keeps the newest two and the key this sign-in created, and never deletes manual keys or keys of unknown age. - Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover browsers are matched by --user-data-dir=<escaped profile>, and Windows uses .Contains(). - The login wait comes from an injected waitForLogin in tests. No env hook is left in production code. - Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn, 127.0.0.1 (CDP). Outside the package: scripts/opencode2.mjs lets a prompt with `required: false` stay optional (`p.required !== false`). Every package's copy is synced byte for byte, so all 39 copies in the merged tree are blob |
||
|
|
5026f6362e |
workbuddy 0.2.24: plan and extra credits stop the account together (ferock on Discord)
An account with both the plan's credits and extra ones showed only one of them on magpie's Routing page: the window that stops the account was the plan's until its credits were spent, then the extra one's. So one account read "500 / 500 credits" with its extra credits untouched and left out, the next only its extra credits, and an account at 90% of its plan was kept for last with all its extra credits left. Now "Credits" and "Extra credits" are both set aside and a third window, "Total credits" (the two together), stops the account, for the summary's split (CreditGroups or package codes) and for extra credits only the detail lists carry. It takes the plan's cycle and the soonest lapse of the two (summed when they lapse together); each of the two keeps its own lapse. magpie already says "Total credits" in every language (Qoder uses it). magpie keeps a cap the user set on "Credits" holding (its own commit, with the mover min). Run (mote): bun test packages/workbuddy, 332 pass; whole repo bun test, 6159 pass 20 skip 0 fail; bun scripts/check.mjs ok. Broken by hand: the tests against origin/main's index.mjs, 6 fail (Total credits missing, the plan's window still stopping the account). Not tried: a real account with both kinds; ferock's bytes weren't seen, the fixtures are the real shapes already in the tests (China free summary, WorkBuddy AI Pro, CreditGroups) with a plan-untouched case added. |
||
|
|
4912c6088b |
workbuddy 0.2.23: hide DeepSeek Harness's name, on by default
NancyTom18 on X: a WorkBuddy account used from DeepSeek Harness through magpie was banned, and a reply said Tencent recognises dsh's built-in prompt. A new per-site switch, "Hide DeepSeek Harness's name" (hide_dsh), on by default and on in OpenCode, takes the name out of the system prompt, user and assistant text and tool descriptions: dsh's opener becomes "You are an AI agent.", the runtime context's checkout and Web GUI lines lose the name. Tool results, paths, commands, DSH_HOME and ~/.dsh are kept. Labels in zh, zh-TW, ja, de. README section added. Run: bun test packages/workbuddy on mote, 332 pass 0 fail, at this tree. hidedsh.test.mjs uses dsh 0.2.1's literal strings from @deepseek-ai/dsh-system-prompt and dsh-harness-dev-context. Broken by hand: with the hook as `if (false && ...)` the new file went 6 pass 4 fail (the four "name doesn't go" cases). Not tried: a real dsh request capture, a real WorkBuddy account. Whether this prevents a ban can't be verified. |
||
|
|
36fc59a79a |
workbuddy 0.2.22: extra credits only the detail lists have keep the account going once the plan's are spent (ferock)
ferock on Discord (2026-11-05, WorkBuddy China): extra credits weren't counted, so once an account's base credits were used up magpie moved to another account, though WorkBuddy would go on serving it on the extra ones. The card read "17.37 / 500" and "500 / 500" on the plan's window. Since 0.2.17 extra credits that only the paid/free detail lists carry (the summary lists the plan's base alone, a China-site free account's shape) were an "Extra credits" window that was always set aside, so the plan's window was the one that stopped the account, at 100% with the extra ones left. The summary's own split (usageOf) already flips that: WorkBuddy serves the account while any credits are left. Now the detail-list window follows the same rule: once the plan's credits are spent with extra ones left, "Credits" is set aside and "Extra credits" stops the account, carrying the soonest lapse (runsOutAt/runsOut) since routing reads no window set aside. Both spent, the plan's stops it again. README says so. Run at this head on mote (HOME under mktemp): bun test packages/workbuddy 322 pass 0 fail; whole repo bun test 5933 pass, 19 skip, 0 fail; bun scripts/check.mjs ok. Broken by hand: the new usage test against the old index.mjs fails (1 fail, Credits not aside / Extra credits aside). Not tried: ferock's own bytes, or any real account with extra credits. The desktop's China sign-in on this Mac is refused (401) by the billing meter, and I didn't renew it (that would spend the app's refresh token). The fixture is CN_FREE's real shapes (2026-10-26) with the plan spent. Whether ferock's extras are a kind the summary lists (already split since 0.2.11) or only the detail lists carry isn't known; this fixes the latter. |
||
|
|
a90b7aa41d |
workbuddy 0.2.21: the sign-in page opens at the desktop's version, so 企业微信 shows (shenyebuwu)
shenyebuwu (Discord #general) signs in to WorkBuddy with 企业微信 (WeCom), and the plugin's sign-in page offered no WeCom entry. The plugin opened www.workbuddy.cn/login with version=2.0.0. WorkBuddy desktop opens the same /v2/plugin/auth/state page with version set to its own app version (openAuthUrl: version = CLIENT_INFO_PLUGIN_VERSION, which the desktop sets to the app's version; read from WorkBuddy.app's app.asar). The login page's signin-callback chunk shows WeCom to platform workbuddy only at version >= "5.8.0" (Le/tn, Jt="5.8.0"), so 2.0.0 hid it. The page now opens with site.app (5.9.3, the version the requests already carry), for both builds, as the desktop does. Run (mote, bun 1.4.2, HOME=$(mktemp -d)): packages/workbuddy bun test, 321 pass 0 fail; bun scripts/check.mjs workbuddy ok. Broken by hand: version put back to "2.0.0", wecom.test.mjs 3 of 3 red. Real page (Playwright Chromium on mote, a fresh state from copilot.tencent.com): version=2.0.0 lists 微信 手机号 SSO QQ 邮箱; version=5.9.3 lists 企业微信 too. Not tried: a real WeCom sign-in to the end (no WeCom account, no credentials entered); the WorkBuddy AI page with WeCom (its gate is the China platform's only). |
||
|
|
311d62867c |
workbuddy 0.2.20: extra credits only the detail lists have say when they lapse on the window routing reads (Kayphoon)
Kayphoon on Discord asked that routing spend the WorkBuddy CN account whose extra-credit packs expire first, before they lapse. magpie's smart routing already does that (Allowance.Renewal, Lapse and Pace read a window's runsOutAt/runsOut), and the plugin already put the soonest lapse of the summary's packages on the window that stops the account. But extra credits that only the detail lists have (listedExtra, the China free-account shape from jiabubu's report, 0.2.17) said their lapse only on their own "Extra credits" window, which is set aside, and routing reads no window set aside. So for those accounts routing knew no expiry at all. Now the soonest of them to lapse is also put on the Credits window, when it is sooner than what that window already says (summed when the same). Per-pack expiry isn't sent: routing only orders accounts by the soonest lapse and how much lapses then, so a list would change no choice. Run at this head (mote, HOME under TMPDIR): bun test packages/workbuddy, 318 pass 0 fail; bun scripts/check.mjs ok. Broken by hand: the same usage.test.mjs with the old index.mjs fails the jiabubu-shape test at the new assertion (Credits has no runsOutAt). Not tried: a real WorkBuddy CN account with expiring packs; the fixture is CN_FREE's shapes, not Kayphoon's bytes. |
||
|
|
33bb5fb2ef |
workbuddy 0.2.19: the China build's windows are named after their model and say they are estimates (#663)
By kunghim (#663). Squashed at the reviewed head 42b01b3 (the PR's f2a1233, origin/main merged in, and the review's 0.2.19 bump: #657 had already published 0.2.18). workbuddy 0.2.17 -> 0.2.19: - The China build's token window is no longer called "Free model tokens": there deepseek-v4.1-flash is charged x0.11 credits (testdata/config-561.json, copilot.tencent.com's /v3/config; WorkBuddy AI's is x0.00). Its card is named "deepseek-v4.1-flash tokens (est.)", its text reads "151.5M / ~200M", and its unit is empty (the name says tokens). - The China windows are a table, CN_ESTIMATED_WINDOWS, one entry per measured model ({provider, model, aliases, cap, name, short, unit}). freeWindowOf, ofAccount and freeWindowRows take the model from the entry; the parse-cache key carries the model too. - WorkBuddy AI's card is unchanged (Free model tokens, 1e8, "tokens"). - Both stay set aside (shown, not routed on); a refusal still pins the card full. Routing in magpie reads the card's models/aside/refused, not its name. - README: the China windows section; the review fixed one line that said the numbers carry "tokens (est.)" (only the name does). Run at 42b01b3 on mote (macOS, bun 1.4.2), HOME=$(mktemp -d): - bun test (whole repo): 4900 pass, 14 skip, 0 fail (4914 tests, 374 files). - bun scripts/check.mjs: exit 0, 41 packages + registry ok. - packages/workbuddy bun test: 318 pass, 0 fail (node --test n/a: the package's tests use bun:test). - magpie's real host.js (origin/main) under bun, sandbox HOME, the package loaded from this tree, a usage.jsonl with one row per build and a preloaded fake for WorkBuddy's meter (network otherwise blocked): init provides workbuddy and workbuddy-ai; usage for workbuddy gives "deepseek-v4.1-flash tokens (est.)" 151,500,000 / 2e8, unit "", display "151.5M / ~200M", aside, models [deepseek-v4.1-flash, -sg]; workbuddy-ai gives "Free model tokens" 30,000,000 / 1e8, unit "tokens", "30.0M / 100M". Broken by hand: the card's name back to "Free model tokens": "the China build counts its own rows against 200M" and the ledger usage test go red. Not tried: a real China-build account; another CN model's window (none is measured). With several CN windows the one-entry parse cache would re-read the ledger per window each poll (one entry today). |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))". 2.x imports a package's exports["."] (a plugin dir and an npm install alike) and has no V1 path at all, so every package here that serves models failed the same way, not only trae. Every one of the 32 model packages now has: - opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an adapter that runs the package's V1 plugins inside 2.x's promise API. Config providers become 2.x providers (package pinned so the aisdk sdk hook runs), V1 auth methods become integration methods (oauth auto/code with forms; api without authorize as a key method), V1 credentials are kept in metadata.v1, the loader's baseURL, apiKey, headers and fetch are applied through the sdk hook, an auth.set renewal is stored per credential, and credential.switched /updated reload the account's own model list. - opencode.mjs, main: re-exports the V1 plugin functions only. OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin export is not a function"); the new main fixes that too. - both files in "files"; patch version bumped. devin already had 2.x and is unchanged. scripts/check.mjs fails a model package whose 2.x entry has no default {id, setup}, whose opencode2.mjs differs from the canonical one, whose entry is missing from files, or whose main exports a non-plugin. Run at this head (mote): - HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail (4914 tests, 374 files). A first run set globalThis.fetch for the whole process from opencode2.test and failed 528 tests in other packages; the block is now set and put back around that file's tests. - bun scripts/check.mjs: every package passes. With the network blocked cloudflare-workers-ai fails on its fetched catalog, the same on origin/main. - Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae 0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN" and trae-global "Trae Global" with their browser sign-ins; `auth login` starts the trae.cn authorization and waits (cancelled there); with a fake credential POSTed to /api/credential, `opencode models` lists trae-cn's six models. - Real 2.2.5 with a fake V1 key plugin through the same adapter against a local fake server: `auth login` with a key, `models`, `opencode run` reached /real/v1/chat/completions with the loader's "Bearer loader-sk-fake" and header, and printed the fake's reply; with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key from the loader. This run found the key method missing after 2.x's second integration transform (a once-only flag outside the transform); fixed, and opencode2.test checks a rebuild. - Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models` lists trae-cn and trae-global models; 0.2.26 failed there. Broken by hand (scratch copy, bun test scripts/ and check.mjs): - trae's exports back to "./index.mjs": the trae 2.x test fails (default.id undefined), check fails trae with "OpenCode 2.x: ./index.mjs has no default {id, setup} (plugins#657)". - zed's opencode2.mjs changed: the copies test fails, check fails zed "differs from scripts/opencode2.mjs". - the key flag back outside the transform: the 1.x plugin test fails on the rebuilt sign-ins (key missing). Not tried: a real sign-in with a real account on 2.x; Windows (the reporter's OS); chat.headers, chat.params, usage and tool hooks, which the adapter doesn't carry to 2.x; the tools/pages packages (calc, goanyapi, layerfs, search1api, aelios, agent-console, chat, fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x. |
||
|
|
da94c2768a |
workbuddy 0.2.17: extra credits only the detail lists have are their own window
jiabubu on Discord (magpie 0.1.2774, workbuddy 0.2.16, a China-site free account): magpie's card read "Free plan · 0 / 500" and nothing else, with no Extra credits row. 0.2.16 splits the credits only by the resource summary (CreditGroups, else its Packages). WorkBuddy's own usage panel (5.5.6, buildCreditGroups) groups the packages of the paid and free detail lists, so extra credits only those lists carry were nowhere in magpie. The usage hook now adds, when the summary has the plan's credits alone, an "Extra credits" window from the detail lists' packages that: - are an extra kind as the client's resolveCreditGroup has it (bonus 028/037, top-ups 009/038/036, rewards 007/029/030; on WorkBuddy AI also 008 and 006; the China build puts gift 006 in no group); - the summary doesn't list (never counted twice); - haven't ended, and have a total (a slice package counts the day's slice). It is set aside, and says the soonest-lapsing credits (runsOutAt/runsOut). The plan's window still stops the account. Lists that can't be read, or a summary that already splits, keep the card as it was. Run at this head on mote: `HOME=$(mktemp -d) bun test` 4892 pass, 14 skip, 0 fail; `bun scripts/check.mjs` ok. Broken by hand: not adding the window turns the new test red (1 fail). Not tried: a real account with extra credits; the China meter answered 401 for the account I could read. The fixtures are CN_FREE's shapes with a total, not jiabubu's own bytes (not seen). |
||
|
|
52fff4d7d7 |
workbuddy 0.2.16: Extra credits are every kind but the plan's base, as WorkBuddy's own panel and CreditGroups say (Jiabubu)
Jiabubu (Discord, magpie 0.1.2738, Windows): a WorkBuddy account's quota
line under Routing → Accounts and keys showed the plan's Credits only;
extra credits (gifted, promo, bought) were neither shown nor counted
apart. magpie shows every window the plugin sends, so the gap was here.
Read from the vendor, not guessed:
- WorkBuddy AI 5.9.4.42593613 (its update feed today, read, never run):
the usage panel's buildCreditGroups/resolveCreditGroup put packages in
four kinds. planBase: proMon, proMonPlus, proYear, youth, advanced,
flagship, buddyOneVip (043), freeMonIntl, the Pro trials, and freeMon
on the China build. planBonus: bonus28, bonusIntl. addon: 009, 038,
036. benefit: activity, bonus29/30, and gift and freeMon on WorkBuddy
AI.
- The real summary (/billing/meter/get-user-resource-summary, the
owner's WorkBuddy AI free account, 2026-11-03) now carries CreditGroups
with the same four Kinds: plan_base "Plan Base Credits", plan_bonus,
addon "Top-up Credits", benefit "Platform Reward Credits".
0.2.11 called the plan's bonus (bonus28, 037) the plan's, from the
client's onlyRefreshCodes, so a Pro account's 1000 bonus credits were
summed into "Credits" and no "Extra credits" window was sent (the real
Pro summary in the tests, LIVE_SUMMARY, read "89.2 / 2000" in one
window). Now:
- with CreditGroups, "Credits" is plan_base and "Extra credits" the sum
of every other kind (an unknown Kind too);
- without them, the codes split as the client's panel does: PLAN_CODES
is its planBase list (028 and 037 out, buddyOneVip 043 in); 043 is
asked for in the paid list too, as the client's list has it;
- the prepaid balance window, the aside rule and runsOutOf are as they
were.
Run on mote at this tree: HOME=$(mktemp -d) bun test (whole repo):
4872 pass, 14 skip, 0 fail; bun scripts/check.mjs ok; packages/workbuddy
316 pass. usageOf on the real WorkBuddy AI summary: one window,
"0.19 / 100", as the account has only plan_base.
Broken by hand: origin/main's index.mjs: 3 usage tests fail (the new
one, the akic404 split, the unreadable-list card). CreditGroups ignored
(code split only): the new test fails ("150 / 1800").
Not tried: Jiabubu's own summary, and any real account with extra
credits: the owner's WorkBuddy AI account has plan_base only, and the
China account's token was refused (401) by the meter, so whether
copilot.tencent.com sends CreditGroups is not seen; without them the
code split applies. Two windows rather than four: the bonus, top-ups and
rewards are one "Extra credits" window.
|
||
|
|
d51bd50cf6 |
workbuddy 0.2.15: no default effort for a chat whose max_tokens is 1024 or less (#643, itspig)
itspig's change (the commit before) skips the default reasoning_effort at max_tokens 256 or less. This raises the bound to 1024, as SMALL_BUDGET, and reads max_completion_tokens too. Anthropic's API takes no thinking under a 1024-token budget, so a /v1/messages request magpie translates with max_tokens 1024 or less can't have asked for thinking, and the gateway sends it with no effort, the same as OpenCode's default variant. 256 left 512 and 1024 asks thinking at the default. Run, at this head, on mote: - packages/workbuddy: bun test, 315 pass, 0 fail. - bun scripts/check.mjs workbuddy: ok. - Broken by hand (the SMALL_BUDGET line removed): the new test is red, 8 pass, 1 fail. Real, on the owner's workbuddy-ai account (www.workbuddy.ai, sandbox HOME, no token renewal), deepseek-v4.1-flash-sg, default effort high: - main, max_tokens 64, no effort: finish "length", 64 reasoning tokens, empty content (#643's pattern). This head: "stop", 0 reasoning, the title answered. - main, max_tokens 1024: 76 reasoning tokens. This head: 0, answered. - This head, max_tokens 2048: 65 reasoning tokens (the default still goes). - An explicit "high" at 64 still ends "length"; "low" answers. An effort the client names goes as it came. Not tried: the China site (copilot.tencent.com), deepseek-v4-pro (11102 on the AI site), kimi-k3.1-pro (11158, not for free users). |
||
|
|
8d8b108e67 |
fix(workbuddy): omit default reasoning effort when max_tokens <= 256
When a chat does not explicitly name reasoning_effort, withDefaultEffort injects the model's default reasoning effort (e.g. 'high'). However, for lightweight tasks specifying small output limits (e.g. max_tokens <= 256 like title generation or short classification), forcing a high reasoning effort consumes the entire completion token budget on reasoning alone, producing 0 text tokens before hitting finish_reason=length. Skip default reasoning effort injection when max_tokens <= 256 while preserving explicit client-specified efforts and normal-sized chats. Issue #643, PR #644. |
||
|
|
eea8c9bcf0 |
workbuddy 0.2.14: the free model's ledger estimate is shown, not routed on (#641, XiaoFeiyu9)
XiaoFeiyu9's China account (paid credits, deepseek-v4.1-flash at x0.11)
read 99% of the free model's window in routing: 187,701,367 of the 1.9e8
soft cap, from 937 answered calls and no 429, while the credits meter had
2,457 credits left. The window is this machine's ledger summed against a
cap measured on two other accounts; neither is the vendor's word for this
account, yet the card was a routing window and would have stopped the
model at 190M.
Now the summed card is set aside (aside: true): magpie shows it beside the
account and never counts it as the allowance (allowanceOf skips aside
windows). Only a refusal's card (refused: true, used 100, the vendor's
reset) stops the model. Nothing is lost by waiting for the refusal:
magpie's gateway already reads WorkBuddy's 429 reset ("将在 … 重置",
"reset at …") and its "switch to the other models" (resetsWhen,
otherModels in internal/gateway/routing.go) and rests this model alone, on
this account alone, until that time. Both builds, as both read the sum
the same way.
The China cap goes from the soft 1.9e8 to the measured 2e8 (#625's
refusals at 200,389,043 and 200,485,923). The 5% headroom only existed so
routing would stop before the vendor; with the sum aside it would only
make the card read high. The reporter's sum now reads 187.7M / 200M.
Run at this head (
|
||
|
|
3167531336 |
workbuddy 0.2.13: the free window's ledger read is linear in its rows, not their square
xmoon76 (Discord #feedback, 2026-11-02): with WorkBuddy on, the plugin host (magpie-bun run host-*.js) sat at 99% CPU, every session stalled, restarting magpie didn't help, and turning WorkBuddy off did. The cause: readLedgerTail called pinned(chain) after every row of the account it kept, and pinned walks the whole chain, so a chain with no edge in it (no readable refusal, no day-wide gap: an account a server spends on the free model all day) cost the square of its rows. Measured on mote (bun 1.4.2), a call a minute: 2,000 rows 187 ms, 4,000 771 ms, 8,000 3.1 s, 16,000 10.5 s. That ran on the host's one thread at every usage read, and the ledger changes with every call so the parse cache never held: a month of such use (~43,000 rows) is minutes per read. It reaches the China build since 0.2.12 read its window too, and WorkBuddy AI before that. pinning() now answers row by row in constant time what pinned answered for the rows read so far: the rows only grow at their oldest end and pinned was asked only while it said 0, so the one new thing a row brings is the first (newest) readable refusal or a gap between it and the oldest answered row before it. pinned stays as it was. Run at this head on mote (bun 1.4.2, HOME=$(mktemp -d)): - packages/workbuddy bun test: 313 pass, 0 fail. - whole repo bun test: 4793 pass, 14 skip, 0 fail. - bun scripts/check.mjs workbuddy: ok. - The same ledger after: 16,000 rows 14 ms, 64,000 45 ms, same window. On Linux (wsl-run, magpie-desktop): packages/workbuddy 313 pass, 0 fail; 16,000 rows 28 ms, 64,000 69 ms. Broken by hand: - the old per-row pinned(chain) put back: "a busy account's ledger is read in time linear in its rows" red, 18,009,000 Date.parse calls for 12,000 lines (bound 48,000). - pinning answering a gap with the newer row: "pinning answers as pinned does, row by row" and "a gap of a day or more pins the chain too" red. - pinning keeping the oldest refusal instead of the newest: the row-by-row test red. Not tried: the reporter's own ledger or a Docker install; their magpie and plugin versions are unknown, so that this was their spin is the best fit (it persists over restarts, stops with WorkBuddy off, and is CPU on the host's thread), not a confirmed one. |
||
|
|
f12daf6f9b |
workbuddy 0.2.12: the China build reports the free model's window too (#625)
The China build (copilot.tencent.com) now reports the free model's daily token window too, the open half of #288 (kunghim). kunghim measured it on 2026-11-02: two Free-plan accounts were refused at 200,389,043 and 200,485,923 tokens (in + cache_read + out), resetting 24h after the window opened, the same per-account window as WorkBuddy AI's at about twice its 1e8. Each build has its own window (FREE_WINDOW_CN on workbuddy rows, FREE_WINDOW_AI on workbuddy-ai rows), so one phone number signed in to both never sums the builds; the parse cache is keyed by build. windowReset reads the China refusal's "将在 … UTC+8 重置". The China card stops at a soft cap of 1.9e8, 5% short of the measured one; a refusal in force still reads it full. Reviewed at c7e4a19ef9aeb192e909fff9fcdb71d06b79e116, run on mote (bun 1.4.2, HOME=$(mktemp -d)): - packages/workbuddy bun test: 311 pass, 0 fail. - whole repo bun test: 4747 pass, 12 skip, 0 fail. - bun scripts/check.mjs workbuddy: ok. - Broken by hand: the PR's tests against main's index.mjs, 7 red (the China counting, the builds kept apart, the Chinese reset, the cache key, the usage card). Not tried: a real China-build account through magpie (the measurement is kunghim's). |
||
|
|
486a68a54f |
workbuddy 0.2.11: the plan's credits and the gifted ones are two windows, the plan's with its own cycle (akic404)
akic404 on Discord: "workbuddy 积分总量可否分离套餐内的总量和赠送的总量?… 现在这样那个匀速用量线实际没意义的,因为算上那些已用过的赠送积分,每月第一天就 看起来用了一大半了". usageOf summed CycleTotalCapacity/CycleUsedCapacity over every package of the resource summary into one "Credits" window, so gifted and activity packages' credits used long ago counted against the plan's month; the real China-site free account in usage.test.mjs (CN_FREE_SUMMARY, 2026-10-26) read 282 / 3400 with its 500 plan credits untouched. What tells them apart is the package code. WorkBuddy's client (5.9.x, app.asar, its COMMODITY_CODES and the onlyRefreshCodes / onlyExpireCodes lists its usage panel uses) refreshes proMon, proMonPlus, proYear, youth, advanced, flagship, bonus28, freeMonIntl, proTrialMon, proTrialYear, bonusIntl, and freeMon on the China build only; gift (006), activity (007, 赠送积分), bonus29/30 and the credit packs only lapse. The summary carries PackageCode and SubscriptionPackageCode (no CapacityType or name), so the split is by code: PLAN_CODES, plus the subscription the summary names. - "Credits" is the plan's packages, with cycleOf's reset and span as before, so its pace line is the plan's cycle. "Extra credits" is the rest, used / total. A summary with only one kind (or codes the client names nothing for, as the older fixtures) keeps the one summed "Credits" window, as before. The prepaid balance window is unchanged. - Only one window stops the account, as WorkBuddy serves it while any credits are left: "Extra credits" is aside, until the plan's are spent with extra ones left, then "Credits" is aside. Both spent: the plan's stops it at 100%, as the summed window did. - runsOutOf over every package stays on the window that stops the account (routing reads none set aside, cdredfox's spend-first); the aside window gets runsOutOf over its own packages. So the plan window can say a gifted package's soonest lapse while it is the one routing reads. - Enterprise accounts (no packages, enterprise meter) are unchanged. WorkBuddy AI goes through the same code with site.ai: freeMon (008) is extra there, as its client says. Run on mote at this tree: HOME=$(mktemp -d) bun test (whole repo): 4730 tests, 0 fail, 12 skip; bun scripts/check.mjs: registry.json and workbuddy ok. packages/workbuddy alone: 305 pass. Broken by hand: usage.test.mjs against origin/main's index.mjs: 3 fail (the new two, "282 / 3400" for "0 / 500", and the unreadable-lists test that now expects the split). The gating rule replaced by "extra is always aside": the akic404 test fails. Not tried: a real account. No account here has gifted and plan packages at once with credits used, and akic404's own summary wasn't seen; the split follows the client's code lists, not their bytes. magpie's GUI has no translation for "Extra credits" (it shows in English, as "Prepaid credits" does). |
||
|
|
aec58aec33 |
workbuddy 0.2.10: "Free models only" in magpie's languages, and says it filters the list (#590)
anewuser6937 (Discord, #590) saw one model in WorkBuddy's editor and took the plugin for broken: they had turned on "Free models only" themselves, but its label and description read in English inside magpie's Chinese window, and nothing by the models said the list was filtered. The switch now gives its label and description in Chinese, Traditional Chinese, Japanese and German (labels, descriptions, by magpie's window language) and says filtersModels: true, so a magpie that knows these fields says under the models that the list is filtered while it is on. Both are magpie's own fields inside auth.options, which OpenCode (AuthHook: provider, loader, methods) never reads; an older magpie's host copies only key/label/description/default/confirm, so it shows the English words as before. Nothing else changes: what the switch does is the same. Run on mote: HOME=$(mktemp -d) bun test packages/workbuddy: 303 pass, 0 fail; bun scripts/check.mjs ok. The new freeonly test ("says its words in magpie's languages, and that it filters the list", both sites) fails 2 of 2 with index.mjs put back. Loaded into magpie's real plugin host (the magpie change beside it), plugin.Providers lists both sites' free_only with all four languages and filtersModels true. |
||
|
|
6727a1e68c |
workbuddy 0.2.9: a model declared before the account's list is read takes images (#572)
kongbai01203 found WorkBuddy AI's kimi-k3 listed as image: false and reasoning: false. That is the list the plugin declares (configModels): what magpie has before an account's own list is read, for an API key whose CLI reads no config, or when /v3/config can't be read. It declared every model text-only. The live list already says kimi-k3 takes images. Read on 2026-11-01 with the owner's real accounts: both sites' /v3/config mark every model supportsImages (WorkBuddy AI's glm-5.3 aside, which textOnly already turns off, measured 10-13). Through this plugin's own loader fetch, a chat to www.workbuddy.ai's kimi-k3 with a 32x16 PNG, blue left and yellow right, answered "Blue yellow" (HTTP 200). kimi-k3-1, the id in the report, is a copilot.tencent.com model: www.workbuddy.ai answers it 400 11102 "service info not found". A declared model now takes images unless textOnly says its site drops them. Run (mote-run, bun 1.4.2, HOME=$(mktemp -d)): packages/workbuddy bun test, 301 pass 0 fail. Broken by hand: with index.mjs at origin/main, declared-images.test.mjs is 0 pass 2 fail. Not tried: the static list's models the live config no longer lists (gpt-5.5, kimi-k2.6, ...) with an image; they are declared as the config said of every model. |
||
|
|
42a5055fe0 |
workbuddy 0.2.8: deepseek-v4.1-flash takes the config's million on copilot.tencent.com again (#561)
0.2.7 capped deepseek-v4.1-flash's context at 100000 on the China build (SITES.workbuddy.contextCap, contextOf) from one report's error text, "prompt is too long: 100001 tokens > 100000 maximum", which I could not check myself. It was wrong for every other account we have numbers for. On 2026-10-31, on copilot.tencent.com with China Free-plan accounts (#561): - CNife: 110,041, 200,041, 500,041 and 900,041 prompt tokens, all 200; a 900,077-token prompt with needles at 5/40/75/99.5% recalled all four. - 1529119384: 82,767 to 992,389 tokens, all 200 with a needle at position 0 recalled; 1,157,831 answered 400 "prompt is too long: 1157831 tokens > 1048576 maximum", the vendor's own ceiling. After the 0.2.7 update the cap hurt their compaction. - UNscientific-9: 153,501 and 203,021 tokens, 200 on four accounts. brickhao on Discord said 100k compacts far too often. The cap and contextOf are gone: both sites list the config's maxInputTokens (1000000) for it, as for every other model. #563's none level from 0.2.7 stays. No cap in its place: a prompt WorkBuddy does find too long is its own 400, which the plugin already passes on as it came (explained leaves it alone, X-Magpie-Sign-In kept). magpie's tooLongRe matches "prompt is too long", so overflowed() makes it context_length_exceeded for the agent to compact, and retryable() says false for it, so no account is rested or asked again. The new tests hold that passthrough. Run: - deepseek-flash.test.mjs against 0.2.7's index.mjs on mote: 3 fail (the China million, a 1048576 config listed as given, no site caps), 5 pass; against this one: 8 pass. - Broken by hand: explained() treating "too long" as credits exhausted turns both passthrough tests red (2 fail). - The workbuddy package on mote, HOME=$(mktemp -d) bun test: 299 pass, 0 fail. - bun scripts/check.mjs on mote: ok. Not tried: a real request on copilot.tencent.com (my CN sign-ins still answer 401); the numbers above are the testers'. The passthrough test's envelopes are WorkBuddy's {code, msg, extError} as it words other 400s and the bare OpenAI shape; only the message text is the vendor's literal. |
||
|
|
fee318fed4 |
workbuddy 0.2.7: deepseek-v4.1-flash lists none (#563); copilot.tencent.com's takes 100000 tokens (#561)
#563: deepseek-v4.1-flash and deepseek-v4.1-flash-sg list a "none" level. Both sites' /v3/config call them onlyReasoning, so WorkBuddy's own client hides the off switch and the plugin listed none of it. They take it anyway. On WorkBuddy AI on 2026-10-31, reasoning_effort "none" answered 200 with 0 reasoning tokens (twice on -flash, once on -sg). "low" spent 1221 and 1127 reasoning tokens, and no effort (the plugin's default high) spent 1219. glm-5.3-flash still lists no none. The default effort stays the config's high. #561: on the China build (copilot.tencent.com), deepseek-v4.1-flash's context is capped at 100000 (SITES.workbuddy.contextCap, contextOf). A smaller config value is kept. The reporter's vendor error was "prompt is too long: 100001 tokens > 100000 maximum", seen 11 times on 2 accounts, while glm-5.3-flash on the same endpoint takes 1M. The config says 1000000 on both sites. WorkBuddy AI's deepseek-v4.1-flash took 148,793- and 181,887-token prompts, so that site keeps the million. Run: - deepseek-flash.test.mjs (new, against testdata/config-561.json, the real configs cut to the models compared) and efforts.test.mjs, against the old index.mjs on mote: 5 fail, 3 pass. The ones that pass are the glm/no-none and unchanged-sibling checks. - The workbuddy package on mote, HOME=$(mktemp -d) bun test: 297 pass, 0 fail. - bun scripts/check.mjs on mote: ok. - Real WorkBuddy AI account in a sandbox HOME, through the plugin loader: the none/low/default and long-prompt numbers above. Not tried: the China build itself. Both CN sign-ins I have (desktop on this Mac and on the Windows box) answer 401 on chat, so the 100000 cap rests on the reporter's literal error, not on a reply of my own. |
||
|
|
d0d07168ef |
workbuddy 0.2.6: an empty tool_calls list is no call, so the filter's refusal is still caught (#540)
itspig (#540, 2026-10-31) ran magpie v0.1.2283 with workbuddy 0.2.5 on
the live account, through a [workbuddy, volcengine] group: the refusal
still reached the client and routing.jsonl had the workbuddy try
done/200 with firstText 3208, no try of volcengine.
The cause: copilot.tencent.com puts "tool_calls": [] on every delta, text
too (magpie f2c7536d7 recorded it for Qoder). unsaid let the reply
through at the first delta whose tool_calls was truthy, and [] is truthy
in JS, so the gate opened at the reasoning chunk and nothing was held or
taken out. itspig's paste had no tool_calls because it was read off
magpie after chatTidy dropped the empty list and Go re-wrote the chunk
with its keys sorted; 0.2.5's fixture was built from that paste.
unsaid now counts a tool_calls list only when it holds a call.
Run (on mote, mote-run):
- HOME=$(mktemp -d) bun test packages/workbuddy: 291 pass, 0 fail.
- bun scripts/check.mjs: exit 0.
- filtered.test.mjs: the paste's chunks with WorkBuddy's own framing
("tool_calls": [], "finish_reason": "" until the last, an empty
reasoning_content beside the line) cut every 1, 7 and 1MiB bytes; the
line split over deltas that each carry the empty list; a real call
still lets the reply through as it came.
- End to end, in magpie's plugin host (a magpie worktree's gateway test,
not committed there): this file loaded by the host behind a fetch
shim pointing copilot.tencent.com at a fake vendor, signed in with an
API key, in a group [workbuddy-plugin/deepseek-v4.1-flash, b/m], asked
as a streamed chat, a one-body chat, Messages (Claude Code's ask) and
Responses (Codex's ask). With 0.2.6, 8 of 8 hand on to b and say no
"Sorry", for the paste and for the wire framing.
Broken by hand:
- 0.2.5 (
|
||
|
|
b5cc78266f |
workbuddy 0.2.5: the filter's line is taken out with the newlines around it (#540)
itspig (#540, 2026-10-30) ran 0.2.4 against copilot.tencent.com and the refusal still reached the agent. The real chunk's content is "\nSorry, I can't respond to this question.\n" with finish_reason content_filter. filterSaid trimmed only the start, so the trailing "\n" made the text longer than FILTER_SAYS, the prefix test failed, and the chunk went out as an ordinary answer. filterSaid now trims both sides, and text that is only white space so far may still be the line (so a "\n" sent in a chunk of its own is held, not passed on). The reporter's suggested `t.startsWith(s)` is not taken: it would treat the line followed by real words as the filter's and drop those words at content_filter. `without` already removes the whole content field, so the newlines go with it. Run (on mote, mote-run): - HOME=$(mktemp -d) bun test packages/workbuddy: 286 pass, 0 fail. - bun scripts/check.mjs: ok. - filtered.test.mjs has itspig's literal last three SSE events (the " node" reasoning chunk, the refusal chunk, [DONE]), cut every 1, 7 and 1MiB bytes, plus newline-in-its-own-chunk, line-then-more-words and newline-then-answer cases. Broken by hand: - 0.2.4's trimStart filterSaid: the 3 literal-bytes tests and the own-chunk newline test go red (4 of 15). - The reporter's trim() + t.startsWith(s) with t !== "": the own-chunk newline and line-then-more-words tests go red (2 of 15). Not tried: a live WorkBuddy account; the trigger prompt was not run. |
||
|
|
4883f9437f |
workbuddy 0.2.4: the filter's canned line is taken out of a reply it ends content_filter (#540)
itspig (#540): deepseek-v4.1-flash on copilot.tencent.com, through a group, reasoned, said "Sorry, I can't respond to this question.", and ended finish_reason content_filter with 0 output tokens, all under a 200. magpie recorded the try done/200, never asked the group's next member, and DeepSeek Harness failed "The model refused to complete the request". unsaid() now reads a streamed chat's events: text that is still the filter's line (FILTER_SAYS, the issue's literal words) is held; when the reply ends content_filter with nothing else said, that text is taken out, so magpie sees reasoning then content_filter with nothing said, which it hands on (magpie holds DeepSeek's reasoning for that from its next release). Any other text goes as it comes, released at its first word that isn't the filter's; the same words ending stop, and a reply the filter cuts off after other words, go through byte for byte. Native (Messages) requests are not touched. Run on mote at this tree: HOME=$(mktemp -d) bun test: 3970 pass, 9 skip, 0 fail; bun scripts/check.mjs: every package ok. Broken by hand: without unsaid() in the chat path, the 5 refusal cases of filtered.test.mjs go red and the 4 pass-through cases stay green. Not tried: a real WorkBuddy refusal (I have no prompt that reproduces it); the stream's literal chunking is not in the issue, so the tests cut the line into one delta, three deltas, the finish chunk itself, and 7-byte writes. Only the English line from the issue is known; a Chinese variant would pass through as before. |
||
|
|
3968cdd75f |
workbuddy 0.2.3: a refused opening is said with a comma first, and remembered (#513)
A chat WorkBuddy refuses as an unapproved channel (11128) for an opening FLAGGED
doesn't know is sent once more with one more comma in the opening ("You are an
AI agent, powered by X.") before the system prompt is moved into the first user
message. The comma is set in system and assistant messages only; user messages
and tool results go out as written. A system prompt whose comma passed is
remembered (bounded at 256, like refusedSystems) and its next chats go with the
comma before the first send, so a tool loop is not refused on every step. A
refusal that stands names REFUSED.md (new) before the hint; that address is
only in the error returned to the client, nothing sent upstream names magpie.
Version 0.2.3.
Run at the reviewed head cb8a026 on mote (macOS), temp HOME, outbound network
denied by sandbox-exec (localhost allowed):
- packages/workbuddy `bun test`: 271 pass, 0 fail.
- repo root `bun test`: 3774 pass, 1 fail (layerfs import-limit, fixed on main
by
|
||
|
|
79b02cc568 |
workbuddy 0.2.2: DeepSeek Harness's opener keeps the harness's name (#511)
WorkBuddy refuses DeepSeek Harness's opener "You are an AI agent powered by DeepSeek Harness." as 11128 (#279). The plugin used to reword it into "You are an AI agent that helps the user with programming tasks.", which dropped the harness's name from the line the rest of a DSH prompt refers back to. It now adds one comma ("You are an AI agent, powered by DeepSeek Harness."), which the author measured passing WorkBuddy's whole-line check (400 11128 without the comma, 200 with it, copilot.tencent.com, 2026-10-30).
Run at the reviewed head 4830b16, merged onto main
|
||
|
|
b9cbb9dd01 |
workbuddy 0.2.1: an enterprise (教育公益版, team) sign-in is named with its enterprise, kept beside the personal one
A person's personal account and their enterprise account (a team, or 「WorkBuddy 教育公益版」, picked on WorkBuddy's sign-in page after the phone sign-in) share the uid and the nickname. magpie's plugin host keeps one account per name and uid (settle in host.js), so signing in to the education account replaced the same person's personal account, and the two could never sit in one pool. A browser sign-in that WorkBuddy places in an enterprise is now named "nickname · enterprise name": the name from /login/account, else from the matching /v2/plugin/accounts entry, else "enterprise <last 6 of id>". A personal account's name is unchanged. Old data: an enterprise account signed in before keeps its old name until its Sign in again, which uses the same key and renames it in place; its free-model window, read from ledger rows under the old name, starts again (README says so). Run (mote, HOME=$(mktemp -d)): bun test in packages/workbuddy, 256 pass 0 fail; bun scripts/check.mjs ok. Broken by hand: accountName returning the nickname alone turns the 4 new enterprise.test.mjs tests red. Not tried: a real education account (the owner has none; the live /v2/plugin/accounts shows only a personal entry), so enterpriseName's presence in WorkBuddy's replies for 教育公益版 is from the web client's SelectAccount code, not a live reply; the id fallback covers its absence. |
||
|
|
3f73907aac |
workbuddy 0.2.0: WorkBuddy (China) daily check-in through the billing meter (#177)
WorkBuddy (China) claims its daily check-in credits through the billing meter's /v2 activity status and daily-checkin. Outcomes are done, ineligible, inactive, claimed and failed, all of which magpie's host accepts. A request that gets no answer is thrown, for magpie's 1-minute backoff. The AI build has no hook. The review merged main (0.1.48) in, resolving the conflicts in meter, the hook list, _internal and README. It also made an API-key account ineligible without sending a request, and set the version to 0.2.0. Run at d66f51c on mote, with a temp HOME: - bun test packages/workbuddy: 253 pass, 0 fail - the whole repo: 3521 pass, 0 fail (3529 tests) - bun scripts/check.mjs workbuddy: ok Broken by hand, each red: - dropping the API-key line: its new test - the hook on the AI build: "WorkBuddy AI's plugin has no check-in" - an unreadable 200 not thrown: the usage test and the check-in test Not covered: main's own invalidToken flag on a refused meter reply has no test that fails without it. That gap is on main and was kept as it is. |
||
|
|
f0ed150573 |
workbuddy 0.1.48: WorkBuddy AI's card shows the free model's daily token window (#299)
WorkBuddy AI's free model (deepseek-v4.1-flash) has a daily token window of its own (about 1e8 tokens per account per 24h) that the credit meter doesn't show. The plugin rebuilds it from magpie's usage.jsonl and adds it to the card as "Free model tokens" beside Credits. WorkBuddy AI only; the China build is unchanged. Review merge: main (0.1.47) merged into the branch, conflicts in index.mjs (imports, _internal) and package.json resolved, version 0.1.48. Added a test that the window reaches the WorkBuddy AI card from a ledger in the sandbox HOME, and that the China build's card has none. Run at 09718f5 on mote (HOME=$(mktemp -d)): - bun test packages/workbuddy: 237 pass, 0 fail (before the new test). - bun test (whole repo): 3499 pass, 0 fail; bun scripts/check.mjs: ok. - Broken by hand, each reverted: the card no longer pushing the window -> the new usage test red; an unreadable row time ending the read -> "a row whose time cannot be read is passed over" red. Not tried against the live service (no WorkBuddy AI free account). Co-authored-by: keeuu <keeuu@users.noreply.github.com> |
||
|
|
1e7122e161 |
workbuddy 0.1.47: a conversation's ids are one account's own
leaves5760 on Discord: every account of a group of WorkBuddy accounts gets 403 "request illegal", WorkBuddy saying the account is restricted for abnormal behaviour. X-Conversation-ID and X-Conversation-Request-ID were derived from the session (or first user message) and the turn alone, with a salt per process. One magpie session spread over several accounts therefore sent the same conversation and turn ids under every account's X-User-Id. WorkBuddy's own client (5.9.3, @genie/agent-cli 2.165.0) is signed in as one account, so a conversation never shows up under two. The ids now also hash the account (uid, enterpriseId, and for a key account the key), and a chat sent again after a 401 as another account (a sign-in saved since) gets that account's ids. The same account keeps stable ids as before. This is a divergence from the official client found by reading its bundle, not a verified cause of the restriction. Not changed, reported only: no X-Private-Data, traceparent/baggage, reasoning_summary "auto", or the client's /v2/report telemetry. Run on mote at this tree: HOME=$(mktemp -d) bun test in packages/workbuddy, 209 pass 0 fail; bun scripts/check.mjs exit 0. Broken by hand: with the account left out of the ids, both new tests (conversation.test.mjs, unauthorized.test.mjs) fail; with reattend a no-op, the 401 test fails. Not tried: a real WorkBuddy account (none used, by the task's rule). |
||
|
|
b08a6c1bce |
workbuddy 0.1.46: WorkBuddy AI's chats carry its current 5.9.3 client's headers
Two Discord users report WorkBuddy AI accounts answering 403 11140
("account restricted due to unusual activity"). While looking into it,
the plugin was found sending WorkBuddy AI's chats as a client one release
behind: WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0, X-IDE-Version
5.8.4, no X-Agent-Runtime. Not shown to be the cause of the restrictions
(no real account was used); it is a header that no longer matches the
official client.
Read (never run) on 2026-10-29, unauthenticated:
- www.workbuddy.ai/v2/update?platform=workbuddy-darwin-arm64 answers
5.9.3.42398134 for every version asked from 5.3.0 to 5.8.4.41366630
(the desktop's resolveUpdateClientTypePrefix maps workbuddy-ai to
"workbuddy"), download.codebuddy.ai, last-modified 2026-10-27.
- That zip, range-read: "WorkBuddy AI.app" CFBundleShortVersionString
5.9.3, bundle id com.workbuddy.workbuddy-ai, cli/package.json
@genie/agent-cli 2.165.0, cli/product.json productName WorkBuddy AI,
platform workbuddy-ai, Electron Framework 37.10.3.
- Every file under app.asar.unpacked/cli has the China 5.9.3 zip's CRC
but product.json and sandbox-config.json, so the CLI's headers
(UserAgentHttpInterceptor, axiosToFetchAdapter, X-Stainless-*, gzip)
are the China build's.
- Its app.asar puts agentRuntime `local-agent` in the prompt meta, as
the China build's does, so X-Agent-Runtime: local-agent goes on
WorkBuddy AI too.
Now WorkBuddy AI sends WorkBuddy/5.9.3 workbuddy-ai/5.9.3 CLI/2.165.0,
X-IDE-Version 5.9.3 and X-Agent-Runtime local-agent; the China build is
unchanged.
Run (on mote, HOME=$(mktemp -d) bun test in packages/workbuddy): 207 pass,
0 fail. bun scripts/check.mjs: exit 0.
Broken by hand: conversation.test.mjs on origin/main's index.mjs (0.1.45):
2 of 13 red (the WorkBuddy AI User-Agent, and the per-build header test).
Not tried: a real WorkBuddy AI chat with the new headers. Still not sent:
X-Device-Token (Tencent's native device SDK). No text added names magpie
or WorkBuddy's limits.
|
||
|
|
880cd9319c |
workbuddy 0.1.45: only a chat completion goes gzipped; magpie's drawings go as plain JSON
iwinux on Discord (2026-10-28 ~22:30 UTC+8, magpie v0.1.1812): the Magpie
Image MCP through WorkBuddy AI failed from the minute 0.1.43 was published
(14:30Z) with
400 Bad Request: Unmarshal create image params failed with error:
invalid character '\x1f' looking for beginning of value (11101)
0.1.43 (
|
||
|
|
95fa76126d |
workbuddy 0.1.44: a huge chat's ids are hashed in pieces, and it is read once on every path (#461)
0.1.42 brought jihuayu's 45 MiB repro from 7 parses a request to 2, and
0.1.43 keeps that: one full parse and one full stringify a request. What
was left of the peak was attendChat: the conversation and turn ids were
made from template strings holding the whole user message (`first:${sig}`,
`u1:${sig}`, `${conv}|${turn}`, then `${SALT}|kind|${key}`), each a fresh
45 MB string, ~160 MiB of peak a request. The keys are now lists of
pieces fed to one sha256 each, whole (Bun hashes a one-byte string in
place; 1 MiB slices cost a copy and were worse), with a high surrogate
split between pieces held for the next one, so every id is the hash of
the same string as before.
Also read once on paths the repro doesn't take:
- "Free models only" parsed the body again for its model; it reads the
chat prepared already parsed.
- A model known to want a reply after tools (11153) had the body parsed
and stringified again on every request; the reply goes into the one
parsed chat before the one stringify.
- The prepared result no longer holds the parsed tree past the send.
Every byte WorkBuddy sees is unchanged: sent.test.mjs runs 12 chats
(OpenCode tools, default effort, developer turn, after-tools refusal and
known, system refusal and known, both, Messages, bytes, not JSON),
switch off and on, and holds the gunzipped body's sha256, url, encoding
and which requests share an id to testdata/sent-0.1.43.json, made by
running the same harness on npm's 0.1.43 index.mjs (sha 9213db6d...).
Run on mote (Bun 1.4.2), the issue's benchmark.mjs as written but for
the import, 45.3 MiB body, 4 requests, concurrency 1, /usr/bin/time -l,
3 runs each:
direct (no plugin) 336 MiB
0.1.41 981-1117 MiB, 28 parses (1087.5 MiB), 24 stringifies
0.1.43 717-760 MiB, 8 parses (181.3 MiB), 20 stringifies
0.1.44 583 MiB all 3 runs, same counts, ~370-420 ms wall
(0.1.43 ~400-530 ms)
One request: direct 134, 0.1.41 569, 0.1.43 390, 0.1.44 275 MiB (with
id derivation stubbed out entirely: 229).
- HOME=$(mktemp -d) bun test in packages/workbuddy at this head:
201 pass, 0 fail. bun scripts/check.mjs workbuddy: ok.
- Broken by hand, each red: free-only parsing again -> the free-only
parse-count test; reply after tools put in by re-parsing -> the
after-tools parse-count test; no surrogate hold -> the idFor pieces
test; the reply put in before the system move -> sent.test.mjs.
gzip was measured too: Buffer.from before gzipSync made no difference
to the peak, so it is unchanged.
Not tried: a live WorkBuddy request; the reporter's Linux and Bun
1.4.4 (mote has 1.4.2); concurrency 4; a huge body that isn't ASCII
(Bun keeps it two-byte, so hashing it may copy); a huge Messages body
(its own path, not changed here).
|
||
|
|
f4d48ac3ee |
workbuddy 0.1.43: a chat names the model's default effort as WorkBuddy's client does, and goes gzipped
troilus1011 on X: WorkBuddy's DeepSeek in OpenCode through magpie thought at low and high, never at the default. OpenCode's default variant names no reasoning_effort, and WorkBuddy doesn't think without one: measured on www.workbuddy.ai with 0.1.42, deepseek-v4.1-flash gave 0 reasoning tokens with no effort (2 of 2), 0 at none, 16/37 at low, 34/56 at high. WorkBuddy's own client (CLI 2.165.0 in WorkBuddy 5.9.3, configureThinkingSettings) sends the session's effort, else the reasoningEffort setting, else the model's reasoning.defaultEffort from /v3/config, which is "high" for this model on both builds. A chat that names no effort now gets the model's own defaultEffort when its listed levels hold it, read from the same cached /v3/config list (one read per minute; a failed read leaves the chat as it came and is not retried on every chat). An effort the client names, none included, is untouched and the list isn't read for it. Models with no reasoning config get nothing. runmiNeverstop on X: 2.89 GB up to copilot.tencent.com through magpie. WorkBuddy's client gzips a model request's body (GzipRequestProcessor, on with productFeatures.RequestBodyGzip, true in both builds' product.json and not turned off by the remote config); the plugin sent it as plain JSON. Agent chat JSON (the whole history each turn, tool schemas) compresses several-fold, so the upload was several times what the official client sends for the same turns. A chat-completions body now goes gzipped with Content-Encoding: gzip on both builds; unanswered() weighs the gzipped size against the front door's 2 MiB. Claude's Messages route goes as it came (not tried gzipped live). Run (on mote, HOME=$(mktemp -d) bun test in packages/workbuddy): 197 pass, 0 fail. bun scripts/check.mjs: exit 0. Fakes that parse the sent body gunzip it (testdata/unz.mjs); reset.test.mjs's 2 MiB bodies are random base64 so they stay over 2 MiB on the wire. Live (www.workbuddy.ai, a real account in a sandbox HOME): with 0.1.43 the default sent reasoning_effort high gzipped and thought (34 and 51 reasoning tokens), none stayed 0, low and high as before, all 200. A gzipped chat answered 200 the same as a plain one. Broken by hand: origin/main's index.mjs with the new default-effort.test.mjs: 5 of 8 red (default effort, failed-read reuse, both gzip tests, defaultEffortOf); the 3 that pass guard what must not change (named efforts, models without a default, Messages). Not tried: a live chat on the China build (copilot.tencent.com answered 401 to every token available here, its /v3/config read fine); Messages gzipped; the reporters' own OpenCode sessions end to end. |
||
|
|
f2b0dacdb7 |
workbuddy 0.1.42: a chat is parsed once on its way, and goes as it came when nothing changed (#461)
jihuayu measured a 45 MiB chat going through 0.1.41's fetch: each step (withSystem, fitted, normalizeToolChoice, attend, the model, systemKey) parsed the whole body again, 6 parses a request, and normalizeToolChoice wrote it out whole even for an unchanged "auto". Bun's RSS reached 618-751 MiB for 4 serial requests where passing the body through took 270. prepared parses a request once. Each step makes its own change to that one object, in the same order (systemOn, fitTools, toolChoiceOn; unsignedOn for Messages). attend, the model and the system key read the same object, and a refused system prompt moves on it (systemAsUserOn). The body is written out once, only when a step changed it. The parsed chat is let go before the request is sent. A body a step throws on goes through the steps one by one, as before. The string-level helpers stay as wrappers. What was run, on this tree: - mote, the reporter's benchmark (no network, fetch stubbed, 4 x 45.3 MiB, peak RSS sampled every 5ms): 0.1.41 7 parses/request, 1087.5 MiB parsed, peak RSS 1096 / 979 MiB. This change: 2 parses/request (the request and the stub's SSE reply), 181.3 MiB parsed, peak 682 / 680 MiB. The bodies sent have the same SHA-256 in both. - HOME=$(mktemp -d) bun test packages/workbuddy on mote: 189 pass, 0 fail. bun scripts/check.mjs workbuddy: ok. - oneparse.test.mjs (new): 17 chat shapes, invalid JSON and bytes come out the same as the steps one by one made them, with the same tool names; an unchanged chat goes byte for byte; the loader parses a 2 MiB chat once. Broken by hand: every request sent through the step-by-step fallback, the loader test FAILs (5 parses, want 1). An unchanged "auto" counted as a change, the byte-for-byte test FAILs. - Real account (WorkBuddy AI, free-only on, sandbox HOME, this Mac): deepseek-v4.1-flash, a 373-byte chat and a 205,595-byte chat with a developer message, max_completion_tokens and a dotted tool name, through 0.1.41 and this change: 200 "OK" on all four; no sign-in refreshed. npm has 0.1.41, so 0.1.42 is free. Reported-by: jihuayu |
||
|
|
e460dae2f0 |
workbuddy 0.1.41: a package with no cycle total reads as a wallet balance (#450)
A WorkBuddy package with no CycleTotalCapacity is a prepaid wallet: it is sent as a balance window ("Prepaid credits", magpie#3950), beside the share of packages that have a total. A literal "0" total stays on the old path, so a lapsed package adds nothing; an account with no packages keeps its unknown allowance (no TotalCredits fallback).
Reviewed at 5bdfa9048d66095d35af5e7955d0945db02dc3b5 over four rounds. Run on mote at that head: HOME=$(mktemp -d) bun test packages/workbuddy, 185 pass / 0 fail; bun scripts/check.mjs workbuddy ok. npm had 0.1.40, so 0.1.41 is free.
Co-authored-by: MYCF711 <MYCF711@users.noreply.github.com>
|
||
|
|
b2fe48ea2e |
workbuddy 0.1.40: chats carry the current desktop client's headers
WorkBuddy accounts are being restricted, and a report says WorkBuddy now checks request-header fingerprints. Diffed the plugin's chat request against each build's current desktop app, read (never run) from the update feeds on 2026-10-28: - China: WorkBuddy 5.9.3.42398134 (copilot.tencent.com/v2/update), bundled @genie/agent-cli 2.165.0. - WorkBuddy AI: 5.8.4.41366630 (www.workbuddy.ai/v2/update), CLI 2.161.0. The chat is the CLI's OpenAI client (openai 6.25.0) through axiosToFetchAdapter, with UserAgentHttpInterceptor and the desktop's CLIENT_INFO_* env (sidecar-manager getCachedBaseEnv). What differed, and now matches: - User-Agent: was WorkBuddy/5.5.6; the client sends "WorkBuddy/<app> <applicationName>/<app> CLI/<cli>": WorkBuddy/5.9.3 WorkBuddy/5.9.3 CLI/2.165.0 (China), WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0 (AI). The /v3/config models call (was CLI/2.0.0 WorkBuddy/5.5.6) takes the same one, as the CLI's CloudProductProvider sends it through the same interceptor. - X-IDE-Version: was 5.5.6; now the app's version. - X-Agent-Type: main was sent on WorkBuddy AI only; the adapter sets it on every model call on both builds. - X-Agent-Runtime: local-agent, new in 5.9 (the desktop's local transport puts agentRuntime local-agent in the prompt meta); China build only, 5.8.4 has no such header. - Accept: application/json and the OpenAI SDK's X-Stainless-* (Lang js, Package-Version 6.25.0, OS/Arch of this machine, Runtime node, Runtime-Version v22.21.1 = Electron 37.10.3's Node, Retry-Count 0, Timeout 1200); the adapter strips them only in its skip-auth mode. - The desktop's own calls (billing, plugin API) send WorkBuddy/<app>; they now send the current app version instead of 5.5.6. Not matched: X-Device-Token (TuringShield native SDK, sent since at least 5.6.2), traceparent (only while server-side tracing is enabled), and transport-level differences (Bun's fetch vs axios on Node: header order, Accept-Encoding). Run: HOME=$(mktemp -d) bun test packages/workbuddy: 184 pass, 0 fail. With the old index.mjs the 4 changed tests fail (UA, IDE version, config UA, the new per-build header test). Not tried: a real account's chat or /v3/config with the new User-Agent (unauthenticated /v3/config answers the same for old and new). No text added names magpie or WorkBuddy's limits. |
||
|
|
7f99447ed2 |
workbuddy 0.1.39: an earlier turn's reasoning_content goes as reasoning, as WorkBuddy's own client sends it
uk.jent on Discord: Grok Build's chat.completions history lost its thinking on WorkBuddy. Grok Build 1.0.67 sends an earlier assistant turn's thinking as reasoning_content; magpie and this plugin pass it on byte for byte, and WorkBuddy drops it. WorkBuddy's own client (CodeBuddy's agents converter, applyPendingReasoning) sets `reasoning` on the assistant message and skips its reasoning_content backfill for WorkBuddy's own hosts. The chat path now does the same: reasoning_content, or reasoning_details' text, becomes `reasoning` (one the client set is kept) and the original fields are left out. Nothing is folded into content as <think>, since WorkBuddy's client doesn't send it that way. The Messages route (Claude on the China build) is unchanged. Run: packages/workbuddy `bun test` with a temp HOME (183 pass); `bun scripts/check.mjs` all green. Live on www.workbuddy.ai (a real WorkBuddy AI account, access token only, refresh left out), a codeword in the earlier turn's thinking, asked for after the tool result: before, reasoning_content reached no model (0 of ~15 across kimi-k2.6, kimi-k3, glm-5.3, deepseek-v4.1-flash, minimax-m3) while `reasoning` did on kimi-k2.6 and minimax-m3; through 0.1.39 a reasoning_content history reached kimi-k2.6 2 of 8 and minimax-m3 4 of 9, with the no-thinking control 0 every time. glm-5.3, kimi-k3 and deepseek-v4.1-flash never quoted it in either spelling. Broken by hand: index.mjs from origin/main: reasoning.test.mjs 4 of 4 red; with the asReasoning call commented out, its two end-to-end tests red. Not tried: the China build (copilot.tencent.com; its desktop sign-in answered 401), and Grok Build end to end through WorkBuddy (its request was captured against a fake server). The "thinking loop" the report names wasn't reproduced; the plugin doesn't touch the reply stream. |
||
|
|
18268848d3 |
workbuddy 0.1.38: a "Free models only" switch that never spends credits (#430)
kongbai01203 asked for a hard stop on WorkBuddy credits: use only the free models, and never let a paid one through by mistake. Each site (workbuddy, workbuddy-ai) now declares a magpie plugin option, free_only, "Free models only", off by default. With it on: - models() lists only the models priced free now (priceOf: a model free only at night, or one with no price, is paid). A list that can't be read, or an API key WorkBuddy lists no prices for, is a failure, not the built-in list. - fetch reads the model from the body and, unless /v3/config lists it as free, answers 404 model_not_found itself and sends nothing. The message has no quota words, so magpie's gateway rests that model only and falls through, not the account. A price list that can't be read answers 503 and sends nothing. The list is kept a minute per account for requests. Off, nothing changes: the config isn't read on a request. Run: - HOME=$(mktemp -d) bun test packages/workbuddy: 179 pass (freeonly.test.mjs new, both sites); bun scripts/check.mjs: ok. - Real accounts, sandbox magpie (HOME under the scratchpad, magpie wb-free-only branch, this package added by path): with the switch on for workbuddy-ai the list went 26 -> 2 (hy3, deepseek-v4.1-flash) within 2s, workbuddy (own switch) stayed at 19; gpt-5.4 got the 404 with nothing sent, hy3 and deepseek-v4.1-flash answered. Off: 26 again, gpt-6-luna and gpt-5.4 answered (no rest left on gpt-5.4). Broken by hand: without the fetch check 4 tests fail; with onlyFree returning every model 2 fail. Not tried: the GUI switch itself (set through /api/settings/plugin-option); the workbuddy (China) site's switch with a real request; Responses or Anthropic bodies against the real API (the model is read the same way). |
||
|
|
4bde462e21 |
workbuddy 0.1.37: sign in with an API key (#407)
Both builds offer "<build> API key" beside the browser and desktop
sign-ins, for a key made on the build's keys page
(www.workbuddy.cn/profile/keys, www.workbuddy.ai/profile/keys).
A key is sent as WorkBuddy's own CLI sends CODEBUDDY_API_KEY
(@tencent-ai/codebuddy-code 2.177.0, read as data): its API-key
session has the key as the access token, uid "anonymous_" + the key's
last 8 characters, personal, no domain, no enterprise; model requests
carry X-API-Key: <key> and Authorization: Bearer <key>
(getCustomHeaders). So a key's chat has those, X-User-Id
anonymous_<last8>, no X-Domain, and the client headers the other
sign-ins send, to the same host: copilot.tencent.com/v2 for workbuddy
(the CLI's endpoint for CODEBUDDY_INTERNET_ENVIRONMENT=internal; it
treats www.workbuddy.cn and copilot.tencent.com as front doors of one
API) and www.workbuddy.ai/v2 for workbuddy-ai.
The loader's apiKey "" and x-api-key delete stay: they keep the SDK's
own (empty) key headers off; sign() now sets X-API-Key itself for a
key account and never for an OAuth one.
- Models: /v3/config is asked with a key only for ck_/pt_ keys, as the
CLI's shouldLoadRemoteConfig does; any other key keeps the built-in
list.
- Usage: a key's card says the credits are unknown and asks nothing
(the CLI reads no credits with a key; no endpoint guessed).
- A 401 on a key is never renewed or resent: it says the key was
refused and where to check it, marked expired only on
invalid_token. The >2 MiB reset probe doesn't ask the billing API
with a key.
Run at this tree (base
|
||
|
|
213ef506c5 |
workbuddy 0.1.36: a free account's credits say when the plan refills (#415)
A free account's card says when the plan refills: with no subscription named, cycleOf reads the plan_base slice's cycle end (UTC+8). A summary that names a subscription still goes by it alone, and named-but-not-listed stays unknown. By MYCF711. Reviewed at b8d600c9: - `HOME=$(mktemp -d) bun test` in packages/workbuddy: 155 pass, 0 fail. - The named-not-listed assertion fails on the PR's first head (b1ce408), which returned the slice's month end for a paid account; passes now. - npm had 0.1.35; this is 0.1.36. Not tried: a real WorkBuddy account (the fixture is the author's live CN reply). |
||
|
|
9da5cd3426 |
workbuddy 0.1.35: used credits say when the plan's cycle starts again (windy on Discord)
windy's WorkBuddy card in magpie showed 46% of the credits used and, beside it, "Not used yet". The Credits window had no resetsAt, and magpie's card says "Not used yet" when no used window has a reset. WorkBuddy's own client (5.5.6, getCurrentPlan) says the plan refreshes at the cycle end of the package the summary names as the subscription (SubscriptionPackageCode). cycleOf now gives the Credits window that reset (CycleEndTime, UTC+8) and the cycle's span, from the paid and free lists usage already reads for runsOutOf; none named, not listed or a cycle already over leaves it unknown, as before. Run: bun test in packages/workbuddy, sandbox HOME, fetch stubbed: 154 pass 0 fail. On the old index.mjs the two new tests fail (resetsAt undefined; cycleOf's cases). bun scripts/check.mjs: workbuddy ok. Real: the summary and paid list of a real WorkBuddy AI Pro account (2026-10-26, read-only, no renewal) through the new code give Credits 89.2 / 2000, resetsAt 2026-10-28T16:40:52Z, span 30d-1s. Not tried: a China-site (copilot.tencent.com) account: the desktop sign-in on this machine is refused (401), so a CN free plan's SubscriptionPackageCode wasn't seen; without one the card stays as it was. magpie's card saying "Not used yet" beside a used window without a reset is fixed in magpie itself. |
||
|
|
d248efa7a1 |
workbuddy 0.1.34: a free account's plan is "Free plan", not "Free" (#337)
Buger2008 read the "Free" beside their WorkBuddy account in Providers as
the model they picked (Deepseek-V4.1-Flash, 0.11x) being free, and as why
routing chose WorkBuddy first. It is the account's plan; routing doesn't
read it. The label now says it is a plan. Nothing in magpie or the plugins
compares a plan to "Free" (grepped internal/ and packages/).
Run: bun test in packages/workbuddy, sandbox HOME, network at a dead
proxy: 152 pass 0 fail; on the old index.mjs the 4 tests that say the
label fail. bun scripts/check.mjs: workbuddy ok.
Not tried: a real WorkBuddy account in the GUI.
Siblings: trae ("Free", d.plan || "Free") and mimo (plan "Free") say the
same; filed as their own issue.
|