diff --git a/AGENTS.md b/AGENTS.md index dc69a9d4..50abafaf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,5 +1,7 @@ # Agent Workbench项目执行规范 +1.25.5最终补漏已合回并验证:build-16、相关72/72、worker停止/未发请求/超额四边界4/4、网页10组与实际Electron11组均通过;新等待0不限及长时限、开放目录122选择/121自动成员、4MB以上原目录、完整网络历史/DNS、20 Chat工具/129 Messages块已核对。976项完整源码原轮958通过18失败保持,低负载精确补验与失败根因见QA,不冒称原轮全绿。现在冻结实现准备独立不可变发行/ZIP重建/实际安装,随后正式升级、保存full/open并实际重启;正式仍1.25.4,不能称已部署。真实供应商请求0;旧网络/重复读取/真实自主交付/预留边界/Purge未知保持。不委派/推送/触真实Key、不续跑用户项目。 + 当前接续1.25.5默认透传/三操作权限/自动Git与回滚。用户最新要求覆盖下方历史固定额度、每项审查和不重启默认:新安装不设本地上下文/输出/累计/轮数/等待额度,首次ask,用户选择持久保存;正式用户偏好full,已授权实际重启。权限45/45、网页7组/实际Electron8组与扩大回归补验已过;最新实际原生SDK4组/6本机模型请求、33文件大于2MB无检查worker自动父合并、多图9张及同Task续接第10张补验通过,首失败/中断全部保留。当前完成新UI复核后冻结本地实现,完整源码/不可变发行/安装/正式升级重启仍待完成,不能称已部署。正式仍1.25.4;不委派/推送,不读取/复制/解密/重存真实Key。重启会丢失未持久保存的内存Key,只公开核对hasKey。自主交付/网络间歇/普遍重复读取/真实预留边界/Purge收益未知保持,不续跑历史或用户原项目。见docs/QA-OPEN-PERMISSIONS-1.25.5.md。 1.25.5补验发现并修复混合池和16K小源码正文丢失:共同输入按成员自身context/output配对,累计仍预留最大输出;仅包装超预算时用latest反馈v4保留完整小读取原文,常规v3和旧历史投影不改。原16K/2048/90000两响应回放最终11998/12352保留三源码/目标/六工具事实,分页按1536状态增长预留和真实字节核算,短分页不再当完整小文件优先保留;四关键边界4/4、池原证据2/2通过,不靠放宽预算。相关回归与独立发行仍在进行。用户已在模型中心补好三条Key,仅公开hasKey核对,当前选择legacy-default保持;正式仍1.25.4/PID55352/instance029df044,后续升级保留这个新Provider。首全量中断、两轮修复回归失败和不完整候选都保留;真实推理0,自主交付/网络/重复读取/真实预留/Purge未知保持,不续跑原项目、不委派/推送、不触Key。 diff --git a/docs/QA-OPEN-PERMISSIONS-1.25.5.md b/docs/QA-OPEN-PERMISSIONS-1.25.5.md index 9b1a53d7..6d5b88d3 100644 --- a/docs/QA-OPEN-PERMISSIONS-1.25.5.md +++ b/docs/QA-OPEN-PERMISSIONS-1.25.5.md @@ -71,3 +71,19 @@ 完整源码第2轮在修改产品源码前主动取消:169顶层通过标记、无断言失败,结束时两个正在运行的测试文件被取消进程产生✖文件标记,不是已完成整轮。open-full-source-2-cancellation.json保存所属PID/创建时间/树;初次取消驱动空子列表循环也保留,已停止该驱动后用有界遍历只终止所属3个测试进程,未停止正式机。重新冻结后跑第3轮。 实际安装验收增加新权限/多图网页8组与Electron9组,既有界面检查继续保留。正式仍未升级。 + +## 最终完整回归与实际补漏 + +完整源码第3轮实际来源c93c4348:976项958通过18失败、0取消/跳过,耗时约63分钟。原`.qa/open-full-source-3.log`与receipt保持,不能将后续补验倒写成原轮全绿。 + +18项包含:历史engine owner缺model;混合协议池与截断恢复的等待;运行设置和0不限的过时断言;6项网络诊断0期限被当成立即超时;4项旧输出上限诊断文案;完整前缀测试仍用默认透传断言有限窗口;HTTP evaluations等待;worker旧夹具发送前预算不足。最后两项单独低负载诊断保留在`open-idle-failures-diagnostic-1.log`:评测原20秒等待16.7秒内通过,worker继续失败。 + +worker补充诊断`open-worker-accounting-diagnostic.json`证实2个子任务均在token_limit发送前停止,0请求/0用量,没有漏记计费。旧每子10,000额度已容纳不下增长后的完整工具契约。测试改为每子20,000、真实夹具响应20,001,保留超额1 token、0工具/改动、续接不重置断言,并新增必须发出2请求;独立副本1/1通过。此处只修显式restricted测试,不恢复默认额度。 + +独立副本27文件按主源码before SHA合回,清单`.qa/open-final-draft-merged.json`逐项保存实际after SHA。补漏包括:0等待不设timer、长等待分段避免Node溢出;开放网络完整DNS/历史与主动取消;开放GET等待和目录策略继承;4MB以上目录、长型号、95参数、121自动成员及小容量声明;Chat20完整工具、Messages129内容块;旧engine owner继续核对原有限契约。旧非法索引、格式完整性、取消和来源检查保持。4项实际本机边界通过,所有真实供应商请求仍为0。 + +主源码build-16及8文件相关回归72/72通过。最终网页10组通过(`open-web-f34d2c8c-9d43-43bb-95d3-b0dc6f1dc453`),包含等待0及旧上限外设置保存刷新、122目录选择/自动适配、真实TCP不限诊断、三权限持久化/在途切换、原错误下载、自动写入/回滚和9图。1440权限与390诊断截图已实际回看,窄屏无页面横向溢出。首副本Electron因依赖junction越出所属目录被正确拒绝,改在主依赖/正式候选上验收,未放宽产品路径核验。 + +主源码最终实际Electron11组全部通过(`open-electron-e7cb1fe9-2c1e-4b36-a0d4-b7b7211f1073`),含完整长DOM/133控件、密码/select输入及跨来源导航,不需要手动批准;原生回看第二来源及390目录122已选截图。网页7/Electron13次均为自有本机HTTP模型夹具请求,未使用真实Key。worker停止后迟到用量、请求中断未知、发送前超时0用量及真实超额响应记账四边界4/4通过,`open-final-worker-boundaries-1.log`。 + +本阶段回顾:第三遍行为复核揭示0值在定时器/诊断/前端的跨层含义未完全同步,已按实际调用链修复并验证。旧测试只有在仍检验原有事实时才更正默认/文案与容量;worker补充必须真实派发的断言,避免将发送前停止误作记账证明。未改写976项原失败或历史16K/2048数据。下一不可变发行与真实安装,不继续扩大功能范围。 diff --git a/findings.md b/findings.md index ef78e4f6..910a01c7 100644 --- a/findings.md +++ b/findings.md @@ -1270,6 +1270,12 @@ V调用前检查:新增11文件SHA断言首语法检查发现多一个右括 ## 开放权限:跨层null语义与真实完成状态 +最终976项回归原轮958通过18失败,完整终态保留。低负载补验HTTP evaluations在16.7秒通过,原20秒等待未放宽。worker原10,000/子额度在发送前token_limit、0个context_plan、两个worker0请求0用量,明确不是漏记计费;测试改为20,000/子且响应20,001,保留超额1 token、无工具/改动、续接不重置等断言,新增必须真的发出2请求,独立副本通过。此调整只涉及显式restricted历史测试,不恢复默认额度。 + +主源码网页10组全部通过(open-web-f34d2c8c):实际回看1440权限与390连接诊断截图。权限位于输入框上方并自动保存,三栏原工作台品牌保持;窄屏诊断表按列换行、无页面横向溢出,0期限显示不限、IPv6缺失明确未检查。目录122选项/自动适配及真实TCP无模型检查、原错误下载、自动文件落地与回滚、多图流程均有原收据;本轮网页7个本机模型夹具请求、2目录GET、0真实供应商请求。 + +独立副本的27份明确修复已按主c93c4348原SHA逐项核对后合回;没有复制副本依赖junction、构建或历史原件。主源码build-16通过,最终相关补验与网页10/Electron11路径进行中。用户附件为三权限选择示例,已核对ask/auto/full文字及持久使用要求;原生专用鼠标键盘工具未新增,不夸大电脑控制覆盖。 + 原生SDK要求正整数defaultMaxTokens,需使用内部规划哨兵并在桥/HTTP省略输出上限;任何有限输入比较必须先判断inputBudget非null。父合并不能在自动应用前暴露最终merge_prepared,否则客户端会把半途状态当完成。多图的数量策略在上传/选择/Store绑定三个入口各有独立校验,需要一起修复;同Task续接须追加原附件ID而非替换。浏览器读取不增加文件页覆盖,不能机械扣源文件页状态预留。以上均由实际失败定位并保留。 ## 续接策略必须覆盖当前Task的后续额度 diff --git a/progress.md b/progress.md index ec82b52a..4b303936 100644 --- a/progress.md +++ b/progress.md @@ -1901,3 +1901,11 @@ Y阶段结束:预检110tokens通过;Node8请求64500tokens全部matched, ## 旧Task续接的额度遗留修正 2fa22073提交后第三遍检查复现:开放新Run仍被旧Task累计额度阻止。新Run采用当前开放策略时只更新后续Task额度为0,旧Run和原消费保持,实际本机HTTP专项通过。原完整源码第2轮因修改前取消保留169通过与两个终止文件标记,不作整轮通过。网页8/Electron9最终通过并回看;4轮SDK645份21197319字节全保留。增加安装副本的8/9权限检查,下一重建/提交后完整源码第3轮。 + +## 开放权限最终补漏与发行接续 + +完整源码第3轮实际来源c93c4348,976项958通过18失败、0取消/跳过,原日志与收据保持。独立修复副本open-final-draft-1补齐等待0不限、长时限分段定时器、网络诊断0不限/完整历史、目录策略继承与大目录、工具流数量、旧engine owner兼容;4项实际本机边界通过,网页10组通过,Electron副本因依赖junction超出所属目录拒绝,必须合回后用真实主依赖验收,不放宽路径核验。 + +低负载精确诊断97770已结束:HTTP evaluations通过;worker累计预算测试仍失败。新增不改主源码的只读诊断确认两个worker均0请求/0用量,不能记作账本漏记,继续定位发送前停止原因。原失败、旧不完整候选和主动取消收据均保留;正式仍1.25.4,尚无升级/重启或真实供应商请求。 + +最终主源码build-16、相关72/72、worker四边界4/4、网页10组和实际Electron11组全部通过并回看。worker旧10,000/子不足发送,改20,000/子、20,001实际回执继续检验超额1 token且无副作用,新增实际两请求断言。27修复文件按before SHA合回、diff逐项回顾;准备本地提交冻结,另制不可变候选。上一次工具只读工作目录少字被拒绝,已用真实目录更正,没有产品或正式写入。 diff --git a/scripts/verify-browser.mjs b/scripts/verify-browser.mjs index a6e47d17..6e85fd55 100644 --- a/scripts/verify-browser.mjs +++ b/scripts/verify-browser.mjs @@ -15,6 +15,7 @@ async function until(predicate, timeout = 20000) { } export async function verifyBrowserApi({ api, url, token, directory, appRoot, contained = false }) { + const open = (await api('/bootstrap')).config.executionMode === 'unrestricted'; const projectRoot = path.join(directory, 'browser-project'); fs.mkdirSync(path.join(projectRoot, 'dist'), { recursive: true }); fs.writeFileSync(path.join(projectRoot, 'README.md'), '# Owned portable browser acceptance\n'); fs.writeFileSync(path.join(projectRoot, 'dist', 'index.html'), '随包页面验收' @@ -27,8 +28,12 @@ export async function verifyBrowserApi({ api, url, token, directory, appRoot, co await until(async () => { current = await api(route); return current.status === 'awaiting_approval'; }); const approval = current.approvals.find(value => value.status === 'pending'); assert.equal(approval.command, 'node --version'); await api(route + '/approvals/' + approval.id, { allow: true }); - await until(async () => { current = await api(route); return current.status === 'needs_review'; }); + await until(async () => { current = await api(route); return current.status === (open ? 'completed' : 'needs_review'); }); for (const change of current.changes.filter(value => value.status === 'pending')) await api(route + '/changes/' + change.id + '/reject', {}); + if (open) { + assert.ok(current.changes.some(value => value.status === 'applied')); + for (const change of current.changes.filter(value => value.status === 'applied')) await api(route + '/changes/' + change.id + '/rollback', {}); + } const taskId = (await api(route)).execution.task.id, availability = (await api(route + '/browser')).availability; assert.equal(availability.status, 'available', availability.message); assert.equal(availability.playwrightVersion, '1.64.1'); const steps = [{ action: 'fill', selector: '#query', value: '本地页面验收' }, { action: 'select', selector: '#filter', value: 'pending' }, diff --git a/scripts/verify-desktop-install.mjs b/scripts/verify-desktop-install.mjs index ddaa39cd..122b44a9 100644 --- a/scripts/verify-desktop-install.mjs +++ b/scripts/verify-desktop-install.mjs @@ -158,7 +158,7 @@ try { ...(['1.24.9', '1.25.0', '1.25.1', '1.25.2', '1.25.3', '1.25.5'].includes(version) ? [['verify-requirements-ui.mjs', [], 7], ['verify-requirements-desktop.mjs', [], 3], ['verify-turn-progress-ui.mjs', [], 9], ['verify-turn-progress-ui.mjs', ['--desktop'], 9]] : []), ...(['1.25.0', '1.25.1', '1.25.2', '1.25.3', '1.25.5'].includes(version) ? [['verify-task-agreement-ui.mjs', [], 6], ['verify-task-agreement-ui.mjs', ['--desktop'], 6], ['verify-task-follow-up-ui.mjs', [], 5], ['verify-task-follow-up-ui.mjs', ['--desktop'], 5]] : []), ...(['1.25.3', '1.25.5'].includes(version) ? [['verify-reasoning-settings-ui.mjs', [], 6], ['verify-reasoning-settings-ui.mjs', ['--desktop'], 6], ['verify-model-catalog-ui.mjs', [], 8], ['verify-model-catalog-ui.mjs', ['--desktop'], 8]] : []), - ...(version === '1.25.5' ? [['verify-model-capacity-ui.mjs', [], 3], ['verify-model-capacity-ui.mjs', ['--desktop'], 3], ['verify-unrestricted-ui.mjs', [], 8], ['verify-unrestricted-ui.mjs', ['--desktop'], 9]] : []), + ...(version === '1.25.5' ? [['verify-model-capacity-ui.mjs', [], 3], ['verify-model-capacity-ui.mjs', ['--desktop'], 3], ['verify-unrestricted-ui.mjs', [], 10], ['verify-unrestricted-ui.mjs', ['--desktop'], 11]] : []), ]; for (const [script, args, expected] of suites) { const output = await run(process.execPath, [path.join(appRoot, 'scripts', script), ...args], { cwd: appRoot, diff --git a/scripts/verify-release.mjs b/scripts/verify-release.mjs index ca37c57e..b138f5ea 100644 --- a/scripts/verify-release.mjs +++ b/scripts/verify-release.mjs @@ -100,7 +100,7 @@ try { let current; await until(async () => { current = await api('/sessions/' + session.id); return current.status === 'awaiting_approval'; }); assert.equal(current.approvals[0].command, 'node --version'); - assert.equal(fs.existsSync(path.join(example.root, 'WORKBENCH-NOTES.md')), false); + assert.equal(fs.existsSync(path.join(example.root, 'WORKBENCH-NOTES.md')), bootstrap.config.executionMode === 'unrestricted'); await api('/sessions/' + session.id + '/approvals/' + current.approvals[0].id, { allow: true }); await until(async () => { current = await api('/sessions/' + session.id); return current.status === 'completed'; }); const command = current.events.find(event => event.tool === 'run_command'); diff --git a/scripts/verify-unrestricted-ui.mjs b/scripts/verify-unrestricted-ui.mjs index 915ff9c4..9afb23e4 100644 --- a/scripts/verify-unrestricted-ui.mjs +++ b/scripts/verify-unrestricted-ui.mjs @@ -55,7 +55,7 @@ try { } return completion([], 'Owned full browser flow complete.'); }; - const model = await compatibleFixture(t, (url, body) => ownedFailure ? { status: 429, body: { error: { code: 'owned_rate', type: 'owned_original', message: 'UI-UPSTREAM-ORIGINAL', detail: '原始上游正文'.repeat(6000) } }, headers: { 'x-request-id': 'owned-ui-error-id' } } : url.endsWith('/models') ? { data: [{ id: 'owned-capacity', context_length: 131072, max_output_tokens: 32768, capabilities: { text: true, tools: true } }] } + const model = await compatibleFixture(t, (url, body) => ownedFailure ? { status: 429, body: { error: { code: 'owned_rate', type: 'owned_original', message: 'UI-UPSTREAM-ORIGINAL', detail: '原始上游正文'.repeat(6000) } }, headers: { 'x-request-id': 'owned-ui-error-id' } } : url.endsWith('/models') ? { data: [{ id: 'owned-capacity', context_length: 131072, max_output_tokens: 32768, capabilities: { text: true, tools: true } }, ...Array.from({ length: 121 }, (_, index) => ({ id: 'owned-bulk-' + index, capabilities: { text: true, tools: true } }))] } : body.messages.some(row => row.role === 'user' && row.content.includes('FULL-BROWSER-FLOW')) ? browserReply(body) : body.messages.some(row => row.role === 'user' && row.content.includes('PERMISSION-FLOW')) ? completion(body.messages.some(row => row.role === 'tool') ? [] : [call('owned-permission', 'run_command', { command: process.platform === 'win32' ? 'Write-Output "OWNED-PERMISSION-MARKER"' : 'printf OWNED-PERMISSION-MARKER', reason: 'Verify permission switching in the actual UI.' })], 'Permission flow complete.') : body.messages.some(row => row.role === 'user' && row.content.includes('AUTO-WRITE-FLOW')) ? completion(body.messages.some(row => row.role === 'tool') ? [] : [call('owned-write', 'propose_file', { path: 'ui-auto.txt', content: 'OWNED-APPLIED\n', reason: 'Verify automatic writes and exact rollback.' })], 'File flow complete.') @@ -112,6 +112,50 @@ try { await expect(budgets().getByLabel('额度策略', { exact: true })).toHaveValue('unrestricted'); for (const width of [1440,390]) { await resize(width); assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)); await shot('open-settings-' + width); } mark('open defaults save as real zeros, survive reload, hide local quotas and retain model selection at 1440 and 390 pixels'); + await resize(1440); await dialog().getByRole('button', { name: '等待时限', exact: true }).click(); + const waits = () => dialog().getByRole('form', { name: '模型等待时限', exact: true }); + await expect(waits().getByLabel('单次模型响应上限(秒)', { exact: true })).toHaveValue('0'); + await expect(waits().getByLabel('流式无数据上限(秒)', { exact: true })).toHaveValue('0'); + await waits().getByLabel('单次模型响应上限(秒)', { exact: true }).fill('960'); + await waits().getByLabel('流式无数据上限(秒)', { exact: true }).fill('901'); + await waits().getByRole('button', { name: '保存等待时限', exact: true }).click(); + await expect(dialog().getByRole('status').filter({ hasText: '等待时限已保存' })).toBeVisible(); + await page.reload(); await open(); await dialog().getByRole('button', { name: '等待时限', exact: true }).click(); + await expect(waits().getByLabel('单次模型响应上限(秒)', { exact: true })).toHaveValue('960'); + await expect(waits().getByLabel('流式无数据上限(秒)', { exact: true })).toHaveValue('901'); + for (const label of ['单次模型响应上限(秒)', '流式无数据上限(秒)']) await waits().getByLabel(label, { exact: true }).fill('0'); + await waits().getByRole('button', { name: '保存等待时限', exact: true }).click(); + await expect(dialog().getByRole('status').filter({ hasText: '等待时限已保存' })).toBeVisible(); + assert.deepEqual((await host.api('/model-center')).waitSettings, { modelResponseTimeoutMs: 0, modelStreamIdleTimeoutMs: 0 }); + for (const width of [1440,390]) { await resize(width); await shot('unlimited-waits-' + width); } + mark('wait settings accept zero and values beyond old ceilings, persist after reload and restore unlimited waits'); + await resize(1440); await dialog().getByRole('button', { name: '模型连接', exact: true }).click(); + await dialog().getByRole('button', { name: '从上游添加模型', exact: true }).click(); + const catalog = () => dialog().getByRole('region', { name: '上游模型目录', exact: true }); + await catalog().getByLabel('目录上游连接', { exact: true }).selectOption(source.id); + await catalog().getByRole('button', { name: '获取上游模型', exact: true }).click(); + await expect(catalog().getByLabel('上游模型列表', { exact: true }).getByRole('checkbox')).toHaveCount(122); + await catalog().getByRole('button', { name: '选中当前筛选', exact: true }).click(); + await catalog().getByLabel('模型使用方式', { exact: true }).selectOption('auto'); + await expect(catalog().getByRole('button', { name: '保存所选 122 个模型', exact: true })).toBeEnabled(); + await expect(catalog()).toContainText('目录、连接和自动池不设本地数量上限'); + for (const width of [1440,390]) { await resize(width); await shot('open-model-selection-' + width); } + await catalog().getByRole('button', { name: '关闭目录', exact: true }).click(); + assert.deepEqual((await host.api('/model-center')).selected, originalSelection); + await dialog().getByRole('navigation', { name: '模型中心分类', exact: true }).getByRole('button', { name: '连接诊断', exact: true }).click(); + const network = () => dialog().getByRole('region', { name: '模型连接诊断', exact: true }); + await network().getByLabel('诊断连接', { exact: true }).selectOption(source.id); + await network().getByRole('button', { name: '开始直连检查', exact: true }).click(); + await expect(network().getByRole('status')).toHaveText('直连握手通过'); + await expect(network()).toContainText('保留全部检查记录'); + await network().locator('details summary').click(); + await expect(network().getByText('不限 / 不限', { exact: true })).toBeVisible(); + const diagnostic = (await host.api('/model-center/network-diagnostics')).jobs[0]; + assert.equal(diagnostic.status, 'passed'); assert.equal(diagnostic.budgetMs, 0); assert.equal(diagnostic.stageTimeoutMs, 0); + assert.equal(diagnostic.httpRequests, 0); assert.equal(diagnostic.modelRequests, 0); + for (const width of [1440,390]) { await resize(width); await shot('open-network-diagnostic-' + width); } + mark('catalog UI selects 122 models and enables automatic routing; actual TCP diagnostics show unlimited waits and complete history'); + await resize(1440); await dialog().getByRole('button', { name: '运行预算', exact: true }).click(); await budgets().getByLabel('额度策略', { exact: true }).selectOption('restricted'); await budgets().getByLabel('容量策略', { exact: true }).selectOption('manual'); await budgets().getByLabel('输出上限', { exact: true }).fill('32768'); @@ -184,7 +228,7 @@ try { } assert.deepEqual(errors, []); assert.equal(model.requests.filter(row => row.input).length, desktop ? 13 : 7); - result={success:true,version:host.bootstrap.version,appRoot,actualElectron:desktop,checks,screenshots,errors,realModelRequests:0,ownedModelRequests:desktop ? 13 : 7,directoryGets:1,officialServiceTouched:false}; + result={success:true,version:host.bootstrap.version,appRoot,actualElectron:desktop,checks,screenshots,errors,realModelRequests:0,ownedModelRequests:desktop ? 13 : 7,directoryGets:model.requests.filter(row => !row.input).length,officialServiceTouched:false}; } catch(error) {if(page)await shot('failure').catch(()=>{});result={success:false,appRoot,actualElectron:desktop,checks,screenshots,errors,error:error.stack,realModelRequests:0};} finally {if(application)await application.close();if(browser)await browser.close();if(controller&&await controller.health())await controller.stop();await host?.close?.();for(const dispose of disposers.reverse())await dispose();fs.writeFileSync(path.join(directory,'result.json'),JSON.stringify(result,null,2));} console.log(JSON.stringify({directory,...result}));if(!result.success)process.exitCode=1; diff --git a/src/client/ModelCatalog.tsx b/src/client/ModelCatalog.tsx index 60ec7030..303c5810 100644 --- a/src/client/ModelCatalog.tsx +++ b/src/client/ModelCatalog.tsx @@ -57,7 +57,9 @@ export function ModelCatalog({ sources, sourceId = '', busy, onSaved, onClose }: finally { if (live.current) setSaving(false); } } const visible = preview?.entries.filter(value => (value.id + ' ' + value.name + ' ' + value.owner).toLowerCase().includes(query.trim().toLowerCase())) ?? []; - const selectable = visible.filter(value => value.lifecycle !== 'retired'); + const open = preview?.limits.connections === null; + const selectionLimit = preview?.limits.connections ?? Infinity, poolLimit = preview?.limits.poolMembers ?? Infinity; + const selectable = visible.filter(value => open || value.lifecycle !== 'retired'); return

