fix: 修复gpt->claude转换无法命中codex缓存问题

This commit is contained in:
shaw
2026-03-09 15:08:37 +08:00
parent ebe6f418f3
commit a461538d58
5 changed files with 40 additions and 1 deletions

View File

@@ -29,6 +29,13 @@ func openAIStickyCompatStats() (legacyReadFallbackTotal, legacyReadFallbackHit,
openAIStickyLegacyDualWriteTotal.Load()
}
// DeriveSessionHashFromSeed computes the current-format sticky-session hash
// from an arbitrary seed string.
func DeriveSessionHashFromSeed(seed string) string {
currentHash, _ := deriveOpenAISessionHashes(seed)
return currentHash
}
func deriveOpenAISessionHashes(sessionID string) (currentHash string, legacyHash string) {
normalized := strings.TrimSpace(sessionID)
if normalized == "" {