Skip to content

gemini 迁移公共构造与停止判据复核 (fix #335) - #361

Merged
Teeeeeeeerry merged 1 commit into
mainfrom
fix/335-gemini-byok
Aug 31, 2026
Merged

gemini 迁移公共构造与停止判据复核 (fix #335)#361
Teeeeeeeerry merged 1 commit into
mainfrom
fix/335-gemini-byok

Conversation

@Teeeeeeeerry

Copy link
Copy Markdown
Owner

问题

Gemini 仍自持整段骨架,且其错误体特例(读响应体区分认证失败与其他 4xx)需要验证能否经现有扩展点接入公共构造。

根因

第三家引擎未迁移,#309 的停止判据未复核。

修复

Gemini 迁移到 createByokEngine:错误体特例保留在适配器内(classifyError 读错误体,错误体明示认证失败归 key 无效、模型名错误或内容过长归瞬时),请求格式与凭据传递方式(x-goog-api-key 请求头而非查询串)不变。

停止判据复核:公共构造参数数量未增长(适配器定义读起来不劣于改造前),也无需为本家引擎加入第二个特例扩展点 —— 判据未触发,保留三家引擎接入。

验证

pnpm typecheck 通过;pnpm test 647 个用例全部通过(gemini HTTP、跨引擎分类契约、探测契约等既有测试未修改且全部通过);pnpm build 正常。

Closes #335

第三家引擎接入 createByokEngine:错误体特例保留在适配器内,
请求格式与凭据走请求头不变。停止判据复核:构造未新增参数与
特例扩展点,适配器定义读起来不劣于改造前,判据未触发。

Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
@Teeeeeeeerry
Teeeeeeeerry merged commit 5eed462 into main Aug 31, 2026
6 checks passed
@Teeeeeeeerry
Teeeeeeeerry deleted the fix/335-gemini-byok branch August 31, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

309-3 gemini 迁移与停止判据复核(父 #309)

1 participant