从上游选择模型

获取目录,勾选要用的型号,再决定手动指定或自动适配。

@@ -86,11 +88,11 @@ export function ModelCatalog({ sources, sourceId = '', busy, onSaved, onClose }: {preview && <>
显示 {visible.length} / {preview.entries.length} · 已选 {chosen.length}
{preview.warning &&

{preview.warning}

} -

以下为上游目录声明,尚未经过模型调用验证。目录最多1000项,本机最多100个模型连接;单个自动池最多32个成员。

-
+

以下为上游目录声明,尚未经过模型调用验证。{open ? '可选择上游返回的型号,目录、连接和自动池不设本地数量上限。' : `目录最多${preview.limits.catalog}项,本机最多${selectionLimit}个模型连接;单个自动池最多${poolLimit}个成员。`}

+
{visible.map(value => )}{!visible.length &&

{preview.entries.length ? '没有匹配的型号。可更改搜索条件。' : '上游返回了空目录。可核对连接或使用手动兼容入口。'}

} @@ -99,7 +101,7 @@ export function ModelCatalog({ sources, sourceId = '', busy, onSaved, onClose }:
{routing === 'manual' && }
{routing === 'auto' &&

自动适配复用模型池,按任务所需能力、连接健康和可用并发筛选,再按轮询分配;同一运行优先保持型号。未确认能力的型号不会用于需要该能力的任务。

} -
+
}
; } diff --git a/src/client/ModelNetworkDiagnostics.tsx b/src/client/ModelNetworkDiagnostics.tsx index 8981959e..953d2a6b 100644 --- a/src/client/ModelNetworkDiagnostics.tsx +++ b/src/client/ModelNetworkDiagnostics.tsx @@ -7,11 +7,11 @@ type Connection = { id: string; name: string; baseUrl: string; revision: number type Trial = { mode: string; status: string; stage: string; address?: string; family?: string; code?: string; tcpMs?: number; tlsMs?: number; tls?: string; tlsProtocol?: string; certificateAuthorized?: boolean; attempts: { address: string; code?: string }[] }; type Job = { id: string; connectionId: string; connectionRevision: number; connectionName: string; status: string; startedAt: string; finishedAt: string | null; - stale: boolean; code?: string; elapsedMs: number; budgetMs: number; target: { endpoint: string; host: string; port: number; scheme: string }; + stale: boolean; code?: string; elapsedMs: number; budgetMs: number; stageTimeoutMs?: number; target: { endpoint: string; host: string; port: number; scheme: string }; transport: { autoSelectFamily: boolean; familyAttemptTimeoutMs: number; connectTimeoutMs: number }; route: { proxyConfigured: boolean; noProxyConfigured: boolean; customTransport: boolean }; stages: { dns?: { status: string; elapsedMs?: number; code?: string; addresses?: { address: string; family: number }[] } }; trials: Trial[] }; -type View = { jobs: Job[]; active: number; retained: number }; +type View = { jobs: Job[]; active: number; retained: number | null }; const labels: Record = { passed: '通过', partial: '部分路径可连接', failed: '未通过', running: '检查中', pending: '等待', cancelled: '已停止', interrupted: '已中断', skipped: '未检查' }; const reasons: Record = { ENOTFOUND: '域名没有解析结果', EAI_AGAIN: 'DNS 暂时不可用', DNS_NO_ADDRESSES: '没有可用的 IP 地址', @@ -65,7 +65,7 @@ export function ModelNetworkDiagnostics({ connections, initialId, disabled }: { })}>停止诊断} {selected &&

{selected.baseUrl} · 配置修订 {selected.revision}

} -

本次只检查端点直连路径,保留证书校验;握手通过不能证明 Key、型号或模型能力可用。检查最多约 12 秒,离开后结果保留。

+

本次只检查端点直连路径,保留证书校验;握手通过不能证明 Key、型号或模型能力可用。可随时停止检查,离开后结果保留。

{error &&

{error}

} {activeJob && activeJob.connectionId !== connectionId &&

{activeJob.connectionName} 正在检查。

} {!view ?

正在读取诊断记录…

:
@@ -86,11 +86,11 @@ export function ModelNetworkDiagnostics({ connections, initialId, disabled }: { {trial.code && {detail(trial.code)}}{trial.attempts.some(value => value.code) && 候选地址失败:{trial.attempts.filter(value => value.code).map(value => value.address + ' · ' + value.code).join(';')}})} {job.code &&

{detail(job.code)}

}
查看原诊断范围与运输参数
原端点
{job.target.endpoint}
检查目标
{job.target.host}:{job.target.port}
-
自动地址族
{job.transport.autoSelectFamily ? '开启' : '关闭'} · 候选间隔 {job.transport.familyAttemptTimeoutMs} ms
连接 / 总时限
{job.transport.connectTimeoutMs} / {job.budgetMs} ms
+
自动地址族
{job.transport.autoSelectFamily ? '开启' : '关闭'} · 候选间隔 {job.transport.familyAttemptTimeoutMs} ms
单路径 / 总时限
{(job.stageTimeoutMs ?? job.transport.connectTimeoutMs) > 0 ? (job.stageTimeoutMs ?? job.transport.connectTimeoutMs) + ' ms' : '不限'} / {job.budgetMs ? job.budgetMs + ' ms' : '不限'}
模型 API
未请求;能力与连接健康结论保持原记录
记录
{job.id}
}
-