Repository navigation
Make CodeBuddy optional across platform model workflows - #1157
Robert0622 wants to merge 11 commits into
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 凭据逻辑未完成验证。以上不代表代码没有其他缺陷。
| const picker=$('#issueDetailBody [data-clarify-model]'); | ||
| await picker?.modelPickerReady; | ||
| if(!picker?.isConnected||state.issueDetailData?.issue?.id!==issueId||issueClarifyJobs.get(issueId)?.attached)return; | ||
| const model=picker.querySelector('[data-feature-model]')?.value; | ||
| if(!model)return toast('请先选择模型'); |
There was a problem hiding this comment.
[P1] sendIssueClarification 新增异步 picker 门控导致 CI 失败及「再问一轮」静默中断
触发条件:调用 sendIssueClarification(包括 autoStart 自动触发、「再问一轮」重试路径)时,#issueDetailBody [data-clarify-model] 内的 feature picker 尚未完成 /api/issues/:id/clarify-models 异步加载,或加载后无可用执行器/模型。
影响:函数在 picker?.modelPickerReady resolve 后读取 [data-feature-model].value,值为空则 toast('请先选择模型') 后提前返回,POST 不发送。对用户手动点「发送」尚可接受(有 toast 提示),但自动触发的澄清(openIssueClarification(true) / 「再问一轮」openIssueClarification(false,true))通过 setTimeout(...,0) 触发,picker 此时必然未完成加载,导致整轮澄清静默丢弃。
预期 vs 实际:
- 预期:发送 chat-clarify POST,
clarification.status最终变为ready - 实际:POST 不发送,状态停留在
in_progress,CI 断言expected 'ready' got 'in_progress'
复现:
cd webtest && node --test tests/issue-drawer-actions.test.mjs
# not ok 4(head);ok 4(merge-base)
scratch 测试:head「再问一轮」CHAT_CLARIFY_POST=null,base 正常发 POST。
修复方向:自动触发路径应等待 picker 加载完成后再发送,或在 sendIssueClarification 内当 initialMessage 非空(即自动触发)时 bypass 空 picker 检查,改为将 model 解析后追加;测试应补充 /api/issues/:id/clarify-models 路由 fixture。
| const picker=$('#runEvalModelPicker'); | ||
| await picker?.modelPickerReady; | ||
| if(!picker?.isConnected||state.runEvalBusy)return; | ||
| const model=picker.querySelector('[data-feature-model]')?.value; | ||
| if(!model)return toast('请先选择模型'); |
There was a problem hiding this comment.
[P1] startRunEval 异步 picker 门控:CI runs-actions 测试崩溃,评测在 picker 未就绪时静默失败
触发条件:调用 startRunEval 时 #runEvalModelPicker 尚未完成 bindFeaturePicker 的 catalog 异步加载(/api/assistant/models),picker value 为空。
影响:await picker?.modelPickerReady resolve 后 [data-feature-model].value === '',toast('请先选择模型') 后返回,POST 不发送。测试中 app.router.calls.find(c => c.method === 'POST' && c.path === '/api/runs/run-x/eval') 返回 undefined,访问 .body 抛出 TypeError,CI 中断。
此外,picker 正常加载时发送的 model 值从裸 model-x 变为 codebuddy:model-x(带引擎前缀),测试断言 === 'model-x' 也会失败。
复现:
cd webtest && node --test tests/runs-actions.test.mjs
# not ok 5(head);ok 5(merge-base)
修复方向:测试需补充 /api/assistant/models fixture 并在 startRunEval 前等待 picker 就绪(或通过 app.evaluate 拿到 promise 后 await);同时更新断言接受新的 codebuddy:model-x 格式,或在发送前 strip 引擎前缀(取决于服务器是否要求前缀)。
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.