providers: WorkBuddy's sign-in warns that Tencent may ban the account first

NancyTom on X (11-04): WorkBuddy accounts used from DeepSeek Harness
through magpie were banned, the international build's (WorkBuddy AI)
most; repliers saw the same. Changing DSH's prompt isn't a fix: the
plugin already rewords DSH's opener and moves the system prompt into
the first user turn (REFUSED.md), and the bans came anyway. So magpie
says it before an account is added, as it does for Claude, Zed, Qoder,
Factory, MiMo and Command Code.

- app.js: WorkBuddy and WorkBuddy AI carry risk with WORKBUDDY_RISK.
  A moved subscription (every user's now) gets it through subOf, so
  the plugin's sign-in waits behind "Sign in anyway" too.
- i18n.js: zh, zh-TW, ja, de.
- CLI: `magpie accounts add workbuddy|workbuddy-ai` asks the same
  (provider.WorkBuddyRisk, the window's words; a GUI test checks the
  two are equal).
- Core script budget: no raise; the SUBS header comment was cut down.

Run (mote, at 823e7c250 + this change):
- node --test workbuddy-risk (new), i18n-keys, i18n-en-no-cjk,
  commandcode-risk, zed-sub, claude-risk, qoder-cn-tile: 51 pass, 0 fail,
  chromium and webkit, en and zh.
- 83 GUI files matching add-|sub|risk|workbuddy|plugin-sign|move|
  deprecat|signin|i18n: 1166 pass, 20 fail at load ~60. Alone:
  signin-closes-sheet passes; found-skill-pick-remove (#5013),
  plugin-move-unserved (#4410) and routing-rule-remove (#5088) red
  alone the same way on a fresh origin/main e3ed21c7a (18 fail there).
- go test ./internal/cli ./internal/provider ok; -run Budget
  ./internal/gui ok; go vet cli+provider darwin and windows, provider
  linux ok (cli's linux vet needs GTK's cgo, not on mote or WSL).
- gofmt -l clean.
- Rebased on 9d0c9b41e (app.js changed under it, #5139): -run
  Budget|Risk ./internal/gui ./internal/cli ./internal/provider ok, and
  workbuddy-risk, i18n-keys, i18n-en-no-cjk, qoder-cn-tile, claude-risk
  39 pass, 0 fail at the pushed head.

Broken by hand: risk taken off both entries, workbuddy-risk went pass 1,
fail 14 (the built-in tiles and the moved plugin's sign-in each asked
the backend at once); the text-equality case stayed green, as it should.

Not run: the whole GUI suite (another session's full GUI suite was on
mote). Not tried: a real WorkBuddy sign-in; nothing here touches the
plugin or what is sent to Tencent.
This commit is contained in:
yetone
2026-11-04 23:58:53 +08:00
parent 9d0c9b41ea
commit 8e97e26d67
5 changed files with 115 additions and 9 deletions
+2 -1
View File
@@ -452,7 +452,8 @@ func untilShort(d time.Duration) string {
// addAccount signs in to one more subscription in the browser, the way the
// window's "Add account" does.
func addAccount(agentID string) error {
if risk := map[string]string{"antigravity": provider.AntigravityRisk, "claude": provider.ClaudeRisk}[agentID]; risk != "" {
if risk := map[string]string{"antigravity": provider.AntigravityRisk, "claude": provider.ClaudeRisk,
"workbuddy": provider.WorkBuddyRisk, "workbuddy-ai": provider.WorkBuddyRisk}[agentID]; risk != "" {
fmt.Println(bold.Render("!"), risk)
fmt.Print("Sign in anyway? [y/N] ")
var yes string
+5 -8
View File
@@ -12120,13 +12120,10 @@ function fallbackHint(p) {
// opens the vendor's own sign-in in the browser, takes the account when it
// comes back, and lists it with the others — any of them one click from
// being the one in use.
//
// Some of these are deprecated: once moved onto their community plugin
// (providers.onPlugins, the default for a new sign-in), the plugin signs in
// and serves them, and subOf hands back the plugin's sign-in. A change to
// such a built-in's sign-in on the Go side doesn't reach those users; see
// AGENTS.md (PLUGIN-SERVED).
// Moved ones are signed in by their plugin (subOf); see AGENTS.md.
// NancyTom on X, 11-04
const WORKBUDDY_RISK = "Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy. Accounts of the international build, WorkBuddy AI, have been banned after use through other agents (DeepSeek Harness among them), and changing an agent's prompt doesn't prevent it. Use an account you can afford to lose.";
const QODER_RISK = "Qoder has no public API for this; magpie signs requests as its desktop client would, which Qoder may treat as third-party use and act on. Use an account you can afford to lose.";
const SUBS = [
// both can also come from CLIProxyAPI's auth files or the agent's own (importing below)
@@ -12148,9 +12145,9 @@ const SUBS = [
{ agent: "zcode", name: "ZCode (GLM Coding Plan)", icon: "zcode", plans: "Lite · Pro · Max · Team", own: true,
sites: [["zai", "Z.ai", "z.ai"], ["bigmodel", "BigModel (Zhipu)", "bigmodel.cn", "BigModel (智谱)"]] },
// Tencent's CodeBuddy plan, signed in as WorkBuddy does; WorkBuddy's own account is read too
{ agent: "workbuddy", name: "WorkBuddy (CodeBuddy)", icon: "workbuddy-color", plans: "Free · Pro", own: true },
{ agent: "workbuddy", name: "WorkBuddy (CodeBuddy)", icon: "workbuddy-color", plans: "Free · Pro", own: true, risk: true, riskNote: WORKBUDDY_RISK },
// the same plan sold abroad, WorkBuddy AI (workbuddy.ai / codebuddy.ai), its accounts its own
{ agent: "workbuddy-ai", get name() { return t("WorkBuddy AI (international)"); }, icon: "workbuddy-color", plans: "Free · Pro", own: true },
{ agent: "workbuddy-ai", get name() { return t("WorkBuddy AI (international)"); }, icon: "workbuddy-color", plans: "Free · Pro", own: true, risk: true, riskNote: WORKBUDDY_RISK },
// a commandcode.ai plan, signed in as its CLI does; the CLI's own key is read too
// a Go plan is asked at the CLI's private /alpha/generate, which Command Code
// said on X may get an account banned when used from other tools
+4
View File
@@ -1609,6 +1609,7 @@ const I18N = {
// providers
"Qoder has no public API for this; magpie signs requests as its desktop client would, which Qoder may treat as third-party use and act on. Use an account you can afford to lose.": "Qoder 没有公开 API;magpie 以其桌面客户端的方式签发请求,Qoder 可能视为第三方使用并采取措施。请用丢了也不心疼的账号。",
"Zed serves these models to its own editor; magpie signs requests as the editor would, which Zed may treat as third-party use and act on. Use an account you can afford to lose.": "Zed 只向自己的编辑器提供这些模型;magpie 以编辑器的方式签发请求,Zed 可能视为第三方使用并采取措施。请用丢了也不心疼的账号。",
"Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy. Accounts of the international build, WorkBuddy AI, have been banned after use through other agents (DeepSeek Harness among them), and changing an agent's prompt doesn't prevent it. Use an account you can afford to lose.": "腾讯可能封禁在 WorkBuddy 之外使用的 WorkBuddy 账号。国际版 WorkBuddy AI 已有账号在经其他智能体(包括 DeepSeek Harness)使用后被封,改智能体的提示词也无法避免。请用丢了也不心疼的账号。",
"Anthropic may suspend or ban a Claude account it sees used outside its own apps. magpie sends requests through Claude Code, but Anthropic may still act on them; you use it at your own risk. Use an account you can afford to lose.": "Anthropic 可能封禁在其官方应用之外使用的 Claude 账号。magpie 的请求经 Claude Code 发出,但 Anthropic 仍可能采取措施,风险自负。请用丢了也不心疼的账号。",
"Factory serves these models to its own Droid CLI; magpie signs requests as Droid would, which Factory may treat as third-party use and act on. Use an account you can afford to lose.": "Factory 只向自己的 Droid CLI 提供这些模型;magpie 以 Droid 的方式签发请求,Factory 可能视为第三方使用并采取措施。请用丢了也不心疼的账号。",
"A Go plan account is used through Command Code's private interface, which Command Code may treat as a breach of its terms and ban the account for. Pro, Max and the other plans use its Provider API. Use a Go account you can afford to lose.": "Go 套餐账号经 Command Code 的私有接口使用,Command Code 可能视为违反条款并封禁该账号。Pro、Max 等其他套餐走其 Provider API。请用丢了也不心疼的 Go 账号。",
@@ -6204,6 +6205,7 @@ const I18N = {
"No matches.": "沒有匹配項。",
"Qoder has no public API for this; magpie signs requests as its desktop client would, which Qoder may treat as third-party use and act on. Use an account you can afford to lose.": "Qoder 沒有公開 API;magpie 以其桌面用戶端的方式簽發請求,Qoder 可能視為第三方使用並採取措施。請用丟了也不心疼的帳號。",
"Zed serves these models to its own editor; magpie signs requests as the editor would, which Zed may treat as third-party use and act on. Use an account you can afford to lose.": "Zed 只向自己的編輯器提供這些模型;magpie 以編輯器的方式簽發請求,Zed 可能視為第三方使用並採取措施。請用丟了也不心疼的帳號。",
"Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy. Accounts of the international build, WorkBuddy AI, have been banned after use through other agents (DeepSeek Harness among them), and changing an agent's prompt doesn't prevent it. Use an account you can afford to lose.": "騰訊可能封禁在 WorkBuddy 之外使用的 WorkBuddy 帳號。國際版 WorkBuddy AI 已有帳號在經其他智能體(包括 DeepSeek Harness)使用後被封,改智能體的提示詞也無法避免。請用丟了也不心疼的帳號。",
"Anthropic may suspend or ban a Claude account it sees used outside its own apps. magpie sends requests through Claude Code, but Anthropic may still act on them; you use it at your own risk. Use an account you can afford to lose.": "Anthropic 可能封禁在其官方應用之外使用的 Claude 帳號。magpie 的請求經 Claude Code 發出,但 Anthropic 仍可能採取措施,風險自負。請用丟了也不心疼的帳號。",
"Factory serves these models to its own Droid CLI; magpie signs requests as Droid would, which Factory may treat as third-party use and act on. Use an account you can afford to lose.": "Factory 只向自己的 Droid CLI 提供這些模型;magpie 以 Droid 的方式簽發請求,Factory 可能視為第三方使用並採取措施。請用丟了也不心疼的帳號。",
"A Go plan account is used through Command Code's private interface, which Command Code may treat as a breach of its terms and ban the account for. Pro, Max and the other plans use its Provider API. Use a Go account you can afford to lose.": "Go 套餐帳號經 Command Code 的私有介面使用,Command Code 可能視為違反條款並封禁該帳號。Pro、Max 等其他套餐走其 Provider API。請用丟了也不心疼的 Go 帳號。",
@@ -10773,6 +10775,7 @@ const I18N = {
"No matches.": "一致するものはありません。",
"Qoder has no public API for this; magpie signs requests as its desktop client would, which Qoder may treat as third-party use and act on. Use an account you can afford to lose.": "Qoder にはこのための公開 API がありません。magpie はデスクトップクライアントと同じようにリクエストに署名しますが、Qoder はこれを第三者による利用とみなして措置を取る可能性があります。失っても構わないアカウントを使ってください。",
"Zed serves these models to its own editor; magpie signs requests as the editor would, which Zed may treat as third-party use and act on. Use an account you can afford to lose.": "Zed はこれらのモデルを自社のエディタ向けに提供しています。magpie はエディタと同じようにリクエストに署名しますが、Zed はこれを第三者による利用とみなして措置を取る可能性があります。失っても構わないアカウントを使ってください。",
"Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy. Accounts of the international build, WorkBuddy AI, have been banned after use through other agents (DeepSeek Harness among them), and changing an agent's prompt doesn't prevent it. Use an account you can afford to lose.": "Tencent は、WorkBuddy 以外で使われている WorkBuddy アカウントを停止することがあります。国際版の WorkBuddy AI では、他のエージェント(DeepSeek Harness など)経由で使われたアカウントが停止されており、エージェントのプロンプトを変えても防げません。失っても構わないアカウントを使ってください。",
"Anthropic may suspend or ban a Claude account it sees used outside its own apps. magpie sends requests through Claude Code, but Anthropic may still act on them; you use it at your own risk. Use an account you can afford to lose.": "Anthropic は、自社アプリ以外で使われている Claude アカウントを停止または禁止することがあります。magpie は Claude Code を通じてリクエストを送りますが、それでも Anthropic が措置を取る可能性があります。自己責任でご利用ください。失っても構わないアカウントを使ってください。",
"Factory serves these models to its own Droid CLI; magpie signs requests as Droid would, which Factory may treat as third-party use and act on. Use an account you can afford to lose.": "Factory はこれらのモデルを自社の Droid CLI 向けに提供しています。magpie は Droid と同じようにリクエストに署名しますが、Factory はこれを第三者による利用とみなして措置を取る可能性があります。失っても構わないアカウントを使ってください。",
"A Go plan account is used through Command Code's private interface, which Command Code may treat as a breach of its terms and ban the account for. Pro, Max and the other plans use its Provider API. Use a Go account you can afford to lose.": "Go プランのアカウントは Command Code の非公開インターフェース経由で使われます。Command Code はこれを規約違反とみなし、アカウントを停止する可能性があります。Pro、Max などの他のプランは Provider API を使います。失っても構わない Go アカウントを使ってください。",
@@ -15373,6 +15376,7 @@ const I18N = {
"No matches.": "Keine Treffer.",
"Qoder has no public API for this; magpie signs requests as its desktop client would, which Qoder may treat as third-party use and act on. Use an account you can afford to lose.": "Qoder hat dafür keine öffentliche API; magpie signiert Anfragen wie sein Desktop-Client, was Qoder als Drittnutzung werten und ahnden kann. Verwenden Sie ein Konto, auf das Sie verzichten können.",
"Zed serves these models to its own editor; magpie signs requests as the editor would, which Zed may treat as third-party use and act on. Use an account you can afford to lose.": "Zed stellt diese Modelle seinem eigenen Editor bereit; magpie signiert Anfragen wie der Editor, was Zed als Drittnutzung werten und ahnden kann. Verwenden Sie ein Konto, auf das Sie verzichten können.",
"Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy. Accounts of the international build, WorkBuddy AI, have been banned after use through other agents (DeepSeek Harness among them), and changing an agent's prompt doesn't prevent it. Use an account you can afford to lose.": "Tencent kann ein WorkBuddy-Konto sperren, das außerhalb von WorkBuddy genutzt wird. Konten der internationalen Version, WorkBuddy AI, wurden nach der Nutzung über andere Agenten (darunter DeepSeek Harness) gesperrt, und ein geänderter Agenten-Prompt verhindert das nicht. Verwenden Sie ein Konto, auf das Sie verzichten können.",
"Anthropic may suspend or ban a Claude account it sees used outside its own apps. magpie sends requests through Claude Code, but Anthropic may still act on them; you use it at your own risk. Use an account you can afford to lose.": "Anthropic kann ein Claude-Konto sperren oder bannen, das außerhalb der eigenen Apps genutzt wird. magpie sendet Anfragen über Claude Code, Anthropic kann dennoch dagegen vorgehen; die Nutzung erfolgt auf eigenes Risiko. Verwenden Sie ein Konto, auf das Sie verzichten können.",
"Factory serves these models to its own Droid CLI; magpie signs requests as Droid would, which Factory may treat as third-party use and act on. Use an account you can afford to lose.": "Factory stellt diese Modelle seiner eigenen Droid CLI bereit; magpie signiert Anfragen wie Droid, was Factory als Drittnutzung werten und ahnden kann. Verwenden Sie ein Konto, auf das Sie verzichten können.",
"A Go plan account is used through Command Code's private interface, which Command Code may treat as a breach of its terms and ban the account for. Pro, Max and the other plans use its Provider API. Use a Go account you can afford to lose.": "Ein Konto mit Go-Tarif wird über die private Schnittstelle von Command Code genutzt, was Command Code als Verstoß gegen seine Bedingungen werten und mit einer Kontosperre ahnden kann. Pro, Max und die übrigen Tarife nutzen seine Provider API. Verwenden Sie ein Go-Konto, auf das Sie verzichten können.",
+100
View File
@@ -0,0 +1,100 @@
// Run with Node's test runner and Playwright on the module path; see README.md.
// WorkBuddy's subscriptions (NancyTom on X, 11-04: WorkBuddy accounts used
// through DeepSeek Harness via magpie were banned, the international build's
// most): starting a sign-in first says Tencent may ban the account, and
// nothing is asked of the backend until "Sign in anyway". Both the built-in
// tiles and a subscription moved onto its plugin, which is how every user
// has it now. The window's words are the CLI's (provider.WorkBuddyRisk).
// English and Chinese; no backend, the API is faked here.
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const path = require("node:path");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
const assets = path.resolve(__dirname, "../assets");
const plugins = [{ id: "workbuddy-ai", pid: "workbuddy-ai", name: "WorkBuddy AI", icon: "workbuddy-color", spec: "@magpie-community/opencode-workbuddy-auth", signedIn: false, models: 0,
methods: [{ type: "oauth", label: "WorkBuddy's sign-in" }] }];
function server(lang, asked, moved) {
return async (route) => {
const url = new URL(route.request().url());
const json = (data) => route.fulfill({ json: data });
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:false};` });
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings: { lang, theme: "light" } });
if (url.pathname === "/api/providers") return json({ providers: [{ id: "openai", name: "OpenAI", icon: "openai", preset: "openai", models: [], agents: [], key: { set: true, masked: "sk-…ab12" } }], presets: [], excluded: [], gateway: { running: true, window: true },
...(moved ? { plugins, onPlugins: ["workbuddy-ai"], movable: ["workbuddy", "workbuddy-ai"] } : {}) });
if (url.pathname === "/api/groups") return json({ groups: [], pools: [] });
if (url.pathname === "/api/gateway/trace") return json({ routes: [] });
if (url.pathname === "/api/signin" || url.pathname === "/api/plugin-signin/prompt") {
asked.push([url.pathname, route.request().postDataJSON()]);
return json({ id: "s1", agent: "workbuddy-ai", state: "waiting", url: "https://www.workbuddy.ai/login" });
}
if (url.pathname.startsWith("/api/signin/") || url.pathname.startsWith("/api/plugin-signin/")) return json({ id: "s1", agent: "workbuddy-ai", state: "waiting" });
if (url.pathname.startsWith("/api/")) return json({});
const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); }
};
}
const L = {
en: { cn: "WorkBuddy (CodeBuddy)", intl: "WorkBuddy AI (international)", title: (n) => n + " accounts can be suspended", note: /^Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy\. .*changing an agent's prompt doesn't prevent it/, anyway: "Sign in anyway", cancel: "Cancel" },
zh: { cn: "WorkBuddy (CodeBuddy)", intl: "WorkBuddy 国际版 (WorkBuddy AI)", title: (n) => n + " 账号可能被封禁", note: /^腾讯可能封禁在 WorkBuddy 之外使用的 WorkBuddy 账号。.*改智能体的提示词也无法避免/, anyway: "仍然登录", cancel: "取消" },
};
test("the window says what the CLI says", async () => {
const app = await fs.readFile(path.join(assets, "app.js"), "utf8");
const go = await fs.readFile(path.resolve(__dirname, "../../provider/google.go"), "utf8");
const js = app.match(/const WORKBUDDY_RISK = ("[^"]+");/)[1];
const g = go.match(/const WorkBuddyRisk = ("[^"]+")/)[1];
assert.equal(JSON.parse(js), JSON.parse(g));
});
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
test(engine + ": WorkBuddy's sign-in warns of a ban first", async (t) => {
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
t.after(() => browser.close());
for (const lang of ["en", "zh"]) {
for (const [moved, which] of [[false, "cn"], [false, "intl"], [true, "intl"]]) {
await t.test(lang + (moved ? " moved " : " built-in ") + which, async () => {
const w = L[lang];
const page = await (await browser.newContext({ viewport: { width: 900, height: 800 } })).newPage();
const errors = [], asked = [];
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", server(lang, asked, moved));
await page.goto("http://magpie.test/?view=providers");
await page.locator("#addProvider").click();
const sheet = page.locator("#addSheet");
// the tile is named short, the warning in full
const row = sheet.locator(`.tile[data-pick="${w[which].replace(/\s*\([^()]*\)$/, "")}"]`);
await row.waitFor();
await row.click();
let box = sheet.locator(".signing");
await box.waitFor();
await box.locator("button", { hasText: w.cancel }).click();
await box.waitFor({ state: "detached" });
assert.equal(asked.length, 0);
await row.click();
box = sheet.locator(".signing");
await box.waitFor();
assert.equal(await box.locator(".n").textContent(), w.title(w[which]));
assert.match(await box.locator(".s").textContent(), w.note);
assert.doesNotMatch(await box.textContent(), /Antigravity|Google/);
assert.equal(asked.length, 0, "nothing asked before it is said");
await box.locator("button", { hasText: w.anyway }).click();
for (let i = 0; i < 50 && !asked.length; i++) await page.waitForTimeout(50);
assert.equal(asked.length, 1);
if (moved) assert.deepEqual(asked[0], ["/api/plugin-signin/prompt", { provider: "workbuddy-ai", method: 0, inputs: {} }]);
else assert.deepEqual(asked[0], ["/api/signin", { agent: which === "cn" ? "workbuddy" : "workbuddy-ai" }]);
assert.deepEqual(errors, []);
});
}
}
});
}
+4
View File
@@ -111,6 +111,10 @@ const AntigravityRisk = "Google may suspend an Antigravity account it sees used
// window does.
const ClaudeRisk = "Anthropic may suspend or ban a Claude account it sees used outside its own apps. magpie sends requests through Claude Code, but Anthropic may still act on them; you use it at your own risk. Use an account you can afford to lose."
// WorkBuddyRisk is what magpie says before a WorkBuddy or WorkBuddy AI
// account is added, as the window does (WORKBUDDY_RISK in app.js).
const WorkBuddyRisk = "Tencent may suspend a WorkBuddy account it sees used outside WorkBuddy. Accounts of the international build, WorkBuddy AI, have been banned after use through other agents (DeepSeek Harness among them), and changing an agent's prompt doesn't prevent it. Use an account you can afford to lose."
// geminiCLIVersion is the Gemini CLI magpie says it is.
const geminiCLIVersion = "0.61.0"