fix: 修复 Gemini 文本适配器遇到长提示词的时候无法选择模型的问题 (closes #42)

This commit is contained in:
foxhui
2026-04-05 03:44:29 +08:00
parent ae462ad520
commit cd7f805681
2 changed files with 9 additions and 14 deletions
+3 -14
View File
@@ -71,20 +71,9 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
try {
logger.debug('适配器', `准备选择模型: ${modelId}`, meta);
// 点击输入框确保焦点
await inputLocator.focus();
await sleep(300, 500);
// 按 3 次 Tab 键到达模型选择按钮
await page.keyboard.press('Tab');
await sleep(100, 200);
await page.keyboard.press('Tab');
await sleep(100, 200);
await page.keyboard.press('Tab');
await sleep(100, 200);
// 按回车打开模型菜单
await page.keyboard.press('Enter');
// 点击打开模型选择菜单
const modePickerBtn = page.getByRole('button', { name: 'Open mode picker' });
await safeClick(page, modePickerBtn, { bias: 'button' });
await sleep(300, 500);
// 获取所有 menuitem 选项的文本