diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ab8a637..f806e082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Agent Workbench 更新记录 +## 1.24.3 · 统一模型选择入口(发行验收中) + +- 左下角和顶部都打开模型中心,可选择已有连接/模型池、添加模型;选中连接与旧会话实际运行分开展示。 +- 运行预算独立保存,保留当前模型选择;演示切回真实连接可直接生效。新增和切换不自动请求模型。 +- 原单连接编辑改为次级入口,明确「保存并切换原连接」,避免无意覆盖所选号池。 +- 源码、路由与界面证据及正式部署进度见docs/QA-MODEL-SELECTION-K.md;本阶段真实模型请求0。 + ## 1.24.2 · 模型身份与交付推进修复(已本地交付) - 分开显示请求型号与上游报告型号,保留原响应;可要求一致或使用有依据的显式映射,不一致时暂停并保留原用量。 diff --git a/docs/MODEL-SELECTION.md b/docs/MODEL-SELECTION.md new file mode 100644 index 00000000..15912491 --- /dev/null +++ b/docs/MODEL-SELECTION.md @@ -0,0 +1,13 @@ +# 选择和管理模型 + +左下角「模型与连接」、顶部当前模型按钮和「模型中心」打开同一个模型中心。上方「新任务默认模型」可直接选择已保存连接或模型池,也可点击「添加模型」保存新的接口、协议、请求型号和凭据。保存新连接后,再在选择器中选用它;新增和切换本身不调用模型。 + +需要凭据但尚未填写、或已经停用的连接不能在选择器中选用。可先编辑连接,或在「凭据保存」中保存、加载本机加密凭据。需要实测接口时,「验证响应(调用模型)」会发出请求并记录用量,区别于保存和切换操作。 + +默认选择用于后续运行。当前会话已有 Run 会保留当时封存的连接、请求型号、原响应和用量;切换默认不改写旧记录。模型池中的实际成员与上游报告型号请查看「请求账本」。请求的型号与上游报告的型号分别显示,名称本身不能认证底层模型权重。 + +「运行预算」可单独保存工具轮次、运行时间和 token 预算,保留所选连接或模型池。有效上下文与输出上限同时受连接自己的配置限制。有任务执行时,默认模型、添加连接与预算修改均锁定;服务端也拒绝其他会话的并发修改。 + +原单连接设置保留为「原模型连接 → 编辑 → 原连接与演示设置」。按钮明确标为「保存并切换原连接」,用于有意编辑并选用这条原连接。只调整运行预算时使用独立预算页。 + +其他标签页修改后,重新打开模型中心、点击刷新或返回窗口时会读取服务端当前选择。旧浏览器 URL 中的 `release` 参数只是历史链接参数,实际版本以左下角版本号为准。 diff --git a/docs/QA-MODEL-SELECTION-K.md b/docs/QA-MODEL-SELECTION-K.md new file mode 100644 index 00000000..6e3f4df7 --- /dev/null +++ b/docs/QA-MODEL-SELECTION-K.md @@ -0,0 +1,15 @@ +# 1.24.3:统一模型入口修复 + +用户反馈左下角只能设置一个固定模型,怀疑它覆盖了 Claude 连接。实际界面与源码确认:旧左下角打开原单连接设置,顶部虽然显示「高性能」池,旧窗口仍显示 legacy GPT;保存该窗口会调用 `/api/config` 并选回 legacy。这里存在入口与保存语义问题。 + +J 原真实样本仍明确发送到 api.apikey.fan,请求 `claude-opus-5-5`,上游 SSE 报告 `gpt-6.1-sol`。本次界面问题不能解释该原样本。J 原请求、响应、用量和身份拒绝结论保持,见 [原预检结果](LIVE-MODEL-IDENTITY-J-RESULTS.md)。本阶段不重新调用真实模型。 + +修复统一左下角、顶部和模型中心,提供已有连接/模型池选择器与添加模型入口。独立预算与演示模式接口不会隐式选择 legacy。原连接编辑成为明确次级入口,保存按钮说明切换后果。打开中心和窗口恢复前台时同步服务端默认;已有 Run 的封存身份单独显示。 + +已通过 30/30 相关后端与源码编译。新编译 UI 的七组流程覆盖添加、切换、刷新、独立预算、原连接取消、演示切回真实模型、其他标签页选择同步、长名称和 390px、活动锁定与服务端 409。自有 HTTP 路由证明选中连接收到它的请求地址、型号和所属凭据,legacy 没有收到选中线路的请求;切换默认保持旧 Run 原记录。所有接口为自有 localhost 夹具,真实配置模型请求 0。 + +开发验收中的失败另保留:Playwright 对实际带 `disabled` 的原生 option 仍报告 enabled,两次原失败截图/日志保留;改为检查原生 `disabled` 属性。历史模型中心验收用 `.mc-content select` 匹配新增默认选择器后变成两个元素,已精确定位「配置格式」;没有放宽产品禁用或多元素规则。 + +六类相关历史 UI 已全部通过:模型中心、协议/流式/配对停止、严格型号核对、主工作台、运行诊断和执行/预算续接。修正了这几处验收器的旧按钮与标签名称,协议验收仍使用旧「实际模型名称」导致的失败亦保留。路由夹具改为合法无工具响应后,三项新路由检查再次通过,明确原连接的独立请求能够完成。 + +独立发行重建、安装、正式部署及数据保留证据继续验收,最终结果在本报告续记。此时不能把源码通过写成已经上线。 diff --git a/findings.md b/findings.md index 299882be..59e89cfa 100644 --- a/findings.md +++ b/findings.md @@ -1,5 +1,11 @@ # 汇总发现 +## K:模型入口分裂的实际原因 + +实际内置浏览器左下角“模型连接”打开原设置,尽管顶部显示“高性能”,窗口仍展示 legacy jojocode/gpt-6.1-sol。App.saveSettings POST /config,服务端 hub.select({type:'legacy'}, config);所以保存原设置会隐式切回 legacy。ModelCenter 添加/选择能力已有但不是左下角入口。J原请求实际地址 api.apikey.fan、model claude-opus-5-5、指定 connectionId 与原响应均封存,不能把上游返回gpt现象归为原模型默认覆盖。设计对比:仅换按钮跳转能消除最明显分裂,但仍需多卡寻找;新增独立切换弹窗又形成多入口状态。选用统一模型中心顶部紧凑默认选择器+现有连接管理,保留原品牌/React栈,明确旧配置的作用。CUA旧连接browser.user错误经一次重建会话恢复;未修改正式配置。 + +新UI七组与六类相关历史UI实际通过;桌面/390px长名称和当前默认/旧Run信息均目视核对。两个独立localhost接口核对了实际发送地址、所属Key、请求model和原请求SHA;严格返回不一致先暂停,另选legacy有独立合法成功响应,旧Run保持。预算独立接口拒绝路由字段注入;活动期间UI锁定且其他会话API409。本轮未做真实上游调用,不将夹具结果解释为Claude/Purge实测收益。 + ## 当前 J:apikey 线路仍存在请求/返回身份差异 用户指定 apikey Claude 的独立新样本中,封存请求模型为 claude-opus-5-5,完整 SSE 为 gpt-6.1-sol;单次4307+27=4334报告tokens,严格门禁在工具执行前暂停。接口能回复唯一 nonce,但不能用于认证 Claude 能力或模型权重。已恢复原状态并独立核对全部原行和原70导出/3566工件;更正连接前不做工程/Purge。raw usage 额外包含 cache_write_tokens4304,离线验证器按三项规范化总量核对并单独核对原详细字段;初封存源码/清单保持,加法更正,不把缓存报告解释为收益。 diff --git a/package-lock.json b/package-lock.json index 0f180a44..eeb2b5b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "local-agent-workbench", - "version": "1.24.2", + "version": "1.24.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "local-agent-workbench", - "version": "1.24.2", + "version": "1.24.3", "dependencies": { "@babel/parser": "7.29.11", "@peculiar/x509": "3.1.0", diff --git a/package.json b/package.json index f23445ed..9dc23047 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "local-agent-workbench", - "version": "1.24.2", + "version": "1.24.3", "private": true, "type": "module", "description": "A local coding workbench with explicit tool execution, reviewable changes and recoverable sessions.", diff --git a/progress.md b/progress.md index 60a61ada..3c1b96e6 100644 --- a/progress.md +++ b/progress.md @@ -1,5 +1,11 @@ # 统一执行进度 +## K:模型入口核查与修复 + +用户要求查明左下角固定模型是否覆盖测试。已实际打开该窗口(未保存),复现旧单连接与顶部号池显示不一致;源码确认保存会选legacy。已建立fix/model-selection-entry-1.24.3,开始统一入口、直接选择和新建、模型默认与实际运行区分的集中修复。J原件保持,本轮真实请求0。 + +1.24.3实现已完成;30/30相关后端、最终构建、七组新编译UI与六类相关历史UI通过,三项路由夹具合法无工具响应补验通过。原生option两次误判、历史泛选择器、旧协议字段标签首失败保持,没有放宽产品规则。正式原生窗口已用Computer Use只读回看并关闭,原PID36552/Provider/hasKey=true/idle与windows=0核对;开始不可变发行和保留状态安装验收。 + ## 当前 J:单次真实身份预检结束 apikey 请求 claude-opus-5-5,上游标记 gpt-6.1-sol;1 请求/4334 报告 tokens/0 工具,系统以 model_identity 暂停。原 PID36552/Provider/凭据保持,70 原导出/3566 原工件及原表行核对完成;原池/参数恢复,公开修订与等价默认身份字段如实记录。30 份/190046 字节新证据离线通过;未启动工程或 Purge。首三次整表验收器失败和首次封存中离线脚本 raw usage 比较修正均追加保留,不重发真实请求。详见 docs/LIVE-MODEL-IDENTITY-J-RESULTS.md。 diff --git a/scripts/qa-evidence.mjs b/scripts/qa-evidence.mjs index 32451970..48c3b0db 100644 --- a/scripts/qa-evidence.mjs +++ b/scripts/qa-evidence.mjs @@ -21,6 +21,7 @@ const prefixes = Object.freeze({ '1.24.0': 'existing-results', '1.24.1': 'delivery-reliability', '1.24.2': 'delivery-integrity', + '1.24.3': 'model-selection', }); export function releaseEvidencePrefix(version) { const prefix = prefixes[version]; diff --git a/scripts/verify-all-ui.mjs b/scripts/verify-all-ui.mjs index b21b4699..ad5d171e 100644 --- a/scripts/verify-all-ui.mjs +++ b/scripts/verify-all-ui.mjs @@ -9,36 +9,36 @@ import { randomUUID } from 'node:crypto'; if (process.argv.slice(2).some(value => value !== '--help')) throw new Error('Unsupported argument; use --help.'); if (process.argv.includes('--help')) { console.log('node scripts/verify-all-ui.mjs - run serial desktop/390px checks in independent local hosts; use explicit QA Python/Harness/Purge source paths for 1.15.'); process.exit(0); } const version = JSON.parse(fs.readFileSync('package.json', 'utf8')).version; -assert.ok(['1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version), 'Review evidence paths when introducing the next release.'); +assert.ok(['1.6.0', '1.6.1', '1.6.2', '1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version), 'Review evidence paths when introducing the next release.'); const prefix = releaseEvidencePrefix(version), resultFile = `.qa/${prefix}-all-ui-validation.json`, results = []; const qaEnvironment = Object.fromEntries(['AGENT_WORKBENCH_TEST_PYTHON', 'AGENT_WORKBENCH_DEEPSEEK_ROOT', 'AGENT_WORKBENCH_PURGE_178_ROOT', 'AGENT_WORKBENCH_PURGE_181_ROOT'] .filter(name => process.env[name]).map(name => [name, process.env[name]])); for (const [name, value] of Object.entries(qaEnvironment)) assert.ok(path.isAbsolute(value) && fs.existsSync(value), 'Use an existing absolute QA runtime/source path: ' + name); const cases = [ - ...(['1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-file-results-ui.mjs', null]] : []), - ...(['1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-release-efficiency-ui.mjs', null]] : []), - ...(['1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-local-files.mjs', null]] : []), - ...(['1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version)?[['verify-embedded-browser.mjs',null]]:[]), - ...(['1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version)?[['verify-environment-ui.mjs',null],['verify-model-fidelity-ui.mjs',null],['verify-model-wait-ui.mjs',null],['verify-task-control-ui.mjs',null]]:[]), - ...(['1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-evaluations-ui.mjs', null]] : []), - ...(['1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-project-cache-ui.mjs', null]] : []), - ...(['1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-vision-ui.mjs', null]] : []), - ...(['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-model-protocols-ui.mjs', null]] : []), - ...(['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-companion-ui.mjs', null]] : []), - ...(['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-controlled-ui.mjs', null], ['verify-purge-ui.mjs', null]] : []), - ...(['1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-workers-ui.mjs', null]] : []), - ...(['1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-task-plans-ui.mjs', `docs/${prefix}-task-ui-validation.json`]] : []), - ...(['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-browser-ui.mjs', `docs/${prefix}-browser-ui-validation.json`]] : []), + ...(['1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-file-results-ui.mjs', null]] : []), + ...(['1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-release-efficiency-ui.mjs', null]] : []), + ...(['1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-local-files.mjs', null]] : []), + ...(['1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version)?[['verify-embedded-browser.mjs',null]]:[]), + ...(['1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version)?[['verify-environment-ui.mjs',null],['verify-model-fidelity-ui.mjs',null],['verify-model-wait-ui.mjs',null],['verify-task-control-ui.mjs',null]]:[]), + ...(['1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-evaluations-ui.mjs', null]] : []), + ...(['1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-project-cache-ui.mjs', null]] : []), + ...(['1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-vision-ui.mjs', null]] : []), + ...(['1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-model-protocols-ui.mjs', null]] : []), + ...(['1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-companion-ui.mjs', null]] : []), + ...(['1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-controlled-ui.mjs', null], ['verify-purge-ui.mjs', null]] : []), + ...(['1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-workers-ui.mjs', null]] : []), + ...(['1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-task-plans-ui.mjs', `docs/${prefix}-task-ui-validation.json`]] : []), + ...(['1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-browser-ui.mjs', `docs/${prefix}-browser-ui-validation.json`]] : []), ['verify-ui.mjs', '.qa/ui-validation.json'], ['verify-diagnostics-ui.mjs', '.qa/diagnostics-ui-validation.json'], ['verify-execution-ui.mjs', '.qa/execution-ui-validation.json'], ['verify-delivery-ui.mjs', '.qa/delivery-ui-validation.json'], ['verify-index-ui.mjs', '.qa/index-ui-result.json'], ['verify-change-sets-ui.mjs', `docs/${prefix}-batch-ui-validation.json`], ['verify-context-ui.mjs', `.qa/${version === '1.6.0' ? 'workspaces-context' : prefix}-ui-validation.json`], ['verify-workspaces-ui.mjs', `docs/${prefix === 'workspaces' ? prefix : prefix + '-workspaces'}-ui-validation.json`], - ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-python-ui.mjs', `docs/${prefix}-python-ui-validation.json`]] : []), - ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-react-delivery.mjs', version === '1.7.0' ? 'docs/react-engine-delivery-validation.json' : `docs/${prefix}-react-delivery-validation.json`]] : []), - ...(['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-research-ui.mjs', `docs/${prefix}-research-ui-validation.json`]] : []), - ...(['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? [['verify-engines-ui.mjs', version === '1.9.0' ? 'docs/engines-ui-validation.json' : `docs/${prefix}-engines-ui-validation.json`]] : []), - ...(['1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2'].includes(version) ? ['model-center', 'project-memory', 'task-checkpoints', 'skills', 'mcp', 'mcp-recovery'].map(name => [`verify-${name}-ui.mjs`, null]) : []), + ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-python-ui.mjs', `docs/${prefix}-python-ui-validation.json`]] : []), + ...(['1.7.0', '1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-react-delivery.mjs', version === '1.7.0' ? 'docs/react-engine-delivery-validation.json' : `docs/${prefix}-react-delivery-validation.json`]] : []), + ...(['1.8.0', '1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-research-ui.mjs', `docs/${prefix}-research-ui-validation.json`]] : []), + ...(['1.9.0', '1.10.0', '1.10.1', '1.11.0', '1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? [['verify-engines-ui.mjs', version === '1.9.0' ? 'docs/engines-ui-validation.json' : `docs/${prefix}-engines-ui-validation.json`]] : []), + ...(['1.12.0', '1.12.1', '1.13.0', '1.14.0', '1.15.0', '1.16.0', '1.17.0', '1.18.0', '1.19.0', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.23.0', '1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version) ? ['model-center', 'project-memory', 'task-checkpoints', 'skills', 'mcp', 'mcp-recovery'].map(name => [`verify-${name}-ui.mjs`, null]) : []), ]; fs.mkdirSync('.qa', { recursive: true }); const externalHost = new Set(['verify-ui.mjs', 'verify-diagnostics-ui.mjs', 'verify-execution-ui.mjs', 'verify-index-ui.mjs']); diff --git a/scripts/verify-desktop-install.mjs b/scripts/verify-desktop-install.mjs index 57d97df5..e92ba970 100644 --- a/scripts/verify-desktop-install.mjs +++ b/scripts/verify-desktop-install.mjs @@ -149,7 +149,7 @@ try { const beforeRestart = snapshotPersistentData(dataRoot); await controller.stop(); const restarted = (await controller.start()).identity; assert.notEqual(restarted.pid, original.pid); assert.deepEqual(snapshotPersistentData(dataRoot), beforeRestart); await controller.api('/model-center/probe', { method: 'POST', input: { id: connectionId } }); assert.equal(authenticated, 3); record(stage, { originalPid: original.pid, restartedPid: restarted.pid, authenticatedRequests: authenticated }); - if (['1.24.0', '1.24.1', '1.24.2'].includes(version)) { + if (['1.24.0', '1.24.1', '1.24.2', '1.24.3'].includes(version)) { stage = 'actual installed current results and saved HTML user paths'; const pointer = JSON.parse(fs.readFileSync(path.join(installRoot, 'current.json'))); const installedRoot = fs.realpathSync.native(path.join(installRoot, 'versions', pointer.active.directory)), proofs = []; diff --git a/scripts/verify-diagnostics-ui.mjs b/scripts/verify-diagnostics-ui.mjs index 78c36f86..4cd5da07 100644 --- a/scripts/verify-diagnostics-ui.mjs +++ b/scripts/verify-diagnostics-ui.mjs @@ -87,7 +87,11 @@ const task = async content => { await page.getByLabel('任务内容').fill(content); await page.getByRole('button', { name: '发送任务', exact: true }).click(); await page.waitForFunction(() => !!localStorage.getItem('awb-session')); sessionId = await page.evaluate(() => localStorage.getItem('awb-session')); }; -const settings = async () => { await page.getByRole('button', { name: '模型连接', exact: true }).click(); return page.getByRole('dialog', { name: '模型连接' }); }; +const settings = async () => { + await page.getByRole('button', { name: '选择与管理模型', exact: true }).click(); + await page.getByRole('dialog', { name: '模型中心', exact: true }).locator('.mc-connection').filter({ has: page.getByRole('heading', { name: '原模型连接', exact: true }) }).getByRole('button', { name: '编辑', exact: true }).click(); + return page.getByRole('dialog', { name: '原连接与演示设置', exact: true }); +}; try { page = await browser.newPage({ viewport: { width: 1440, height: 960 }, deviceScaleFactor: 1 }); page.setDefaultTimeout(15000); page.on('pageerror', error => pageErrors.push(error.message)); @@ -103,7 +107,7 @@ try { await connection.getByLabel('模型名称').fill('ui-diagnostics-fixture'); await connection.getByRole('button', { name: '验证模型响应', exact: true }).click(); await connection.getByText(/模型响应验证通过/).waitFor(); assert.equal((await api('/diagnostics')).connection.mode, 'demo'); - await connection.getByRole('button', { name: '保存连接', exact: true }).click(); await connection.waitFor({ state: 'hidden' }); + await connection.getByRole('button', { name: '保存并切换原连接', exact: true }).click(); await connection.waitFor({ state: 'hidden' }); mark('model response validation checks the tentative connection before saving'); requestCount = 0; await task('制造读取成功后的模型服务错误'); await waitState('failed'); diff --git a/scripts/verify-execution-ui.mjs b/scripts/verify-execution-ui.mjs index 9c706bcc..298d0ef7 100644 --- a/scripts/verify-execution-ui.mjs +++ b/scripts/verify-execution-ui.mjs @@ -108,11 +108,15 @@ try { await expect(page.locator('.session-list')).toContainText('断线期间的其他项目任务'); await page.getByLabel('当前项目').selectOption(project.id); expectedDisconnect = false; mark('reconnection synchronizes missed session changes in other projects'); - await page.getByRole('button', { name: '模型连接', exact: true }).click(); const settings = page.getByRole('dialog', { name: '模型连接' }); + const openLegacy = async () => { + await page.getByRole('button', { name: '选择与管理模型', exact: true }).click(); + await page.getByRole('dialog', { name: '模型中心', exact: true }).locator('.mc-connection').filter({ has: page.getByRole('heading', { name: '原模型连接', exact: true }) }).getByRole('button', { name: '编辑', exact: true }).click(); + }; + await openLegacy(); const settings = page.getByRole('dialog', { name: '原连接与演示设置', exact: true }); await settings.getByText('上下文与任务预算', { exact: true }).click(); await settings.getByLabel('单次运行token预算').fill('1000'); await settings.getByLabel('运行时间预算').fill('2'); await settings.getByLabel('任务累计token预算').fill('50000'); - await settings.getByRole('button', { name: '保存连接' }).click(); mode = 'budget'; await newTask('保留预算暂停的任务目标'); await waitState('paused'); + await settings.getByRole('button', { name: '保存并切换原连接' }).click(); mode = 'budget'; await newTask('保留预算暂停的任务目标'); await waitState('paused'); const original = await state(); assert.equal(original.execution.run.stopReason, 'token_limit'); assert.equal(original.approvals.length, 0); - await page.getByRole('button', { name: '模型连接', exact: true }).click(); await settings.getByText('上下文与任务预算', { exact: true }).click(); await settings.getByLabel('单次运行token预算').fill('16000'); await settings.getByRole('button', { name: '保存连接' }).click(); + await openLegacy(); await settings.getByText('上下文与任务预算', { exact: true }).click(); await settings.getByLabel('单次运行token预算').fill('16000'); await settings.getByRole('button', { name: '保存并切换原连接' }).click(); mode = 'answer'; await page.getByRole('button', { name: '继续任务', exact: true }).click(); await waitState('completed'); const resumed = await state(); assert.equal(resumed.execution.task.id, original.execution.task.id); assert.equal(resumed.execution.runs.length, 2); await page.getByRole('button', { name: '查看任务记录' }).click(); await taskPanel().getByLabel('选择运行记录').selectOption(original.execution.run.id); diff --git a/scripts/verify-model-center-ui.mjs b/scripts/verify-model-center-ui.mjs index 987d9515..80ce2af8 100644 --- a/scripts/verify-model-center-ui.mjs +++ b/scripts/verify-model-center-ui.mjs @@ -60,7 +60,7 @@ try { await dialog.getByRole('button', { name: '配置导入', exact: true }).click(); await expect(dialog.locator('.mc-tabs button[aria-current]')).toContainText('配置导入'); - await dialog.locator('.mc-content select').selectOption('workbench-json'); + await dialog.getByLabel('配置格式').selectOption('workbench-json'); await dialog.getByLabel('本地文件路径', { exact: true }).fill(importFile); await dialog.getByRole('button', { name: '预览可导入连接', exact: true }).click(); await expect(dialog.locator('.mc-editor').filter({ hasText: '本次预览' })).toContainText('Imported Fixture'); diff --git a/scripts/verify-model-protocols-ui.mjs b/scripts/verify-model-protocols-ui.mjs index d9259f77..96e9b5da 100644 --- a/scripts/verify-model-protocols-ui.mjs +++ b/scripts/verify-model-protocols-ui.mjs @@ -66,7 +66,7 @@ try { await expect(form.getByLabel('使用流式输出', { exact: true })).toBeDisabled(); await form.getByLabel('流式能力', { exact: true }).selectOption('supported'); await form.getByLabel('使用流式输出', { exact: true }).check(); await form.getByLabel('接口根地址', { exact: true }).fill('http://127.0.0.1:' + modelServer.address().port + '/v1'); - await form.getByLabel('实际模型名称', { exact: true }).fill('owned-responses'); await form.getByLabel('服务需要 API Key', { exact: true }).uncheck(); + await form.getByLabel('请求模型名称', { exact: true }).fill('owned-responses'); await form.getByLabel('服务需要 API Key', { exact: true }).uncheck(); await shot(page, 'desktop-editor'); await page.setViewportSize({ width: 390, height: 844 }); await form.scrollIntoViewIfNeeded(); await shot(page, 'narrow-editor'); await form.getByRole('button', { name: '保存模型连接', exact: true }).click(); await expect(form).toHaveCount(0); await page.reload(); await page.getByRole('button', { name: '打开模型中心', exact: true }).click(); diff --git a/scripts/verify-model-selection-ui.mjs b/scripts/verify-model-selection-ui.mjs new file mode 100644 index 00000000..d51b54bb --- /dev/null +++ b/scripts/verify-model-selection-ui.mjs @@ -0,0 +1,149 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import http from 'node:http'; +import assert from 'node:assert/strict'; +import { createHash, randomUUID } from 'node:crypto'; +import { chromium, expect } from 'playwright/test'; +import { fixture, launchWorkbench, until } from '../tests/helpers.mjs'; +import { Provider } from '../src/server/provider.mjs'; + +if (process.argv.includes('--help')) { console.log('node scripts/verify-model-selection-ui.mjs [--app-root ABS] — isolated compiled UI, two owned HTTP routes, add/switch/budget/reload/demo/locking at desktop and 390px; no configured-model calls'); process.exit(0); } +const args = process.argv.slice(2); +assert.ok(!args.length || args.length === 2 && args[0] === '--app-root' && path.isAbsolute(args[1])); +const appRoot = args[1] ?? process.cwd(); +const directory = path.resolve('.qa/model-selection-k-' + randomUUID()); fs.mkdirSync(directory, { recursive: true }); +const disposers = [], t = { after: fn => disposers.push(fn) }, f = fixture(t), requests = []; +let release, block = false; +const upstream = http.createServer(async (req, res) => { + const chunks = []; for await (const chunk of req) chunks.push(chunk); + const body = JSON.parse(Buffer.concat(chunks)); requests.push({ url: req.url, body }); + if (block) await new Promise(resolve => { release = resolve; }); + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end(JSON.stringify({ model: body.model, choices: [{ message: { role: 'assistant', content: 'Owned route receipt.' } }], + usage: { prompt_tokens: 13, completion_tokens: 7, total_tokens: 20 } })); +}); +await new Promise(resolve => upstream.listen(0, '127.0.0.1', resolve)); +const endpoint = 'http://127.0.0.1:' + upstream.address().port; +f.store.saveConfig({ mode: 'compatible', baseUrl: endpoint + '/legacy/v1', model: 'owned-legacy-gpt', maxSteps: 1 }); +const provider = new Provider(), hub = provider.modelHub(f.store); +const selected = hub.upsert({ name: 'Claude · 自有接口', model: 'owned-claude', baseUrl: endpoint + '/selected/v1', requiresKey: false, modelIdentityPolicy: 'require-match' }); +const noKey = hub.upsert({ name: '待填凭据', model: 'no-credential', baseUrl: endpoint + '/no-key/v1' }); +const pool = hub.pool({ name: '工程模型池', members: [{ connectionId: selected.id, weight: 1 }], strategy: 'round-robin', sticky: true, maxAttempts: 1, queueTimeoutMs: 1000 }); +hub.select({ type: 'pool', id: pool.id }); f.store.close(); +const nodePath = fs.existsSync(path.join(appRoot, 'runtime/node.exe')) ? path.join(appRoot, 'runtime/node.exe') : process.execPath; +const host = await launchWorkbench(t, f.data, {}, { appRoot, nodePath }); +assert.notEqual(new URL(host.url).port, '4318'); +let browser, page, result; const checks = [], screenshots = [], errors = []; +const mark = name => { checks.push(name); console.log('PASS ' + name); }; +const capture = async name => { const file = path.join(directory, name + '.png'); await page.screenshot({ path: file }); screenshots.push({ path: file, sha256: createHash('sha256').update(fs.readFileSync(file)).digest('hex') }); }; +const dialog = () => page.getByRole('dialog', { name: '模型中心', exact: true }); +const select = () => dialog().getByLabel('新任务默认模型', { exact: true }); +const close = () => dialog().getByRole('button', { name: '关闭窗口', exact: true }).click(); +try { + browser = await chromium.launch({ channel: 'msedge', headless: true }); page = await browser.newPage({ viewport: { width: 1440, height: 1000 } }); + page.on('pageerror', error => errors.push(error.message)); + await page.goto(host.url); await page.waitForLoadState('networkidle'); await page.getByLabel('当前项目').selectOption(f.project.id); + await page.getByRole('button', { name: '选择与管理模型', exact: true }).click(); + await expect(dialog()).toBeVisible(); await expect(select()).toHaveValue('pool:' + pool.id); + // This Playwright build reports disabled