Skip to content

feat(workbuddy): support the Linux desktop app - #1163

Merged
iruriQ merged 2 commits into
BytePioneer-AI:mainfrom
icepie:feat/workbuddy-linux-support
Nov 25, 2026
Merged

iruriQ merged 2 commits into
BytePioneer-AI:mainfrom
icepie:feat/workbuddy-linux-support

Conversation

@icepie

@icepie icepie commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

目标

让 WorkBuddy Harness 在 Linux 上使用应用内置 CLI,而不是只支持 macOS / Windows。

行为变更

  • 自动发现 /opt/WorkBuddy、/opt/WorkBuddy AI、/opt/WorkBuddyAI 下的 workbuddy,并配对同目录 resources/app.asar.unpacked/cli/bin/codebuddy;不把 PATH 上的 workbuddy 包装脚本当成应用。
  • Linux 默认数据根使用应用自身的 ~/.workbuddy(macOS / Windows 保持 ~/.workbuddy-ai),复用已有登录、原生历史与 cache/acc-product-config-v3.json。
  • CODEXHOST_WORKBUDDY_COMMAND 支持 Linux 应用目录或应用内的 workbuddy;显式原生 CLI 仍按自定义 CLI 处理。
  • 安装版本读取内置 product.json 的 genieVersion;Linux 没有已确认的公共更新 Feed,最新版本标为 Unknown,不发起无效查询。
  • 新增 Linux 的发现、显式路径、数据根、产品快照和版本检查测试,并更新集成文档。

自定义模型

Linux 不需要额外的模型合并逻辑:WorkBuddy CLI 的 ACP Model List 已原生返回 ~/.workbuddy/models.json 中的自定义模型,原生 ID 形如 custom-local:gpt-6.1-sol。Windows 的 snapshot 补偿路径保持不变。

验证

  • npx vitest run --config tests/vitest.config.js packages/adapters/workbuddy/test:14 个文件、182 个测试通过。
  • 真实 Linux 环境(WorkBuddy 5.11.3 / 内置 CLI 2.176.0,lite-wb 单包):
    • createHarnessAdapter(...).inspect() 返回 ready,模型目录 80 项,其中 62 项来自 ~/.workbuddy/models.json 的自定义模型(custom-local:*)。
    • 凭据引导以 policy=fields 收到原生确认;ACP initialize、session/new、session/set_config_option(选择 custom-local:gpt-6.1-sol)成功。
    • 全程未发送模型请求,未使用工具或修改项目文件。
  • 安装检查返回 currentVersion: 5.11.3、latestVersion: Unknown。
  • 未在本地运行全仓库 lint / typecheck / test,按仓库约定交给 CI。

No visual changes: adapter discovery and platform metadata only.

- Discover /opt/WorkBuddy, /opt/WorkBuddy AI, and /opt/WorkBuddyAI with the bundled CLI; ignore PATH launchers.
- Use the Linux app's ~/.workbuddy data root for native login, history, and product snapshot.
- Accept a Linux app executable or installation directory as an explicit launch path.
- Report the Linux app version without querying a non-existent public update feed.
- Cover Linux discovery, launch, data root, snapshot, and version checks with focused tests.
- Document Linux support and verification on WorkBuddy 5.11.3 / CLI 2.176.0, including native custom models.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 新功能
    • 新增 Linux WorkBuddy 支持,可自动发现指定安装位置的应用,并配对同目录下的 CLI;也可显式指定其他安装位置。
    • Linux 默认使用 ~/.workbuddy 作为配置目录,并支持应用内置 CLI、桌面入口及数据目录解析。
    • Linux 安装检查可读取已安装版本;最新版本状态显示为未知,且不提供应用内更新。
  • 文档
    • 补充 Linux 的安装布局、命令入口、模型目录、凭据验证及更新说明。

WorkBuddy Adapter 新增 Linux 应用发现与启动支持,并使用 Linux 专属配置根。版本检查读取应用内产品元数据,不查询更新源。文档和测试补充了这些行为及 Linux 验证记录。

