Skip to content

Make CodeBuddy optional across platform model workflows - #1157

Merged
Robert0622 merged 31 commits into
mainfrom
codex/optional-codebuddy-runtime
Nov 21, 2026
Merged

Robert0622 merged 31 commits into
mainfrom
codex/optional-codebuddy-runtime

Conversation

@Robert0622

@Robert0622 Robert0622 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Let requirement clarification, run evaluation, Bot replies, SOP notification reports, and scheduled AI prompts use the execution account's selected CLI and model. Keep the executor and model as separate controls. Use the personal default when a new selection is omitted.
  • Let users add and manage Git credentials and executor credentials in Personal configuration. Git matches credentials to the repository protocol, host, and port. Keep the existing-subscription entry for runner account login.
  • Save a personal default executor, model, reasoning effort, and approval mode. Refresh Chatbot when credentials change so a deleted executor leaves the selection menu.
  • Support an optional CodeBuddy Base URL in personal and runner execution. A remote runner must be at least 0.11.2 for a custom CodeBuddy URL.
  • Use the responsible user's configured executor for built-in template roles with default settings. A run can be started before executor setup and retried after setup. Keep legacy bare model IDs compatible with CodeBuddy. SOP roles and static preview steps support selecting other executors. AGENTFLOW_BASELINE_ALIGN_EXECUTOR makes the scheduled baseline resolver configurable.
  • Allow source images and sandbox defaults to omit CodeBuddy. Keep the main branch's WeCom CLI installation and both the existing shared CodeBuddy key and provider-specific integrations.
  • Preserve project permissions and the execution account for report generation, clarification, and scheduled jobs. Restore automatic clarification and evaluation when the model picker loads asynchronously.

See deployment configuration for the optional build flags and baseline override.

Verification

  • Passed the non-browser Go suites, the five real Chromium Go tests, go vet ./..., all 450 Chatbot tests, and all 56 Web console suites. Reran the clarification and evaluation picker cases after the final change.
  • Passed Chromium checks for adding and deleting executor credentials, refreshing Chatbot in the same frame, saving and restoring defaults, opening runner login, adding Git credentials, and editing or clearing the CodeBuddy Base URL. A loopback gateway received and answered the configured CodeBuddy request.
  • Passed the Chromium public cases for preserving a draft while adding ZCode, blocking sends with no credential, and opening the GitHub authorization form.
  • Ran real Codex with a loopback model fixture on a host without CodeBuddy in its execution path. Evaluation, assisted approval, notification reports, Bot replies, and two clarification turns passed.
  • Built an image with CODEBUDDY_PACKAGE= and passed its runtime checks. The image contains Codex, DeepSeek Harness, and WeCom CLI.
  • Ran a single real CodeBuddy iOA chat using deepseek-v4.1-flash. It returned the expected response.
  • Passed the configured-executor menus, SOP readiness, and missing-credential journeys on both the published 0.4.0 image and the source build.

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.

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查范围

审查了全部 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 引入,已在本地复现:

  1. issue-drawer-actions.test.mjs not ok 79:在 head 失败(actual='in_progress'),在 merge-base 通过。根因:sendIssueClarification 新增异步 feature picker 门控;测试 fixture 未注册 /api/issues/:id/clarify-models,picker value 为空,函数提前返回。同路径还导致「再问一轮」在生产中静默失败(scratch 测试验证)。

  2. runs-actions.test.mjs:231 TypeError:在 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 凭据逻辑未完成验证。以上不代表代码没有其他缺陷。

Comment thread web/app/issue-drawer.js Resolved
Comment thread web/app/runs.js Resolved
crispinhu27
crispinhu27 previously approved these changes Nov 21, 2026

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查范围(复审)

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 用例失败,在 base afc6e7d 上同样失败(本机缺 Docker、git 身份与环境差异),与本 PR 无关。
  • 针对新增的账号默认设置,另写临时探针(未提交、未推送)在真实 gin 路由 + sqlite 上验证:未配置执行器返回 400 而不是 500;codex:model 前缀会被规范化存储;占位模型与非法确认方式被拒;/api/assistant/models 的 preferences 与 resolveFeatureModel 与该默认一致;删除该执行器凭据后默认执行器被清空,不留悬空值。
  • 新增的 assistant_defaults、codebuddy_base_url 列由 autoMigrateIncremental 覆盖,升级路径无需手工迁移。

结论

历史阻塞问题已修复,当前 head 的审查与验证未发现需要阻塞的缺陷。本次 Approve 仅代表上述范围内未发现问题,不代表代码不存在其他缺陷。

crispinhu27
crispinhu27 previously approved these changes Nov 21, 2026

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查范围(复审)

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 个用例全部通过。
  • 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 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ./... and go vet pass. go test ./internal/httpapi/ ./web/: the only failures are browser/Chromium, a shared /tmp path 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.
  • 33e1d50 only changes chatbot/web onboarding files, with no internal/ changes. The probe still fails there.
  • CI: 5e4ac2f all 17 checks success. On 33e1d50, 13 success and core/browser/Build were 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 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ReportOnly from engineOpts: FIXED. Re-tested on 15bbc38 with the original probe through runAssistantCLI. It passes on 15bbc38 and still fails on 33e1d50. 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 ./... and go vet ./internal/... pass.
  • go test ./internal/...: the same failures appear on head and main 1584230. 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, TestSOPReportClaudeInvocationDisablesToolsAndSessionPersistence and the new TestGenericSOPCopyUsesPersonalDefaultForUnpinnedRoles and TestGenericSOPExecutorPrefersRunnerLoginOverSharedKey (engine) pass.
  • CI: every check except browser and platform-required succeeds.

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.

Comment thread internal/engine/sop_executors.go Resolved
crispinhu27
crispinhu27 previously approved these changes Nov 21, 2026

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),engine TestGenericSOP* 均通过。

本次新增变更(f5c669c)审查范围

  • sop_executors.go:引入 errSOPExecutorUnconfigured sentinel + 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:PASS
  • TestGenericTemplateRunsDirectlyByReference:PASS(两次 POST /api/runs → 201)
  • TestGenericSOPCopyUsesPersonalDefaultForUnpinnedRoles、TestGenericSOPExecutorPrefersRunnerLoginOverSharedKey:PASS

以上结论仅覆盖上述审查和验证范围,不代表代码没有任何缺陷。

crispinhu27
crispinhu27 previously approved these changes Nov 21, 2026

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
crispinhu27 previously approved these changes Nov 21, 2026

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审 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 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 全绿结果作为构建与测试通过的证据。静态分析无新增候选问题。

@Robert0622
Robert0622 merged commit a458320 into main Nov 21, 2026
17 checks passed
@Robert0622
Robert0622 deleted the codex/optional-codebuddy-runtime branch November 21, 2026 17:18
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