mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-03 02:51:17 +08:00
revert(proxy): drop the 1-hour cache TTL option and TTL-bucketed write accounting
The forced 1-hour cache_control TTL (schema v14) was a mistake. Injected breakpoints return to Anthropic's standard 5-minute TTL, caller-owned markers are preserved verbatim instead of having their TTLs rewritten, and the 5m/1h cache-write buckets are removed from usage parsing and pricing (back to the single aggregate cache-creation rate). The cache TTL selector is removed from the rectifier settings panel along with its i18n keys in all four locales. SCHEMA_VERSION returns to 13: the unreleased cache_creation_1h_tokens column and the v13->v14 migration are removed. The feature never shipped in a release and the introducing commit was never pushed, so no databases were stamped v14 outside this machine (local DB verified at user_version 13).
This commit is contained in:
@@ -2859,13 +2859,13 @@ fn responses_error_envelope_message(body: &[u8]) -> Option<String> {
|
||||
/// Prompt caching is part of the Codex→Anthropic protocol bridge rather than an
|
||||
/// optional Bedrock optimizer. Codex requests do not contain Anthropic
|
||||
/// `cache_control`, so keep bridge caching on by default while still honoring the
|
||||
/// dedicated cache-injection switch and configured TTL.
|
||||
/// dedicated cache-injection switch. Injected breakpoints always use Anthropic's
|
||||
/// standard 5-minute TTL.
|
||||
fn codex_anthropic_cache_config(config: &OptimizerConfig) -> OptimizerConfig {
|
||||
OptimizerConfig {
|
||||
enabled: true,
|
||||
thinking_optimizer: false,
|
||||
cache_injection: config.cache_injection,
|
||||
cache_ttl: config.cache_ttl.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4233,7 +4233,6 @@ mod tests {
|
||||
let default = codex_anthropic_cache_config(&OptimizerConfig::default());
|
||||
assert!(default.enabled);
|
||||
assert!(default.cache_injection);
|
||||
assert_eq!(default.cache_ttl, "1h");
|
||||
|
||||
let disabled = codex_anthropic_cache_config(&OptimizerConfig {
|
||||
cache_injection: false,
|
||||
|
||||
Reference in New Issue
Block a user