Changes: WorkBuddy Linux 支持

Layer / File(s) Summary
Linux 应用发现与启动
packages/adapters/workbuddy/src/discovery.ts, packages/adapters/workbuddy/src/command.ts, packages/adapters/workbuddy/test/discovery.test.ts, packages/adapters/workbuddy/test/command.test.ts, docs/harnesses/workbuddy/workbuddy-harness-integration.md
Linux 自动发现仅检查指定的 /opt 安装目录,并配对同目录的 workbuddy 和 CLI。PATH 启动器不会作为未显式配置的候选。Linux 桌面入口及启动说明补充了相应测试和文档。
Linux 配置根与运行时验证
packages/adapters/workbuddy/src/command.ts, packages/adapters/workbuddy/test/command.test.ts, docs/harnesses/workbuddy/workbuddy-harness-integration.md
Linux 默认配置根为 ~/.workbuddy,显式配置时仍使用指定路径。测试和文档覆盖产品快照转发、认证流程、模型目录及 Adapter 启动验证。
Linux 安装版本检查
packages/adapters/workbuddy/test/installation.test.ts, docs/harnesses/workbuddy/workbuddy-harness-integration.md
版本检查从所选应用的 CLI 旁读取产品元数据,不调用更新源或 CLI。没有已确认的公共更新目标时,最新版本标为未知,且不可更新。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Adapter as WorkBuddy Adapter
  participant InstallRoots as Linux 安装根
  participant BundledCLI as 应用内置 CLI
  participant ACP as ACP
  Adapter->>InstallRoots: 检查指定的 /opt 安装目录
  InstallRoots-->>Adapter: 返回应用入口及配对 CLI
  Adapter->>BundledCLI: 启动应用内置 CLI
  BundledCLI->>ACP: 初始化 ACP
Loading

Possibly related issues

  • BytePioneer-AI/codex-host#348:该问题涉及 WorkBuddy 安装发现和命令覆盖。本 PR 支持 Linux 显式指定应用路径,但未覆盖该问题提到的 Windows 安装场景。

Possibly related PRs

  • BytePioneer-AI/codex-host#846:该 PR 涉及 bundledCliPath 契约;本 PR 的 Linux 版本检查从应用内置 product.json 读取版本信息。

Suggested labels: enhancement

Suggested reviewers: bytepioneer-ai, fs-lx

Merge Risk: Minimal · previous review b07cf

This change adds Linux desktop app support for WorkBuddy with its own discovery rules and config root. No concrete defects were found, and merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“feat(workbuddy): support the Linux desktop app”概括了本 PR 的主要变更:为 WorkBuddy 适配器增加 Linux 桌面应用支持。变更集中于 Linux 应用发现、启动入口、数据根目录、版本检查、测试和文档,与标题一致。
Description check Passed 描述说明了 Linux 上使用应用内置 CLI 的目标,并列出自动发现、默认数据根、CODEXHOST_WORKBUDDY_COMMAND 支持、版本检查、测试与文档更新等具体行为变更,与变更集高度相关。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@iruriQ
iruriQ merged commit e60f6ab into BytePioneer-AI:main Nov 25, 2026
@iruriQ

iruriQ commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Welcome and thank you for the clean Linux WorkBuddy integration, @icepie! During review we caught one subtle gap where WorkBuddyAdapter still inherited defaultConfigDirectoryName: ".workbuddy-ai" on Linux (causing Host-side history replay, resume, import, usage, fork, and rollback to miss ~/.workbuddy when WORKBUDDY_CONFIG_DIR is unset). We pushed a small follow-up commit setting the Linux profile default to .workbuddy (and forwarding context.platform in plugin.ts) with platform-parameterized history tests, and merged this into main. If you get a chance on your Linux machine, a quick real-turn history replay / resume check would be a great extra sanity check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants