Repository navigation
Make CodeBuddy optional across platform model workflows - #1157
Conversation
crispinhu27
left a comment
There was a problem hiding this comment.
审查范围
审查了全部 88 个变更文件(head 9badf65,merge-base d58a85a),重点覆盖:feature picker 新架构(web/app/assistant-models.js bindFeaturePicker)、问题抽屉澄清路径(issue-drawer.js)、运行评测路径(runs.js)、后端 feature_model.go/stream.go/run_eval.go/bot_interactions.go/assistant_notification_report.go/assistant_approval_review.go,以及引擎层 align.go、预览合约 preview_build.go,遥测 otlp.go/hooks.go,tracker 凭据回退。
验证结果
CI 失败均为本 PR 引入,已在本地复现:
-
issue-drawer-actions.test.mjsnot ok 79:在 head 失败(actual='in_progress'),在 merge-base 通过。根因:sendIssueClarification新增异步 feature picker 门控;测试 fixture 未注册/api/issues/:id/clarify-models,picker value 为空,函数提前返回。同路径还导致「再问一轮」在生产中静默失败(scratch 测试验证)。 -
runs-actions.test.mjs:231TypeError:在 head 失败,在 merge-base 通过。根因:startRunEval新增异步#runEvalModelPicker门控;未 stub catalog,POST 不发送,测试访问 undefined.body 崩溃。同时 model wire 格式从裸 ID 改为engine:id。
go vet 通过。Go 完整测试因共享机器资源耗尽未能运行(非代码错误)。model-catalog-efforts.test.mjs test 98 在 merge-base 上同样失败,属预存缺陷。
问题
两项已确认 P1 问题,均需在合并前修复(详见行内评论)。Go 测试套件及 tracker 凭据逻辑未完成验证。以上不代表代码没有其他缺陷。
crispinhu27
left a comment
There was a problem hiding this comment.
审查范围(复审)
head 160fb09(此前本任务在 9badf658 提过 CHANGES_REQUESTED),base afc6e7d。复审覆盖 9badf658..160fb09 的全部提交:af8abd8 个人执行器/Git 设置与账号默认、c7beedc/d149fe1/2900471 浏览器验收与首启检查、160fb09 个人设置列表化(仅前端 4 文件)。
历史问题复测
两条历史 P1 均为 FIXED,已在当前 head 实际复测并做基线对照(把 head 的测试跑在 9badf658 的生产文件上):
| 用例 | head 160fb09 | 9badf65 对照 |
|---|---|---|
issue-drawer-actions.test.mjs #4 |
ok | not ok |
runs-actions.test.mjs #6 |
ok | not ok |
sendIssueClarification:自动/「再问一轮」路径不再等 picker 就绪,model 为空时改为不带 model 发送、由后端取账号默认;新增用例覆盖 catalog 未返回 / 已返回两种情况。startRunEval:picker 被上一次评测重绘替换时会重新取并等待,model 为空时提示而非静默失败,engine:id线格式与resolveFeatureModel一致。
已在原讨论线程中回复验证结论并标记已解决,未 dismiss 任何其他审查者的 Review。
实际执行的验证
- CI:
160fb09上 17 项检查全部 success(含core、browser、first-run、e2e 三平台)。 webtest: 218/218 通过;chatbot: 56 个文件 450 个用例通过(scripts/build-chatbot.sh)。go build ./...、go vet ./...通过;internal/domain、repo、engine、runner、httpapi、web、application包测试通过。internal/runtime有 8 项 Docker/bwrap/git-identity 用例失败,在 baseafc6e7d上同样失败(本机缺 Docker、git 身份与环境差异),与本 PR 无关。- 针对新增的账号默认设置,另写临时探针(未提交、未推送)在真实 gin 路由 + sqlite 上验证:未配置执行器返回 400 而不是 500;
codex:model前缀会被规范化存储;占位模型与非法确认方式被拒;/api/assistant/models的preferences与resolveFeatureModel与该默认一致;删除该执行器凭据后默认执行器被清空,不留悬空值。 - 新增的
assistant_defaults、codebuddy_base_url列由autoMigrateIncremental覆盖,升级路径无需手工迁移。
结论
历史阻塞问题已修复,当前 head 的审查与验证未发现需要阻塞的缺陷。本次 Approve 仅代表上述范围内未发现问题,不代表代码不存在其他缺陷。
crispinhu27
left a comment
There was a problem hiding this comment.
审查范围(复审)
head 66878c0,base/merge-base 42541ef(当前 main)。本任务上次在 160fb09 给过 APPROVE(因新推送被自动 dismiss),此前的两条 P1 已在 160fb09 复测为 FIXED,没有未解决的历史问题。本次覆盖 160fb09..66878c0 的全部变化:
0b614eb(合入 main):用git show --remerge-diff逐项核对冲突解决结果。assistant_generation.go删掉assistantRequestModel(req.Executor, …)那一行和本 PR 最初e397777的设计一致,模型由assistantTurnCatalogModel统一解析。web/orchestrate.js已与 main 完全一致(#991把编排器迁到了 chatbot),对应的可选 CodeBuddy 逻辑改到了chatbot/src/SopDesigner.jsx:默认模型改为按账号偏好或已配置的执行器选择,并带上requireExactModel。cli_models_probe.go在 CLI 缺失时直接说明"没有安装"。resolveCodeBuddyBin改用assistantCLIGlobalDirs,默认值仍是/usr/local/bin、/usr/bin,行为不变。7b79065(合入#1080):schedule_jobs_save的描述同时保留了assistantModel和timeoutMinutes两段说明,调度相关测试通过。66878c0:只改了.credential-notice的 CSS,浅色和深色主题都恢复成与 main 一致的琥珀色。
实际执行的验证
验证环境不带任何凭据。
go build ./...通过;go vet检查了internal/httpapi、internal/application、internal/schedule,通过。- Go 全量测试:除下面这些用例外,其余全部通过。
- 10 个用例失败,原因是本机缺 Docker、浏览器、git 身份和 sd_notify 环境。同样 10 个用例在 main
42541ef上也失败,与本 PR 无关。 - 6 个 Docker 管理用例只在并行全量跑时失败,单独跑全部通过。
- 新增的
TestProbeCodeBuddyIOAModelsReportsMissingCLI通过;与 probe、调度、designer 相关的 68 个用例全部通过。
- 10 个用例失败,原因是本机缺 Docker、浏览器、git 身份和 sd_notify 环境。同样 10 个用例在 main
- chatbot:在
66878c0上 57 个文件 462 个用例全部通过,vite build成功;webtest:221/221 通过。 - SopDesigner 默认模型:另写了一个临时 vitest(没有提交、没有推送),同一组用例分别跑在 head 和 main 上对照:
| 场景 | head | main 42541ef |
|---|---|---|
| CodeBuddy 未配置,没有账号偏好 | codex:gpt,requireExactModel=true |
cb-model(选中了未配置的执行器) |
账号偏好为 claude-code/sonnet |
claude-code:sonnet |
cb-model |
| CodeBuddy 已配置,没有偏好 | cb-model |
cb-model |
- 用 Chromium 实际渲染了
66878c0构建出的 CSS:浅色主题.credential-notice为rgb(255,251,240)/rgb(122,90,18),深色主题为rgb(43,37,19)/rgb(232,207,140),与 main 一致。 - CI:
66878c0上 17 项检查全部 success,包括core、browser、first-run、platform-required和三个平台的 e2e。
结论
当前 head 在上述范围内的审查和验证都没有发现需要阻塞的问题。本次 Approve 只代表这个范围内没有发现问题,不代表代码不存在其他缺陷。
crispinhu27
left a comment
There was a problem hiding this comment.
Automated CR — re-review of head 33e1d50 (merge-base with main 7dcf3fc; main is now 1584230)
Since the dismissed approval at 66878c0, this review covered 17d2fc1, 15aa373, the Merge main commit 5e4ac2f (re-merge diff checked) and 33e1d50.
Confirmed issue (1): see inline [P2]. The merge resolution dropped ReportOnly from the Claude engine options, so Claude notification-report runs lose their --tools "" --no-session-persistence isolation. Reproduced on 5e4ac2f and 33e1d50; the pre-merge commit 15aa373 passes the same probe.
Verification so far (isolated user, no credentials, synthetic data):
5e4ac2f:go build ./...andgo vetpass.go test ./internal/httpapi/ ./web/: the only failures are browser/Chromium, a shared/tmppath collision, and the native-chat placeholder; none relate to this PR. A separate run with the chatbot actually built:go test ./web/ok, vitest 57 files pass, webtest 222/222.33e1d50only changes chatbot/web onboarding files, with nointernal/changes. The probe still fails there.- CI:
5e4ac2fall 17 checks success. On33e1d50, 13 success andcore/browser/Buildwere still running when this review was posted.
Not yet covered: a full UI and test pass on 33e1d50 (onboarding return-to-quick-access flow), and conflicts with the new main 1584230, which also touches web/app.js and web/index.html. I'll re-review once the fix is pushed.
crispinhu27
left a comment
There was a problem hiding this comment.
Automated CR: re-review of head 15bbc38 (merge-base 7dcf3fc; main 1584230; GitHub reports mergeable)
This round covers the two commits since the last Request Changes on 33e1d50: 0aa4192 (SOP built-in roles follow the responsible user's executor, plus the executor-requirements endpoint and UI) and 15bbc38 (ReportOnly fix).
Previous issue
- [P2] Merge dropped
ReportOnlyfromengineOpts: FIXED. Re-tested on15bbc38with the original probe throughrunAssistantCLI. It passes on15bbc38and still fails on33e1d50. Details are in the original thread.
New confirmed issue (1): [P2], inline. The new admission check in planSOPExecutors returns 400 for a key-less account. e2e/api/30-runs.test.mjs still expects the built-in template run to be admitted, so the required platform-required / browser check fails on this head. It passed on 33e1d50. Because the API step fails, the Playwright suites and the route-coverage gate in that job did not run on this head.
Verification on 15bbc38 (isolated user, no credentials, synthetic data):
go build ./...andgo vet ./internal/...pass.go test ./internal/...: the same failures appear on head and main1584230. They are all in Chromium, Docker and bwrap sandbox tests that this environment can't run (httpapi: 2 browser tests, runner: 1, runtime: 10). There are no PR-specific failures. engine, domain and repo pass.webtest: 221/221 pass.- Targeted:
TestGenericTemplateRunsDirectlyByReference,TestSOPReportClaudeInvocationDisablesToolsAndSessionPersistenceand the newTestGenericSOPCopyUsesPersonalDefaultForUnpinnedRolesandTestGenericSOPExecutorPrefersRunnerLoginOverSharedKey(engine) pass. - CI: every check except
browserandplatform-requiredsucceeds.
Not covered: UI behaviour of the new executor-requirement rows in a real browser (no Chromium or Docker here), and the Playwright suites that CI skipped after the failing API step. I'll re-review once the e2e contract is updated.
crispinhu27
left a comment
There was a problem hiding this comment.
Automated CR — APPROVE(复审 head f5c669c,merge-base 7dcf3fc)
历史问题
- [P2] ReportOnly 丢失(comment #4652170221):FIXED。
15bbc38中runAssistantCLI的engineOpts加回了ReportOnly: req.ReportOnly;TestSOPReportClaudeInvocationDisablesToolsAndSessionPersistence在f5c669c通过,断言--tools ""和--no-session-persistence均出现在 Claude argv 中。 - [P2] admission gate 提前 400(comment #4652422604):FIXED。
f5c669c将无执行器的处理推迟到节点执行时(resolveDeferredSOPExecutor),planSOPExecutors不再在入队阶段返回 400;TestGenericTemplateRunsDirectlyByReference在f5c669c通过(POST /api/runs → 201),engineTestGenericSOP*均通过。
本次新增变更(f5c669c)审查范围
sop_executors.go:引入errSOPExecutorUnconfiguredsentinel +resolveDeferredSOPExecutor,在节点执行前从当前责任人的配置中填充延迟的执行器,逻辑完整,错误传播正确。node_execute.go:在 sandbox requirements 和 executeNode 分别处理 sentinel,沙箱预检跳过未配置节点,节点执行路径在填充失败时调 failNode,行为一致。runner_dispatch.go:validateExecutionReconnect 跳过 sentinel,不影响重连判断。generic_workflows_test.go/sop_executors_test.go:用例逻辑与新语义对齐,覆盖了无执行器入队和延迟解析两条路径。e2e/api/30-runs.test.mjs:新增 executor-requirements 预检,cancel 容忍 400(run 已完成),与新入队语义一致。
验证(head f5c669c,隔离工作区,无生产凭据)
go build ./...:通过(exit 0)TestSOPReportClaudeInvocationDisablesToolsAndSessionPersistence:PASSTestGenericTemplateRunsDirectlyByReference:PASS(两次 POST /api/runs → 201)TestGenericSOPCopyUsesPersonalDefaultForUnpinnedRoles、TestGenericSOPExecutorPrefersRunnerLoginOverSharedKey:PASS
以上结论仅覆盖上述审查和验证范围,不代表代码没有任何缺陷。
crispinhu27
left a comment
There was a problem hiding this comment.
Automated CR — APPROVE(复审 head 35c9060,merge-base 7dcf3fc,main 5c343b4)
历史问题
- [P2] ReportOnly 丢失、[P2] admission gate 提前 400:此前已在
f5c669c复测 FIXED(review 6005872802,因新推送被 dismiss)。本次新提交未触及相关代码,结论不变。
本次新增变更(f5c669c → 35c9060,1 个提交)
internal/runeval/prompt.go:提示词不再要求模型输出score,解析结构去掉Score int。总分本来就由domain.ScoreRunEvalDimensions按权重重算,调用方internal/httpapi/run_eval.go只用重算结果;去掉该字段后,模型返回96.75、"100"或对象形式的 score 不会再让json.Unmarshal失败导致整次评测失败。提示词仍要求解析器所需的全部字段。internal/runeval/facts_test.go:TestParseModelResultScoresByWeight加入非整数 score。
验证(隔离工作区,无凭据,Go 1.26.11)
go build ./...(补占位web/native-chat构建产物)、go vet ./internal/runeval/ ./internal/httpapi/ ./internal/domain/:通过,head 与合入5c343b4后的树均通过;与 main 合并无冲突。go test ./internal/runeval/... ./internal/domain/... ./internal/httpapi/:head 与合并树均 PASS。- 基线对照:把
prompt.go回退到f5c669c,更新后的测试失败(cannot unmarshal number 96.75 ... of type int),head 通过;临时用例确认 score 缺失/虚高/多余字段时结果与基线一致(总分按权重重算,虚高 score 不影响 passed)。 go test ./internal/...中 engine/runtime 的少数失败(宿主 git 身份、Docker/bwrap 环境)在 merge-base 上同样出现,与本 PR 无关。- GitHub CI:当前 head 全部 check 成功。
以上结论仅覆盖上述审查和验证范围,不代表代码没有任何缺陷。
crispinhu27
left a comment
There was a problem hiding this comment.
复审 head f764bc6(base main 26ef6e1,merge-base 26ef6e1),结论:Approve。
本轮审查范围(上一个 APPROVE 在 35c9060 上,已因新推送失效)
38dc340/0f21e36:合入 main(#1179 按账号区分 CodeBuddy 模型,#1154 SOP 角色绑定)。用 remerge-diff 核对了冲突解决结果:useChat.js保留了按账号的默认模型和 effort,composerModelError校验还在;assistant*.go的 catalog 调用已对齐 #1179 的签名;flows.js预览节点保留了workflowPreviewExecutor和 main 的openNodeDrawer;app.js两边的视图切换逻辑都保留了。a19526c:工蜂和 TAPD 主机改为可配置(AGENTFLOW_GONGFENG_HOST/AGENTFLOW_TAPD_HOST)、未设执行器的角色和预览跟随责任人默认、ParseRepositoryURL拒绝不带主机的group/repo、去掉 tracker MCP 的 CodeBuddy 凭据回退。e01ea57/084479d/237579d/f764bc6:Compose 和.env.example透传、测试更新、Git HTTPS 仓库标签。
实际验证(隔离 worktree,不含任何凭据)
go build ./...、go vet ./...:通过。go test ./... -count=1:27 个包通过。剩下 httpapi / runner / runtime 里依赖 Chromium、Docker、bwrap 的用例在本地失败,但 main 基线 26ef6e1 上是同一组用例、同样失败,属于沙箱环境限制。GitHub 上的core、browser都是 success。- chatbot
vitest run:57 个文件、473 个测试通过。webtest npm test:225/225 通过。 - 本轮在中间版本
084479d上复现过两处测试回归,基线 26ef6e1 上同一用例都通过:TestAssistantTurnContextNamesTheChatProject还在断言旧的git.example.com/projects/new文案;issues-list.test.mjs断言parseGongfengRepoURL('team/sub/repo')能解析,现在返回 null。237579d/f764bc6已按新约定更新这两处,在f764bc6上复测都通过(FIXED)。 - 另外单独验证了 git 的凭据行为:
AuthConfigArgs改用按主机限定的credential.https://<host>.helper=重置后,全局 credential helper 不会抢先返回凭据(git 2.47 实测)。
历史问题:此前 REQUEST_CHANGES 中的问题,前几轮复审(review 6005872802、6006155437)已逐项复测为 FIXED。本轮在当前 head 上跑的全量测试没有出现相关回归,也没有未解决的审查线程。
当前 head 的 CI 全部通过(含 core、browser、platform-required、e2e-required)。以上只说明本次审查和验证范围内没有发现阻塞问题,不代表代码没有缺陷。
crispinhu27
left a comment
There was a problem hiding this comment.
Automated CR — APPROVE(复审 head 75d69fff,merge-base 26ef6e1,main 26ef6e1)
历史问题
此前所有 REQUEST_CHANGES(6001670216 / 6004825536 / 6005134682)的问题均已在之前各轮复审中确认 FIXED;上一个 APPROVE(6006402878,head f764bc66)因新推送被自动 dismiss。
本轮新增提交(75d69fff)审查结论
单一提交「Verify scheduled baseline merges inside the repository checkout」:
- 为 baseline-align SOP 的 verify 脚本节点增加
ExecutionScope: ExecutionScopeRepositories,使该节点在运行时通过bindExecutionTarget自动cd进入仓库检出目录后再执行 shell 脚本。此前缺少该字段时,脚本在 workspace 根目录运行,多仓库场景下 git 操作可能指向错误的工作树——本提交修复了该问题。 - workflow version 7→8,确保
ensureBaselineAlignWorkflow升级已安装的旧版本。 - 新增测试:覆盖全新安装和 v7→v8 升级两条路径,断言
verify节点具有正确的ExecutionScopeRepositories。 - Agent 指令文本加了进入本次对齐仓库的检出目录,与运行时行为一致,无副作用。
CI 状态:head 75d69fff 上全部 17 个 check-run 均为 success(含 core、platform-required、e2e-required、browser、first-run、e2e-browser)。
验证:本地 Go 运行环境缺失(go 1.26.11 未安装),直接测试执行标记为 UNVERIFIED;以 CI 全绿结果作为构建与测试通过的证据。静态分析无新增候选问题。
Summary
AGENTFLOW_BASELINE_ALIGN_EXECUTORmakes the scheduled baseline resolver configurable.See deployment configuration for the optional build flags and baseline override.
Verification
go vet ./..., all 450 Chatbot tests, and all 56 Web console suites. Reran the clarification and evaluation picker cases after the final change.CODEBUDDY_PACKAGE=and passed its runtime checks. The image contains Codex, DeepSeek Harness, and WeCom CLI.deepseek-v4.1-flash. It returned the expected response.The repository-free run admission E2E passed against a local server with no executor configured. A separate engine test verified that a deferred role resolves its executor after configuration.