mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-03-30 02:49:34 +00:00
Sticky session: fallback to prompt_cache_key
This commit is contained in:
@@ -240,11 +240,13 @@ const handleResponses = async (req, res) => {
|
||||
}
|
||||
|
||||
// 从请求头或请求体中提取会话 ID
|
||||
// NOTE: For some clients, prompt_cache_key is the only stable per-session key.
|
||||
const sessionId =
|
||||
req.headers['session_id'] ||
|
||||
req.headers['x-session-id'] ||
|
||||
req.body?.session_id ||
|
||||
req.body?.conversation_id ||
|
||||
req.body?.prompt_cache_key ||
|
||||
null
|
||||
|
||||
sessionHash = sessionId ? crypto.createHash('sha256').update(sessionId).digest('hex') : null
|
||||
|
||||
Reference in New Issue
Block a user