Commit Graph

6 Commits

Author SHA1 Message Date
sususu
aa869521c0 refactor(sessionHelper): Extract session ID directly from metadata.user_id 2025-09-04 10:26:40 +08:00
iaineng
69795f2ed0 fix: 改进会话粘性机制,支持metadata.user_id并修复cache_control导致的会话切换问题
- 添加metadata.user_id作为最高优先级会话标识
- 修改messages中cache_control检测逻辑,使用第一条消息而非缓存断点内容
- 避免动态内容破坏会话粘性,提高会话保持的稳定性
2025-09-03 21:07:45 +08:00
千羽
8a74bf5afe refactor: standardize code formatting and linting configuration
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 18:19:31 +09:00
mouyong
9c96f18a7c Update sessionHelper.js 2025-07-23 22:35:41 +08:00
shaw
8f7d3fcadf fix: 修复管理员会话键名冲突问题
- 恢复管理员会话管理的原始键名格式 session:${sessionId}
- 更改sticky会话映射使用独立前缀 sticky_session:${sessionHash}
- 避免sticky会话功能与管理后台会话冲突
- 添加sticky_session:*到cleanup清理模式
- 确保向后兼容性,管理后台功能正常

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 18:43:32 +08:00
shaw
b2b8d8c719 feat: 添加智能sticky会话保持功能
- 新增 sessionHelper.js 实现会话哈希生成,基于Anthropic的prompt caching机制
- 扩展 claudeAccountService.selectAvailableAccount 支持会话绑定
- 更新 claudeRelayService 集成会话保持功能
- 添加 Redis 会话映射存储,支持1小时过期
- 支持故障转移:绑定账户不可用时自动重新选择
- 三级fallback策略:cacheable内容 → system内容 → 第一条消息
- 完全向后兼容,自动启用无需配置

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 18:15:53 +08:00