"backend/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "0c7a58fcc77388d27d40b3bcaf281e95439cf7c4"
fix(gateway): 修复 cache_control 块超限问题并优化 Claude Code 检测
问题: - OAuth/SetupToken 账号注入 system prompt 后可能导致 cache_control 块超过 Anthropic API 的 4 个限制 - Claude Code 检测使用精确匹配,无法识别 Agent SDK 等变体 修复: - 新增 enforceCacheControlLimit 函数,强制执行 4 个块限制 - 优先从 messages 移除,再从 system 尾部移除(保护注入的 prompt) - 改用前缀匹配检测 Claude Code 系统提示词,支持多种变体: - 标准版、Agent SDK 版、Explore Agent 版、Compact 版
Please register or sign in to comment