Repository navigation
Conversation
|
The four red checks come from the CI runner, not from this change.
The jobs that test the code pass:
The last run on main for the same base commit (dd56585) was green, so the runner image probably changed since then. Fixing it needs a workflow change, for example dropping 3.8 from the matrix or pinning ubuntu-24.04, plus a look at the Playwright install step. I've left that out of this PR to keep it scoped to #441. |
Yanami-2K
left a comment
There was a problem hiding this comment.
对照 #441 读完了 11 个文件(assistant-models.js、agents.js、sync-schedule.js、index.html、CSS 等 patch 有截断,按可见部分和描述判断)。bindPicker 把角色定义的 CLI/模型/思考强度和新建需求/澄清的模型选择统一到与聊天框一致的菜单,覆盖了 issue 里前三张截图的入口;隐藏的 select[name="executorId"] 保留取值和 change 事件,表单保存逻辑不变;assistant_models_test.js 对搜索、键盘、Escape 不关外层弹窗、CLI 切换联动等都有断言。代码层面没有发现阻塞问题,阻塞项是 CI:
- CI 失败(checksState=failure):head b1e7c96 上
validate (3.8)、e2e (ubuntu-latest, python 3.8, node 22)、e2e-browser (dashboard in Chromium)、e2e-required失败。这组失败和同期 #214/#902/#903 一致,是ubuntu-latest切到 26.04 导致的(#885,修复在 #886),和本 PR 的前端改动无关。建议等 #886 合入后 rebase 重跑,CI 全绿后重新请求审查。
非阻塞提醒:assistant-models.js 的 ENGINE_BRANDS 没有 deepseek 键,如果 #121 的 DeepSeek (via Codex) 执行器先合入,角色定义的 CLI 菜单会显示为未知品牌图标,可顺手补上。
…encent#441) The chat composer, the role wizard and 新建需求 each drew a different CLI and model picker: only the composer had search, brand logos and the "family · credits" line, and the classic SPA fell back to a gray "AI" badge whenever a model id did not start with a known prefix. Add AgentFlowAssistantModels.bindPicker, the classic-SPA twin of chatbot/src/ModelPicker.jsx: a body-level menu with search, brand icons, a fixed check slot, the same keyboard handling and viewport placement, and HuiPopover exclusivity. Brand inference now follows modelProviderFor (family, then id, then name) and unknown brands use the Harness brain glyph. Move the role wizard's CLI, model and effort and the clarification model picker onto it. The role CLI keeps a hidden select for its value, the legacy-executor option and the change event, so form handling is unchanged. Schedules, Bots, run evals and the SOP assistant keep their inline menus for now.
Review follow-up on Tencent#888: map the `deepseek` executor (DeepSeek via Codex, Tencent#121) to the DeepSeek logo so the role wizard's CLI menu does not fall back to the unknown-brand glyph.
b1e7c96 to
0f73a18
Compare
|
Thanks for the review. Both points are addressed:
Re-ran after the rebase: |
Closes #441.
What changed
Picking a CLI or model worked differently depending on where you were (#441). The chat composer (
chatbot/src/ModelPicker.jsx) had search, brand logos, a "family · credits" line and a fixed check mark. The role wizard and 新建需求 in the classic SPA used plain inline menus with no search. Whenever a model's catalog family wasother, they showed a gray "AI" badge, so "GPT-6.1 Sol" lost its GPT logo. The role wizard's CLI was also a plain dropdown.This PR adds
AgentFlowAssistantModels.bindPickerinweb/app/assistant-models.js. It is the classic-SPA twin ofModelPickerand follows design.md's model-menu spec:<body>, so dialogs and scrolling bodies no longer clip it. The menu is 240px wide, or the trigger's width up to 360px, with a 12px radius, at most 420px tall, and 6px from the trigger.HuiPopover, so only one popover is open at a time. It respectsprefers-reduced-motion.modelProviderFor: family first, then id, then name. Unknown brands show the Harnessbrainglyph instead of a lettered badge, and each CLI gets its logo, asengineBranddoes in the chat.Entries moved onto it:
select[name="executorId"](data-native) for its value, the legacy-executor option and thechangeevent, so form handling and saving are unchanged.Inline-menu CSS that no longer applies was removed, and
design.mddocuments the shared picker.Not in this PR:
bindPickerlater. They already pick up the new brand inference and the chevron caret.Scope
Compatibility
Frontend only (
web/anddesign.md). There are no API, database or migration changes. Saved role settings and the stored clarification model (agentflow.clarifyModel) are read and written exactly as before.Validation
web/assistant_models_test.jswas rewritten onweb/hui_fake_dom.jsand covers the following:index.htmlmarkup. Picking a CLI fireschangeonce and the model and effort lists follow it. Only one menu is open at a time. The manual model-id field appears when chosen. Disabled triggers stay shut.Browser check: Chromium via Playwright, with
/apistubbed, opening the role wizard and 新建需求. I checked light and dark themes, a 1280px and a 420px viewport, the keyboard CLI switch, and Escape keeping the dialog open. This caught a dark-theme bug, now fixed:product-v3.css's genericinputrule had been painting a filled box inside the menu's search field.Not run: the full
go test ./..., thelocal/scripts, the e2e suite, andnpm --prefix chatbot test.chatbot/is unchanged.Safety
ModelProviderIcon.jsx, and the logos are the ones already underweb/images/credentials.)