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.
This commit is contained in:
yetone
2026-10-29 13:40:02 +08:00
parent 4a46212f89
commit b08a6c1bce
4 changed files with 17 additions and 14 deletions
+3 -3
View File
@@ -126,8 +126,8 @@ Each chat carries WorkBuddy's headers:
- `Authorization`, `X-User-Id`, `X-Domain`, `X-Product: SaaS`, `X-IDE-Type: WorkBuddy`;
- the desktop CLI's `User-Agent`, `WorkBuddy/<app> <appName>/<app> CLI/<cli>`:
`WorkBuddy/5.9.3 WorkBuddy/5.9.3 CLI/2.165.0` on the China build and
`WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0` on WorkBuddy AI, each
build's current app on 2026-10-28; `X-IDE-Version` is the app's version.
`WorkBuddy/5.9.3 workbuddy-ai/5.9.3 CLI/2.165.0` on WorkBuddy AI, each
build's current app on 2026-10-29; `X-IDE-Version` is the app's version.
A User-Agent not starting `WorkBuddy/<version>` is answered error 10085;
- the client's, which WorkBuddy's usage list shows as the client that asked
(使用端): `X-Agent-Purpose: conversation`, `X-IDE-Name: WorkBuddy`,
@@ -144,7 +144,7 @@ Each chat carries WorkBuddy's headers:
one, a made-up conversation of the request's own being what splits one
conversation into many in the usage detail;
- what the CLI adds to a model request alone: `X-Agent-Type: main` on both
builds, `X-Agent-Runtime: local-agent` on the China build (new in 5.9),
builds, `X-Agent-Runtime: local-agent` (new in 5.9),
`Accept: application/json`, and the `X-Stainless-*` headers of the OpenAI
SDK it sends through (openai 6.25.0 on Electron 37's Node v22.21.1, a
1200s timeout, no retries).
+4 -5
View File
@@ -116,13 +116,12 @@ test("WorkBuddy AI takes the ids too, with its client's headers", async () => {
expect(turn(ai)).toMatch(HEX32)
expect(conv(ai)).toMatch(HEX32)
expect(ai.get("x-ide-name")).toBe("WorkBuddy")
expect(ai.get("user-agent")).toBe("WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0")
expect(ai.get("user-agent")).toBe("WorkBuddy/5.9.3 workbuddy-ai/5.9.3 CLI/2.165.0")
})
// What WorkBuddy's desktop CLI sends with a chat, read from each build's
// current app (China 5.9.3 with CLI 2.165.0, WorkBuddy AI 5.8.4 with CLI
// 2.161.0): UserAgentHttpInterceptor's User-Agent, the app's version as
// the IDE's, X-Agent-Type on both builds, 5.9's X-Agent-Runtime, and the
// current app (5.9.3 with CLI 2.165.0 on both):
// UserAgentHttpInterceptor's User-Agent, the app's version as the IDE's, X-Agent-Type on both builds, 5.9's X-Agent-Runtime, and the
// OpenAI SDK's headers its fetch passes on.
test("each build's chat carries its desktop client's headers", async () => {
const sdk = {
@@ -137,7 +136,7 @@ test("each build's chat carries its desktop client's headers", async () => {
}
const want = {
workbuddy: [WorkBuddyAuthPlugin, { ...sdk, "user-agent": "WorkBuddy/5.9.3 WorkBuddy/5.9.3 CLI/2.165.0", "x-ide-version": "5.9.3", "x-agent-runtime": "local-agent" }],
"workbuddy-ai": [WorkBuddyAIAuthPlugin, { ...sdk, "user-agent": "WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0", "x-ide-version": "5.8.4", "x-agent-runtime": null }],
"workbuddy-ai": [WorkBuddyAIAuthPlugin, { ...sdk, "user-agent": "WorkBuddy/5.9.3 workbuddy-ai/5.9.3 CLI/2.165.0", "x-ide-version": "5.9.3", "x-agent-runtime": "local-agent" }],
}
for (const [provider, [plugin, heads]] of Object.entries(want)) {
const h = await ask(send("hi"), { provider, plugin, headers: { "x-agent-runtime": "cloud-agent" } })
+9 -5
View File
@@ -92,11 +92,15 @@ const SITES = {
authID: "workbuddy-desktop-ai",
platform: "workbuddy-ai",
ai: true,
// WorkBuddy AI 5.8.4.41366630, its update feed's current build on
// 2026-10-28 (see the China build's)
app: "5.8.4",
cli: "2.161.0",
// WorkBuddy AI 5.9.3.42398134, its update feed's current build on
// 2026-10-29 (see the China build's): the same CLI as the China
// build's 5.9.3, byte for byte but for product.json, and the same
// Electron (37.10.3); its desktop puts agentRuntime local-agent in the
// prompt meta as the China build's does
app: "5.9.3",
cli: "2.165.0",
appName: "workbuddy-ai",
runtime: "local-agent",
keys: "https://www.workbuddy.ai/profile/keys",
models: AI_MODELS,
// models whose images WorkBuddy AI drops though its config says they
@@ -1328,7 +1332,7 @@ function fitted(body) {
// gzipped is a chat's body compressed, as WorkBuddy's own client sends its
// model requests: its CLI's GzipRequestProcessor (WorkBuddy 5.9.3, CLI
// 2.165.0; WorkBuddy AI 5.8.4 the same) gzips each POST's body and sets
// 2.165.0, on both builds) gzips each POST's body and sets
// Content-Encoding: gzip when the product's RequestBodyGzip feature is on,
// which both builds' product.json turn on and /v3/config (merged over it)
// doesn't turn off. Sent as plain JSON, a long agent conversation went up
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-workbuddy-auth",
"version": "0.1.45",
"version": "0.1.46",
"description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
"type": "module",
"main": "./index.mjs",