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 3dd0f44). cb8a026 merged with origin/main 4d8d031: 3777 pass, 0 fail.
- `bun scripts/check.mjs`: only cloudflare-workers-ai fails, with the network
refused (#519); workbuddy ✓.
Broken by hand: no commaSystems.add -> remembered-comma test red; no pre-send
commaPausedOn -> same test red; role filter removed -> 5 tests red.
Not covered: dropping the roles.has("system") guard leaves every test green
(an assistant-only comma would be remembered). Not tried against
copilot.tencent.com in this review.
Co-authored-by: MYCF711 <MYCF711@users.noreply.github.com>
WorkBuddy's 11128 "Illegal API invocation from an unapproved channel"
ended in "WorkBuddy refuses chats from Codex and Claude Code (their system
prompt); ...". DeepSeek Harness's and Claude Desktop's chats are refused
the same way (#279, #170), and Codex's and Claude Code's words are already
reworded by FLAGGED, so the hint blamed the wrong clients. It now reads:
WorkBuddy refused words in this client's prompt (most often its system
prompt); use it from Hermes, OpenCode or Pi, or add another provider to
this group
"Prompt" rather than only "system prompt", as WorkBuddy reads every
message (Claude Code's main-branch line was in its first user message).
magpie's Routing page (WB_REFUSED in its routing client.js) has the same
text word for word in the same change, so it still says the hint apart
from WorkBuddy's own words.
Run: HOME=$(mktemp -d) bun test from the repo root: 2012 pass, 0 fail.
bun scripts/check.mjs: exit 0. With index.mjs put back to HEAD's,
refused.test.mjs's "the hint is magpie's word for word, and blames no one
client" fails (Expected the new text, received the old); restored, 14 pass.
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.
* 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>
- 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