fix(assistant): explain paused sends and cache model picker

This commit is contained in:
abaishu0730 committed 2026-10-28 11:54:03 +08:00
1 parent 1747361a1d
commit d0bc4b0da2
5 files changed
+13 -6

No files matched your search

+7
View File
@@ -19,3 +19,10 @@ test('provider save locks mutable fields until its acknowledged response complet
test('provider cancel asks once before discarding a dirty draft',{timeout:90000},async t=>{
const {page,open}=await managementFixture(t,{browser:true});await open('#assistant-settings');await page.getByRole('button',{name:'添加供应商',exact:true}).click();await page.getByLabel('供应商名称',{exact:true}).fill('UNSAVED_NAME');await page.getByRole('button',{name:'取消',exact:true}).click();await page.getByRole('dialog',{name:'未保存的修改',exact:true}).waitFor();await page.getByRole('button',{name:'放弃并继续',exact:true}).click();await page.locator('#provider-edit-form').waitFor({state:'hidden'});assert.equal(await page.getByRole('dialog',{name:'未保存的修改',exact:true}).count(),0);
});
test('paused assistant explains why send is unavailable and reuses the model directory',{timeout:90000},async t=>{
const {page,open}=await managementFixture(t,{browser:true});let providerGets=0;
await page.route('**/api/assistant/providers',async route=>{if(route.request().method()==='GET')providerGets++;await route.continue();});
await open();await page.getByRole('button',{name:/选择模型/}).click();await page.getByRole('button',{name:/选择模型/}).press('Escape');await page.getByRole('button',{name:/选择模型/}).click();
assert.equal(providerGets,1);assert.equal(await page.getByRole('button',{name:'发送',exact:true}).isDisabled(),true);
await page.getByRole('link',{name:'启用助手设置',exact:true}).waitFor();assert.match(await page.getByText('助手已暂停',{exact:false}).innerText(),/助手已暂停/);
});