From 0bf2f8ba63323f424767fbddf93f8a33f139cbd0 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Tue, 6 Oct 2026 18:10:15 +0800 Subject: [PATCH] =?UTF-8?q?check-studio=EF=BC=9A=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E6=A0=8F=E9=82=A3=E4=B8=80=E8=8A=82=E7=9A=84=E4=BC=AA=E9=80=A0?= =?UTF-8?q?=E8=AE=BE=E5=AE=9A=E6=94=B9=E6=88=90=E6=8E=A5=E5=85=A5=E8=BF=9E?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E4=B8=AA=E5=88=97=E5=BE=97=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=EF=BC=8C=E3=80=8C=E4=B8=8B=E6=8B=89=E5=81=9C?= =?UTF-8?q?=E5=9C=A8=E5=AD=98=E7=9D=80=E7=9A=84=E8=AE=BE=E5=AE=9A=E4=B8=8A?= =?UTF-8?q?=E3=80=8D=E3=80=8C=E5=8F=91=E5=87=BA=E7=9A=84=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6=E6=A8=A1=E5=9E=8B=E3=80=8D=E4=B8=A4=E9=A1=B9?= =?UTF-8?q?=E6=89=8D=E5=88=86=E5=BE=97=E5=87=BA=E6=96=B0=E6=97=A7=E5=86=99?= =?UTF-8?q?=E6=B3=95=EF=BC=88Playwright=20=E7=9A=84=20selectOption=20?= =?UTF-8?q?=E9=80=89=E5=90=8C=E4=B8=80=E4=B8=AA=E5=80=BC=E4=B9=9F=E4=BC=9A?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=20change=EF=BC=8C=E5=8D=95=E9=9D=A0=E3=80=8C?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E9=80=89=E8=B7=9F=E9=9A=8F=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E3=80=8D=E5=88=86=E4=B8=8D=E5=87=BA=E6=9D=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check-studio.mjs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/check-studio.mjs b/scripts/check-studio.mjs index 21ae0a50..74061c0c 100644 --- a/scripts/check-studio.mjs +++ b/scripts/check-studio.mjs @@ -2655,8 +2655,10 @@ const ASSISTANT_BROKEN = '助手使用的模型接入「demo-gone」不存在。 await section('点名的模型接入:检查器模型一栏说清留空用哪个接入;助手栏照实显示存着的设定、能重新选「跟随默认」', async () => { FAKES['st-model'] = wf('st-model', { name: '__studio_check_model__', graph: MODEL_GRAPH, version: 1 }) FAKES['st-modeldef'] = wf('st-modeldef', { name: '__studio_check_model_defaults__', graph: { ...MODEL_GRAPH, defaults: { provider: 'demo-main' } }, version: 1 }) - // 助手的模型设定:存着一个已删掉的接入,GET 照后端说明用不了;PUT 记下请求、清掉存着的接入 - const copilot = { saved: { configured: true, provider: 'demo-gone', model: null, effective_provider: null, effective_model: null, error: ASSISTANT_BROKEN }, puts: [] } + // 助手的模型设定:存着一个已删掉的接入和一个下拉里列得出的模型(big-model),GET 照后端说明用不了;PUT 记下请求、 + // 清掉存着的接入。模型列得出也不能直接选中它:那样看着一切正常,发出去还会带上模型、绕过存着的接入 + const BROKEN = { configured: true, provider: 'demo-gone', model: 'big-model', effective_provider: null, effective_model: null, error: ASSISTANT_BROKEN } + const copilot = { saved: BROKEN, puts: [] } const before = async (page) => { const json = (route, body) => route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(body) }) await page.route(/\/api\/providers(\?.*)?$/, (route) => (route.request().method() === 'GET' ? json(route, MODEL_PROVIDERS) : route.fallback())) @@ -2718,7 +2720,8 @@ await section('点名的模型接入:检查器模型一栏说清留空用哪 const select = page.locator('#copilot-model') await select.waitFor({ timeout: 3000 }) const picked = await select.evaluate((el) => el.options[el.selectedIndex]?.textContent ?? '') - check('下拉停在存着的设定上,不显示成「跟随默认」', picked === '模型接入「demo-gone」的默认模型', picked) + check('下拉停在存着的设定上(接入连同模型),不显示成「跟随默认」,也不只选中同名的模型', picked === 'big-model(模型接入「demo-gone」)' + && await select.inputValue() !== '' && await select.inputValue() !== 'big-model', picked) check('……「跟随默认」不带「当前」:选它以后用哪个要服务端说了算', (await select.locator('option[value=""]').innerText()).trim() === '跟随默认') const said = await page.locator('[data-copilot-model-error]').innerText().catch(() => '') check('下拉下面照实写原因(和发出一句话后报的同一句)', said === ASSISTANT_BROKEN && await select.getAttribute('aria-invalid') === 'true', said) @@ -2761,7 +2764,7 @@ await section('点名的模型接入:检查器模型一栏说清留空用哪 await second.ctx.close() // 390 宽:助手栏浮在画布上,展开「助手使用的模型」、原因那一长句照样折行,不把页面撑出横向滚动 - copilot.saved = { configured: true, provider: 'demo-gone', model: null, effective_provider: null, effective_model: null, error: ASSISTANT_BROKEN } + copilot.saved = BROKEN const narrow = await open({ path: '/studio/st-model', before, width: 390, height: 844 }) await blur(narrow.page) await narrow.page.keyboard.press('Alt+KeyA')