Skip to content

fix(workbuddy): prefer versions layout and recognize WorkBuddy-app.exe - #1398

Merged
iruriQ merged 1 commit into
mainfrom
fix/issue-1382-workbuddy-512-layout
Nov 29, 2026
Merged

iruriQ merged 1 commit into
mainfrom
fix/issue-1382-workbuddy-512-layout

Conversation

@iruriQ

@iruriQ iruriQ commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Part of #1382

Summary

Fixes three remaining Windows WorkBuddy 5.12+ launcher-layout edge cases inside @codexhost/adapter-workbuddy:

  1. Recognize WorkBuddy-app.exe as an explicit Desktop runtime (packages/adapters/workbuddy/src/command.ts): extend the Windows explicitDesktop basename check to match WorkBuddy-app.exe alongside WorkBuddy.exe / WorkBuddy AI.exe / WorkBuddyAI.exe, so setting CODEXHOST_WORKBUDDY_COMMAND to ...\versions\<version>\WorkBuddy-app.exe resolves the full bundle (ELECTRON_RUN_AS_NODE=1, --eval, bundled CLI, and --serve for lite-only builds).
  2. Recognize WorkBuddy-app.exe in a selected version directory (packages/adapters/workbuddy/src/discovery.ts): include "WorkBuddy-app.exe" in resolveWorkBuddyInstallDirectory Windows entries so pointing Connections directly at ...\versions\<version> discovers the app and its bundled CLI.
  3. Prefer versions/<version>/ over stale root resources/ (packages/adapters/workbuddy/src/discovery.ts): probe resolveWorkBuddyLauncherLayout(...) before checking sibling resources/.../codebuddy in resolveWorkBuddyBundle, preventing in-place upgrades with leftover root resources/ from launching the root WorkBuddy.exe launcher.

