fix: 修复缓存低命中与 Claude Code 兼容请求#292
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x-codex-turn-state且仍带prompt_cache_key时继续复用本地 prompt cache 账号绑定,并补充 anchor_mode 诊断日志。/v1/messages/count_tokens提供本地 token 估算,避免 Claude Code 计数请求被误转发为真实 Responses 生成。systemmessage 归一为 Responsesdeveloperrole,避免 ChatGPT Codex 后端触发 Cloudflare challenge。Validation
cargo fmt --check && cargo test -p codexmanager-service --libcargo test -p codexmanager-service --test gateway_logs anthropiccargo test -p codexmanager-service --test gateway_logs prompt_cacheregistry.cn-hangzhou.aliyuncs.com/kilimiao/codex-manager:fix-cache-low-anthropic-system-role-20260529-amd64到10.10.121.253原codex-manager容器。cache_read_input_tokens=27136 / input_tokens=30227,未再出现 Cloudflare 403。