workbuddy 0.1.28: the "unapproved channel" hint names no one client, not only Codex and Claude Code (#279)
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.
This commit is contained in:
@@ -85,7 +85,10 @@ default one, as the app does.
|
||||
|
||||
WorkBuddy refuses some agents' identity lines as an "unapproved channel"
|
||||
(11128), so those lines are reworded before a chat goes out. Since 0.1.27
|
||||
(#279) that includes DeepSeek Harness's opening line.
|
||||
(#279) that includes DeepSeek Harness's opening line. A refusal of words
|
||||
not reworded yet ends in a hint that names no one client (since 0.1.28):
|
||||
WorkBuddy refused words in this client's prompt; use it from Hermes,
|
||||
OpenCode or Pi, or add another provider to the group.
|
||||
|
||||
The loader also translates OpenAI-compatible request spellings WorkBuddy
|
||||
doesn't take: `max_completion_tokens` becomes `max_tokens`, `developer`
|
||||
|
||||
@@ -1699,11 +1699,15 @@ function makePlugin(site) {
|
||||
|
||||
// REFUSED_HINT is what the user can do about WorkBuddy's "Illegal API
|
||||
// invocation from an unapproved channel": both builds answer it to a chat
|
||||
// holding words of Codex's or Claude Code's own (magpie #182), whatever the
|
||||
// headers. FLAGGED rewrites the ones known; this is for one it doesn't know. It ends the error's message, as magpie's built-in
|
||||
// put it (provider.WBRefusedHint), so magpie's routing page says it apart.
|
||||
// holding words they turn away, whatever the headers. Codex's and Claude
|
||||
// Code's were the first (magpie #182), DeepSeek Harness's and Claude
|
||||
// Desktop's came later (#279, #170), and WorkBuddy reads every message, so
|
||||
// it names no client. FLAGGED rewrites the words known; this is for ones it
|
||||
// doesn't know. It ends the error's message word for word as magpie's
|
||||
// Routing page has it (WB_REFUSED in its routing client.js), which says it
|
||||
// apart from WorkBuddy's own words.
|
||||
const REFUSED_HINT =
|
||||
"WorkBuddy refuses chats from Codex and Claude Code (their system prompt); use it from Hermes, OpenCode or Pi, or add another provider to this group"
|
||||
"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"
|
||||
const REFUSED = /unapproved channel|illegal api invocation/i
|
||||
|
||||
// RESTRICTED_HINT is what the user can do about WorkBuddy's 403 code 11140
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@magpie-community/opencode-workbuddy-auth",
|
||||
"version": "0.1.27",
|
||||
"version": "0.1.28",
|
||||
"description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
|
||||
"type": "module",
|
||||
"main": "./index.mjs",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// WorkBuddy's refusal of Codex's and Claude Code's system prompt carries
|
||||
// the hint magpie's built-in added (provider.WBRefusedHint), at the end of
|
||||
// the message, where magpie's routing page looks for it.
|
||||
// WorkBuddy's refusal of words in a client's prompt carries the hint
|
||||
// magpie's Routing page knows (WB_REFUSED), at the end of the message,
|
||||
// where the page looks for it.
|
||||
import { expect, test } from "bun:test"
|
||||
import { _internal } from "./index.mjs"
|
||||
|
||||
@@ -12,6 +12,16 @@ test("the refusal ends in the hint", async () => {
|
||||
expect((await res.json()).error.message).toBe("Illegal API invocation from an unapproved channel — " + REFUSED_HINT)
|
||||
})
|
||||
|
||||
test("the hint is magpie's word for word, and blames no one client", () => {
|
||||
// magpie's Routing page splits it from WorkBuddy's words only when it
|
||||
// matches exactly; DeepSeek Harness's and Claude Desktop's chats are
|
||||
// refused too (#279, #170), so naming Codex and Claude Code misled them
|
||||
expect(REFUSED_HINT).toBe(
|
||||
"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",
|
||||
)
|
||||
expect(REFUSED_HINT).not.toMatch(/Codex|Claude/)
|
||||
})
|
||||
|
||||
test("credits exhausted error ends in the exhausted hint", async () => {
|
||||
const res = await explained(
|
||||
new Response(
|
||||
|
||||
Reference in New Issue
Block a user