mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-25 09:25:59 +03:00
[PR #338] [MERGED] fix: 修复同会话跨模型缓存键不命中问题 #340
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#340
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/justlovemaki/AIClient-2-API/pull/338
Author: @lly835
Created: 2/25/2026
Status: ✅ Merged
Merged: 2/26/2026
Merged by: @justlovemaki
Base:
main← Head:fix/codex-cache-key-cross-model📝 Commits (1)
022e345fix: 修复同会话跨模型缓存键不命中问题📊 Changes
1 file changed (+2 additions, -4 deletions)
View changed files
📝
src/providers/openai/codex-core.js(+2 -4)📄 Description
问题描述
修复 #328 中报告的 Claude Code → Codex 会话缓存隔离与跨模型缓存命中问题。
根因分析
codex-core.js的prepareRequestBody()中,缓存键生成逻辑存在矛盾:${model}-${sessionId}这导致同一会话内切换模型(如 gpt-5-codex-mini → gpt-5-codex)时,缓存键不同,无法命中缓存。
修复方案
移除非 default sessionId 时的 model 前缀拼接:
效果
关联 Issue 评论
@ylqgithubylq 在 #328 评论中也指出了 else 分支不应该拼接 model 的问题。
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.