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

This commit is contained in:
foxhui
2026-04-05 03:44:29 +08:00
Unverified
parent ae462ad520
commit cd7f805681
2 changed files with 9 additions and 14 deletions
+6
View File
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.6.3] - 2025-04-05
### 🐛 Fixed
- **适配器**
- 修复 Gemini 文本适配器遇到长提示词的时候无法选择模型的问题
## [3.6.2] - 2025-03-31
### ✨ Added
+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 选项的文本