智能助手网
标签聚合 慢讯

/tag/慢讯

linux.do · 2026-04-13 22:44:44+08:00 · tech

github.com/anthropics/claude-code [BUG] Disabling telemetry also disables 1-hour prompt cache TTL 已打开 07:02PM - 08 Apr 26 UTC EmpireJones bug has repro platform:windows area:core api:anthropic ### Preflight Checklist - [x] I have searched [existing issues](https://github. … com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet - [x] This is a single bug report (please file separate reports for different bugs) - [x] I am using the latest version of Claude Code ### What's Wrong? When telemetry is disabled (e.g., via DISABLE_TELEMETRY=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1), sessions that would otherwise receive 1-hour prompt cache TTL appear to fall back to the 5-minute TTL instead. ### What Should Happen? Prompt cache TTL selection should be independent of telemetry. If a user/session would otherwise qualify for 1-hour prompt cache TTL, it should still receive it even when telemetry is disabled. ### Error Messages/Logs ```shell ``` ### Steps to Reproduce 1. Start a session with telemetry enabled. 2. Confirm the session is using the 1-hour prompt cache tier. 3. Start a comparable session with either `DISABLE_TELEMETRY=1` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`. 4. Compare the cache metadata between the two sessions. 5. Observe that the 1-hour TTL is no longer applied when telemetry is disabled. Note: This may not be reproducible if using bedrock and `ENABLE_PROMPT_CACHING_1H_BEDROCK=1` is set. I only tested with an Anthropic Claude Max plan. What metadata to check: In session transcripts, check the assistant response `usage.cache_creation` metadata for the prompt cache tier: - `usage.cache_creation.ephemeral_1h_input_tokens` - `usage.cache_creation.ephemeral_5m_input_tokens` If 1-hour TTL is active, `ephemeral_1h_input_tokens` should be non-zero. If 5-minute TTL is active, `ephemeral_5m_input_tokens` should be non-zero. ### Claude Model Opus ### Is this a regression? I don't know ### Last Working Version _No response_ ### Claude Code Version 2.1.96 ### Platform Anthropic API ### Operating System Windows ### Terminal/Shell VS Code integrated terminal ### Additional Information _No response_ 让 cc 分析之前泄露的源码原因如下,看起来是个 bug: 8 个帖子 - 4 位参与者 阅读完整话题