Files
plugins/packages/doubao-work
yetone 34f7e7b6cd doubao-work: find 豆包工作 (DoubaoWork.app), not 豆包 (#917)
binary() looked only for /Applications/Doubao.app (豆包,
com.bot.pc.doubao). The reporter has only 豆包工作 at
/Applications/DoubaoWork.app/Contents/MacOS/DoubaoWork
(com.work.pc.doubao), so sign-in always said the app was missing.

choose() now picks { app, binary, dataDir } from both apps, 豆包工作
first, in /Applications and ~/Applications on macOS and under
%LOCALAPPDATA% on Windows. A user already signed in to 豆包 through
the plugin (its profile exists) stays on 豆包 while it is installed, so
the update signs no one out. 豆包工作 keeps its profile, port and model
list in a doubaowork/ subfolder. DOUBAO_WORK_APP still names the binary.
The chat page check (owns, connect) accepts doubaowork://doubaowork-chat/chat
and chrome://doubaowork-chat/chat as well as 豆包's. The busy and
not-installed messages name the chosen app and its download page.

Run (mote, worktree at 6cb5dbe8 + this change; origin/main 1bdc4d4b only
adds an autoclaw change):
- bun test packages/doubao-work: 36 pass, 0 fail.
- bun scripts/check.mjs: exit 0, doubao-work ok.
- Live on this Mac with DoubaoWork 2.36.3 (copied out of the official
  dmg) and a sandbox DOUBAO_WORK_HOME: choose picked 豆包工作, App.start
  launched it, owns accepted it, the page reported
  chrome://doubaowork-chat/chat, input present, signed out; the model
  menu read 自动 / 豆包 2.1 Lite / 豆包 2.1 Pro; the new-task and 云电脑
  steps ran on the real page. A second connect reused the running app.
- 豆包 2.35.8 with a temp profile: same chat page test ids.

Broken by hand (mote): choose searching only 豆包 made "a Mac with only
豆包工作 drives 豆包工作 (#917)" red; the old owns regex made "both apps'
chat pages are the plugin's" red (34 pass, 2 fail). The old code has no
choose/isChat and binary() returns Doubao.app, so the #917 test is red
on it.

Not tried: a signed-in request (no 豆包工作 account here). Windows: the
path %LOCALAPPDATA%\DoubaoWork\Application\app\DoubaoWork.exe comes from
DoubaoWork_installer_2.36.3.exe's config (install_dir_name DoubaoWork,
exe_file_name DoubaoWork.exe) and 豆包's layout; not installed on the
Windows box. Running 豆包工作 and 豆包 side by side.

Reported-by: sinoyster
2026-11-10 12:16:37 +08:00
..

豆包工作 (Doubao Work)

Doubao Work runs its agent loop in ByteDance's cloud and has no API, so there is no request to make on its behalf. This plugin uses its desktop app, 豆包工作 (DoubaoWork), the way a person does instead, and gives what it reads back as an OpenAI chat completion. 豆包 (Doubao), whose 工作任务 are the same, works too:

  1. It starts the app from a profile of its own (under ~/Library/Application Support/magpie-doubao-work on macOS, %LOCALAPPDATA%\magpie-doubao-work on Windows; 豆包工作's in doubaowork there), with Chrome DevTools on a local port. Your everyday profile is not touched; you sign in once in this second window.

    The app is 豆包工作 when it is installed (/Applications/DoubaoWork.app or ~/Applications/DoubaoWork.app on macOS, %LOCALAPPDATA%\DoubaoWork\Application\app\DoubaoWork.exe on Windows), else 豆包 (Doubao.app, %LOCALAPPDATA%\Doubao\Application\app\Doubao.exe). If you signed in to 豆包 through the plugin before 0.1.5, it stays on 豆包 while 豆包 is installed.

  2. Each request opens a new 工作任务, switches it from 本地电脑 to 云电脑 (so Doubao's agent never reads or runs anything on your computer), picks the model, and writes the whole request (system prompt, tools, every turn) into the input as one message.

  3. It reads the reply from the message Doubao renders, as it streams: the raw markdown, and the thinking as reasoning_content.

  4. The client's tools are asked for as text, <tool_call>{"name": …, "arguments": …}</tool_call>, and given back as tool_calls.

Models: the plugin reads Doubao's own model menu, so whatever the app offers is what magpie lists. The menu row text becomes the id: 自动 (auto), 豆包 2.1 Lite (doubao-2.1-lite), 豆包 2.1 Pro (doubao-2.1-pro, needs a paid Doubao plan), DeepSeek V4.1 Flash (deepseek-v4.1-flash), GLM 5.3 (glm-5.3) and so on. Rows that open a submenu (推理强度) are not models and are skipped.

The list is read when you sign in, and again on a request once the cached list is more than six hours old; it is kept in models.json under DOUBAO_WORK_HOME (~/Library/Application Support/magpie-doubao-work on macOS, %LOCALAPPDATA%\magpie-doubao-work on Windows) and read before anything else. The three models the plugin was written with stay as the fallback for when the menu cannot be read.

What it costs

  • Unofficial. It uses Doubao the way its own window does, but ByteDance may not like it. Use an account you can afford to lose.
  • On macOS, the app runs one copy at a time. If you opened it yourself, quit it (⌘Q) first: the plugin's copy can't start beside it, and yours can't be driven (Chromium allows debugging only off the default profile). While the plugin's copy runs, opening Doubao brings up its window, which you can use as well. On Windows the plugin's copy runs beside yours, in a second window.
  • One request at a time. There is one window.
  • Every request is a new task in your Doubao history.
  • A request the client stops stops being read, but Doubao finishes its task in the cloud anyway.
  • Slower than an API: a task takes a few seconds to open, and the reply is read about seven times a second.
  • Text only. Images and files in a request are left out.
  • Usage is Doubao's own prompt count; the reply's tokens are estimated.
  • The DevTools port is on 127.0.0.1 only, but any program on this computer can drive the signed-in Doubao window through it while it runs.
  • macOS and Windows. Neither app has a Linux build.

Settings

  • DOUBAO_WORK_APP: the app's binary, if it is not in one of the places above. A path naming DoubaoWork is driven as 豆包工作, any other as 豆包.
  • DOUBAO_WORK_HOME: where the profile and port live.

Adding another cloud agent

cdp.mjs knows nothing about Doubao: it starts a Chromium-based desktop app from its own profile and drives one page. doubao.mjs is everything that is Doubao's: which buttons to press and where the reply is. prompt.mjs and openai.mjs turn a chat request into one message and the reply back into a completion. Another app built on Chromium or Electron needs only its own doubao.mjs.