Skip to content

Commit cd7f805

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

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.6.3] - 2025-04-05
9+
10+
### 🐛 Fixed
11+
- **适配器**
12+
- 修复 Gemini 文本适配器遇到长提示词的时候无法选择模型的问题
13+
814
## [3.6.2] - 2025-03-31
915

1016
### ✨ Added

‎src/backend/adapter/gemini_text.js‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,9 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
7171
try {
7272
logger.debug('适配器', `准备选择模型: ${modelId}`, meta);
7373

74-
// 点击输入框确保焦点
75-
await inputLocator.focus();
76-
await sleep(300, 500);
77-
78-
// 按 3 次 Tab 键到达模型选择按钮
79-
await page.keyboard.press('Tab');
80-
await sleep(100, 200);
81-
await page.keyboard.press('Tab');
82-
await sleep(100, 200);
83-
await page.keyboard.press('Tab');
84-
await sleep(100, 200);
85-
86-
// 按回车打开模型菜单
87-
await page.keyboard.press('Enter');
74+
// 点击打开模型选择菜单
75+
const modePickerBtn = page.getByRole('button', { name: 'Open mode picker' });
76+
await safeClick(page, modePickerBtn, { bias: 'button' });
8877
await sleep(300, 500);
8978

9079
// 获取所有 menuitem 选项的文本

0 commit comments

Comments
 (0)