Repository navigation
Description
Description
On macOS, the WorkBuddy harness always spawns the CLI bundled inside the WorkBuddy app (WorkBuddy.app/Contents/Resources/app.asar.unpacked/cli/bin/codebuddy) with an isolated config root (CODEBUDDY_CONFIG_DIR forced to ~/.workbuddy-ai, see workBuddyEnvironment in packages/adapters/hermes/workbuddy plugin command.ts).
That bundled CLI cannot authenticate in this headless-spawn context, even after the user signs in inside the WorkBuddy desktop app:
- The desktop app's login writes credentials to
~/Library/Application Support/CodeBuddyExtension/Data/Public/auth/workbuddy-desktop.info, but theauth.accessTokenstored there is an encrypted envelope ({"$wbEncrypted": 1, "envelope": "..."}). Decryption is tied to the GUI process's secure storage; there is noWorkBuddy Safe Storagekeychain entry afterwards, and a directly spawned CLI child cannot decrypt it. - Meanwhile the standalone node CLI (
codebuddyinstalled via npm, reading~/.codebuddywith a plaintext JWT inTencent-Cloud.coding-copilot.info) authenticates fine against the same account.
Result: every Turn fails with
WorkBuddy: Native Turn stopped: refusal (FAILED_MODEL_REQUEST)
and the native side logs:
[ACP Agent] refusal classified: category=auth, rpcCode=-32000
[ACP Agent] Prompt refused: errorMsg=Authentication required. Please use /login command to sign in to your account
There is no /login flow reachable from codexhost, so the user is stuck with no in-product remedy.
Environment
- macOS (Apple Silicon)
- codexhost 0.11.0
- WorkBuddy.app with bundled CLI 2.147.0, standalone
codebuddyCLI 2.151.0 - WorkBuddy desktop app signed in (credentials present in
CodeBuddyExtension/Data/Public/auth/)
Reproduction
- Install WorkBuddy.app and sign in inside the desktop app.
- In codexhost, create a WorkBuddy thread and send a message.
- Observe
Native Turn stopped: refusal (FAILED_MODEL_REQUEST);~/.workbuddy-ai/logs/**showsPrompt refused: ... Authentication required.
Expected behavior
One of:
- The bundled CLI can consume the desktop app's login (decrypt the envelope or obtain a token via IPC with the running app), or
- codexhost offers a supported way to authenticate the headless WorkBuddy CLI (a
/login-equivalent handshake surfaced through the connection settings), or - The connection settings' launch path accepts a standalone
codebuddyCLI and, in that mode, does not forceCODEBUDDY_CONFIG_DIRaway from the user's existing~/.codebuddylogin.
Workaround (verified)
Setting WORKBUDDY_CONFIG_DIR=/Users/<user>/.codebuddy (the env takes precedence when workBuddyEnvironment resolves the root) plus pointing the WorkBuddy launch path at the standalone node CLI makes the same flow authenticate and complete turns — but this relies on an undocumented escape hatch and shares the CodeBuddy session history.
Notes
The forced config isolation itself is a deliberate design (avoid leaking CodeBuddy history into WorkBuddy, per the code comment) — the gap is that no headless authentication path exists for the isolated root.
Activity
BytePioneer-AI commentedon Nov 13, 2026
PR #533 已加入 WorkBuddy 加密凭据引导并在 Windows 实测成功,现按修复已合入关闭,macOS 尚未完成实机验证;如升级后仍有问题,欢迎再次评论。