Validation (TDD)

  • Before fix (red): ran npx vitest run --config tests/vitest.config.js packages/adapters/workbuddy/test/discovery.test.ts packages/adapters/workbuddy/test/command.test.ts — all 3 new regression tests failed (3 failed | 61 passed).
  • After fix (green):
    • npx tsc -b packages/adapters/workbuddy — passed
    • npx vitest run --config tests/vitest.config.js packages/adapters/workbuddy/test/*.test.ts — 14 test files passed, 188/188 tests passed
    • node tools/check-boundaries.mjs — passed
    • npx prettier --check packages/adapters/workbuddy/{src,test}/{command,discovery}*.ts — passed
    • npx eslint packages/adapters/workbuddy/src/command.ts packages/adapters/workbuddy/src/discovery.ts — 0 errors

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 修复
    • Windows 版 WorkBuddy 现可识别 WorkBuddy-app.exe。
    • 优先使用版本目录中与应用程序配套的 CLI;若未找到,再检查应用程序旁的 CLI。

Windows WorkBuddy 适配器现在识别 WorkBuddy-app.exe,并优先选择 versions/<version>/ 中的应用程序和配套 CLI。新增测试覆盖显式路径、自动发现及版本目录路径。

Changes: WorkBuddy Windows 发现

Layer / File(s) Summary
识别 Windows 应用程序
packages/adapters/workbuddy/src/command.ts, packages/adapters/workbuddy/src/discovery.ts, packages/adapters/workbuddy/test/command.test.ts
显式可执行文件匹配和安装目录候选列表新增 WorkBuddy-app.exe。新增测试验证显式路径启动时使用 Electron 可执行文件、配套 CLI 及 ACP 参数。
解析版本目录布局
packages/adapters/workbuddy/src/discovery.ts, packages/adapters/workbuddy/test/discovery.test.ts
版本目录探测现在先于根目录 resources CLI 检查。新增测试验证自动发现和显式指定版本目录时选择目录内的应用程序及配套 CLI。

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 1382:本 PR 覆盖 WorkBuddy 5.12 版本目录布局导致检测失败的问题;未涉及该 issue 提到的 ACP stdio 连接过早关闭问题。
  • Issue 348:本 PR 支持显式路径指向 WorkBuddy-app.exe,但未处理注册表 InstallLocation 为空或非标准安装路径的问题。

Possibly related PRs

  • BytePioneer-AI/codex-host#1383:该 PR 也修改 WorkBuddy Windows 的 versions/<version>/ 布局发现,并涉及应用程序与配套 CLI 的配对。

Suggested reviewers: bytepioneer-ai, koeria

Merge Risk: Minimal · up to e2d97

This change lets WorkBuddy on Windows be discovered when its executable is named WorkBuddy-app.exe. It also prefers the newer versions layout over stale root files. Regression tests cover the new behavior, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题描述了 PR 的两个主要变更:优先使用 versions 目录布局,并识别 WorkBuddy-app.exe。这与 raw_summary 中 command.ts、discovery.ts 的改动以及对应测试一致。标题简洁,符合单句、具体的要求。
Description check Passed 描述说明了三类 Windows WorkBuddy 5.12+ 启动器布局问题的修复:识别 WorkBuddy-app.exe 为显式 Desktop 运行时,在版本目录中识别该程序,以及优先使用 versions// 而非旧的根目录 resources/。这些内容与 raw_summary 中的文件改动和新增测试直接对应。
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.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4a98cf2 and e2d9708.

Files selected for processing: 4

  • packages/adapters/workbuddy/src/command.ts
  • packages/adapters/workbuddy/src/discovery.ts
  • packages/adapters/workbuddy/test/command.test.ts
  • packages/adapters/workbuddy/test/discovery.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Recent review details

Context from checks skipped due to timeout: 2

  • GitHub Check: Static checks
  • GitHub Check: Vitest
Additional context used

Code guidelines: 3

AGENTS.md — auto-discovered
docs/product/standalone-web.md — auto-discovered
CLAUDE.md — auto-discovered
Path-based instructions: 3

Source excerpt: Harness-specific protocol details must remain inside the corresponding Adapter.

CodeRabbit inference engine (AGENTS.md)

Files:

  • packages/adapters/workbuddy/src/command.ts
  • packages/adapters/workbuddy/src/discovery.ts
  • packages/adapters/workbuddy/test/command.test.ts
  • packages/adapters/workbuddy/test/discovery.test.ts
Source excerpt: `codexhost` runs external Agent Harnesses as independent Threads inside Codex Desktop, preserving the official shell and native Codex path.

CodeRabbit inference engine (AGENTS.md)

Files:

  • packages/adapters/workbuddy/src/command.ts
  • packages/adapters/workbuddy/src/discovery.ts
  • packages/adapters/workbuddy/test/command.test.ts
  • packages/adapters/workbuddy/test/discovery.test.ts
Applicability reference: AGENTS.md: # Repository Guidelines `npm start` / `npm start web` rebuild and relaunch the user's Desktop / Web and may restart the shared Host; `npm stop` stops all local codexhost services across worktrees.

CodeRabbit inference engine (docs/product/standalone-web.md)

Files:

  • packages/adapters/workbuddy/src/command.ts
  • packages/adapters/workbuddy/src/discovery.ts
  • packages/adapters/workbuddy/test/command.test.ts
  • packages/adapters/workbuddy/test/discovery.test.ts
Learnings: 1

Learning: 2026-11-17T12:08:43.655Z

Learnt from: CR
Repo: BytePioneer-AI/codex-host PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-11-17T12:08:43.655Z
Learning: Source excerpt:
# Repository Guidelines

## Testing & Completion

- Writing tests. Every test is code to maintain and CI time to pay; add one only when it earns that.
  - Small, low-risk changes need no new tests. Add focused tests for high-risk or cross-package changes, or when asked.
  - A new test must catch a regression the existing tests would miss. Extend the nearest existing case or `test.each` instead of adding near-duplicates.
  - Assert observable behavior (inputs, outputs, protocol messages, persisted state), not internal call order, private state, or mock call counts.
  - Mock only external boundaries (network, clock, real CLIs, the OS), never the code under test. Avoid large snapshots and long literal expectations that can only be updated mechanically.
  - A bug-fix test must fail before the fix. Never weaken assertions or delete tests just to make a change pass; report the conflict instead.
  - When a change makes existing tests redundant or ties them to removed internals...

Applied to files:

  • packages/adapters/workbuddy/test/discovery.test.ts

@iruriQ
iruriQ merged commit c1ea889 into main Nov 29, 2026
7 checks passed
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.

2 participants