You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(workbuddy): preserve bundled CLI path across credential preload - #846
This fixes the bundled product.json model fallback when credential preload is used. The change is small and limited to WorkBuddy, so the merge risk is minimal.
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: 5
GitHub Check: CodeRabbit
GitHub Check: Check Linux ARM64
GitHub Check: Check windows-latest
GitHub Check: Check ubuntu-22.04
GitHub Check: Check macos-26
Additional context used
Code guidelines: 1
AGENTS.md — auto-discovered
Path-based instructions: 1
Source excerpt: Harness-specific protocol details must remain inside the corresponding Adapter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
问题。 #533(
cc71d09d,2026-10-17)让打包版 WorkBuddy 的启动走凭据 preload,子进程 argv 因此变成--eval <preload> <bundle.cli> --acp ...(packages/adapters/workbuddy/src/command.ts,在main@7c13b4d0上是第 232 行)。product-models.ts中的bundledFallbackProductPath(第 75 行,自98987f1b起未改动,2026-09-20)仍把invocation.arguments[0]当作打包 CLI 脚本,并在该值以-开头时提前退出。现在它看到的是--eval,因此打包路径<app>/.../app.asar.unpacked/cli/product.json这个回退来源永远不会被推导出来。何时有影响。 该回退是
loadWorkBuddyProductModels中三个产品配置来源里的最后一个:显式ACC_PRODUCT_CONFIG_PATH、内联ACC_PRODUCT_CONFIG[_V3|_V2],然后是打包的product.json。command.ts只在缓存快照acc-product-config-v3.json已存在时才注入ACC_PRODUCT_CONFIG_PATH(bundledProductConfigPath)。因此在 Windows 上,当既没有缓存的产品快照、也没有显式产品配置时,打包启动的 Model catalog 只包含 ACP 报告的 Model:mergeWorkBuddyProductModels描述的产品文件补充会静默缺失。macOS 有意使用原生 ACP catalog,不追加产品文件中的 Model,因此不受影响。CLI 仍能启动(preload 正常工作),这就是该回归不会表现为启动失败的原因。复现(静态,已由新测试验证)。 在 Windows 上选择打包安装,保持
ACC_PRODUCT_CONFIG_PATH与内联ACC_PRODUCT_CONFIG*变量未设置,并去掉缓存的产品快照;此时查看 WorkBuddy Model catalog 就会缺少产品文件补充。合成测试直接覆盖 invocation/reader 这一对,不启动 CLI。回退本分支中这一行 reader 改动即可精确复现:新测试以expected [] to deeply equal [ { id: 'glm-5.2', name: 'GLM-5.2' } ]失败。改动。
workBuddyInvocation()是 bundle 解析的归属方——它本来就已经解析bundle.cli来构造 preload 参数——因此现在也把它作为可选的bundledCliPath放进 invocation 结果返回,model reader 改用该字段,不再从参数位置重新推导路径。打包启动会提供该字段;通过独立/显式 CLI 可执行文件启动则不提供,从而保持此前不读取 bundle 相对路径product.json的行为。传给 CLI 的 argv 不变。范围。 四个文件:
command.ts(+5/-1)、product-models.ts(+2/-2)、command.test.ts(+2/-0)、product-models.test.ts(+51/-2)。导出的workBuddyInvocation()返回类型新增一个可选字段;CodeBuddyInvocationFactory、Harness 插件契约与已持久化格式均未改动。ACP 参数、认证、Model 合并规则与其他 Harness 均无变化。这是局部缺陷修复,因此不新增 OpenSpec change(openspec/config.yaml:局部修复可跳过 spec)。Related issues
cc71d09d合并;引入了--eval <preload> <cli>argv,而该 reader 没有随之更新。凭据 bootstrap 本身保持原样。arguments[0]读取打包 CLI。无对应的已跟踪 issue:这是通过阅读 launch/reader 这一对代码发现的,并非上游报告。
Test plan
已 rebase 到
main@7c13b4d0。macOS 27.2(darwin/arm64),Node 24.21.0,干净npm ci(分支基线与main@7c13b4d0之间package.json/package-lock.json未变)。Adapter 测试目录:14 个文件、166 项测试通过、0 跳过,含两个被改动的文件(
command.test.ts36 项,product-models.test.ts4 项)。双向回归证据:
loads bundled product models with credential preload arguments通过。它按宿主平台构造 macOS 或 Windows 布局的临时 bundle,断言 invocation 为["--eval", <preload>, <cli>, "--acp", "--no-session-persistence"]且不含ACC_PRODUCT_CONFIG_PATH,并断言随后返回打包product.json中的 Model。product-models.ts回退为invocation.arguments[0]、其余不变:该用例失败(expected [] to deeply equal [ { id: 'glm-5.2', name: 'GLM-5.2' } ],退出码 1)。之后已还原;上面的目录运行结果是还原后的结果。command.test.ts断言 bundle 启动时bundledCliPath等于打包 CLI,而独立CODEXHOST_WORKBUDDY_COMMAND可执行文件时该字段为undefined。本轮未验证:没有启动真实 WorkBuddy App/CLI,也没有启动 codexhost Runtime 或 Desktop,因此这里没有演示 macOS 与 Windows 原生 Model 菜单行为;夹具是合成 bundle,只能证明参数布局与
product.json回退,不能证明发布版 App 的product.json内容。未使用 Windows 主机。