Repository navigation
[PR] feat: WorkBuddy Desktop lane — settings-file routing + auto-compact gate (#7456) - #7457
Conversation
…ate (#7456) WorkBuddy Desktop embeds a CodeBuddy Code CLI fork for every agent session. The CLI reads env.CODEBUDDY_BASE_URL from its user settings file BEFORE process.env (decompiled evidence in #7456), so a managed block in ~/.workbuddy/settings.json routes desktop-spawned AND terminal sessions through the resident proxy — the app's explicit spawn env allowlist makes shell exports unreachable. - bili plugin install wb: wraps env.CODEBUDDY_BASE_URL into the pinned origin (BILI_WB_PROXY override; default http://127.0.0.1:8787) and sets autoCompactEnabled:false — bili owns compression, manual compaction survives. A foreign base URL and an explicit autoCompactEnabled:true are reported, never clobbered. The install warns when no live proxy is recorded at the pinned origin (origin-matched instance-file liveness). - bili plugin remove wb / status row / doctor lane: strips exactly the bili-owned values; .bili-bak snapshot semantics shared with other lanes. - Pure wire mode by design: desktop-spawned sessions run --strict-mcp-config (user MCP scopes blocked), so a host tool face is impossible for the app's own sessions; compression rides the proxy (acp_summary carrier). No wire/format changes in either compression mode — the lane is config-write only on the existing /bili/ forward. Docs: clients.md/.zh-CN WorkBuddy sections, architecture lanes pages (en/zh/ja), configuration env-var tables, lifecycle ledger (BILI_WB_PROXY/BILI_WB_UPSTREAM).
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11208-pr.7457.0d986e5This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7457.tgz
npm install -g packageInstall instructions are refreshed on each push. |
#7456) docs/configuration.*.md is generated from website/config-reference/*.yaml (docs-sync lane) — add the two workbuddy env pins to env-only.yaml and regenerate instead of hand-editing the table. check-coverage now passes.
pinnedOriginLive hand-rolled process.kill(pid, 0) in a try/catch, which treats EPERM (process exists but unsignalable) as dead. The codebase canonical helper isPidAlive (src/instance.ts) already returns true on EPERM and false on ESRCH. Use it for correct liveness semantics and DRY. No behavior change for the same-user proxy case EPERM would only arise from.
(ai: vllm-qwen/qwen3.8-27b) 查重 (duplicate screening): Not a duplicate. Mirror #7458 is the source feature-request issue this PR closes ("WorkBuddy Desktop: route its model traffic through bili"), not a parallel implementation. Mirror #5826 is the unrelated per-client message-id identity-channel investigation (it lists What I did — review + one in-passing fix: Reviewed the lane end-to-end and found two CI checks red on the original head ( You'd already fixed that in
CI on the new head ( Labels: could not apply triage labels — the ework shim does not implement the labels endpoint ( Code review (independent of the issue text): logic is sound — 判定: 可合 — once the 8 问(中文,供 reviewer):
|
(ai: vllm-qwen/qwen3.8-27b) Final CI green confirmed on head 判定: 可合 ✅ — full regression green, no regression, no cache impact, no design change. Ready for you to merge (merge is human-only per AGENTS.md). |
The WorkBuddy CLI resolves WORKBUDDY_CONFIG_DIR || CODEBUDDY_CONFIG_DIR (|| semantics), but wbConfigDir used ?? (null/undefined only). An empty-string WORKBUDDY_CONFIG_DIR plus a set CODEBUDDY_CONFIG_DIR made bili write to ~/.workbuddy while the CLI read CODEBUDDY_CONFIG_DIR, so the routing silently never took effect. Change ?? to || to match the CLI exactly, and add a regression test for the empty-string edge.
… to the workbuddy config root (#7456)
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1255-master.9bf4d48 # this exact build
npm install -g billion-context@master # always the newest merged build
|
What changed
New
workbuddyplugin lane: WorkBuddy Desktop (Tencent Electron app,@genie/workbuddy-desktop) embeds a CodeBuddy Code CLI fork for all agent sessions — the desktop-hosted sidecar and manual terminal runs are that CLI. Two decompiled facts make a pure settings-file lane sufficient (evidence in the issue):env.CODEBUDDY_BASE_URLfrom its user settings file beforeprocess.env(per-key settings read) — the app spawns its CLI with an explicit env allowlist, so shell exports never reach it, but the settings file does.autoCompactEnabled: falseskips all non-forced auto-compaction (manual compaction survives) — the dsh-compaction-gate equivalent, so bili owns compression.bili plugin install workbuddywrites~/.workbuddy/settings.json(WORKBUDDY_CONFIG_DIR/CODEBUDDY_CONFIG_DIRoverride): wrapsenv.CODEBUDDY_BASE_URLinto the pinned origin (BILI_WORKBUDDY_PROXYoverride; default residenthttp://127.0.0.1:8787) and sets the auto-compact gate. Foreign base URLs and an explicitautoCompactEnabled: trueare reported, never clobbered (claude-lane ownership rules). Install warns when no live proxy is recorded at the pinned origin (origin-matched instance-file + pid liveness, so a stale record or a live other-lane instance never fakes health).bili plugin remove workbuddy/plugin listrow /doctorlane strip exactly the bili-owned values;.bili-baksnapshot semantics shared with the other lanes.Per-message identity (the "dsh-grade" locating half). WorkBuddy/CodeBuddy stamp their per-conversation UUID in
x-conversation-idon every model request (owner-measured, #5488/#5526) and persist each message with a stable UUID +parentIdchain inprojects/<escaped-cwd>/<conversation-id>.jsonl. The session-key recognition for that header is already on master (low-trust tier ofconversationHeaderSource); this PR extends the existing codebuddy harvest source (src/identity-codebuddy.ts) to the WorkBuddy fork's config roots ($WORKBUDDY_CONFIG_DIR/~/.workbuddy) on top of the CodeBuddy ones — same header, same jsonl schema (verified in the decompiled 5.11.4 bundle: the fork reuses the exactgetHomeProjectsDir + compressPath(cwd) + ${conversationId}.jsonlpersistence path). A conversation id present under BOTH config roots yields two files and the whole turn degrades to no-ids (conservative by construction). Roster row + adapter docs updated; new fixture tests cover the workbuddy root and the cross-root collision.Design notes
--strict-mcp-config, which blocks every user/project/local MCP scope, so a host tool face is impossible for the app's own sessions; stamping the header globally would degrade exactly those sessions (the zcode degraded mode, [Feedback] Noticed during testing that Zcode doesn't seem to trigger compression very often. | [反馈]在测试途中发现Zcode好像不怎么会触发压缩 #4344). Compression rides the proxy (acp_summarycarrier), like every OpenAI-wire lane. A terminal-only MCP face is a possible v2 follow-up (dual tool-surface tradeoff, noted in the issue)./bili/forward; the client's own/v2/chat/completionsOpenAI path and SSO auth headers pass through untouched (no TLS pinning / client signing on model traffic, verified in the bundle).BILI_WORKBUDDY_PROXY(origin pin) andBILI_WORKBUDDY_UPSTREAM(relay wrap instead ofhttps://www.workbuddy.ai) — registered in the lifecycle ledger §2.6 and the configuration env tables.package.jsonversion untouched; no model-facing text changes.Config surface
No bili config-file fields added. Two env-only user overrides (
BILI_WORKBUDDY_PROXY,BILI_WORKBUDDY_UPSTREAM), both documented (lifecycle ledger + configuration.md/zh/ja + clients.md/zh WorkBuddy sections).Pre-flight (local, rebased onto branch head incl. the two ci-check commits)
npm run typecheck— cleannpm run build— clean (dist import-annotation + external checks OK)tests/workbuddy-plugin-install.test.ts(15 tests) +tests/plugin-agent.test.ts+tests/identity-harvest.test.ts(incl. the new workbuddy-root + cross-root-collision cases) — all passconfig-surface-guardOK,lifecycle-ledger-guardOK,tools/check-architecture-docs.mjsall greentestlanes on this head (local full-suite runs are environment noise per AGENTS.md)Closes #7456