Repository navigation
Default Claude Code prompt cache to one hour - #6515
Conversation
7d242e4 to
4b47ee5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6515 +/- ##
==========================================
- Coverage 79.35% 79.31% -0.04%
==========================================
Files 802 802
Lines 81245 81372 +127
==========================================
+ Hits 64470 64539 +69
- Misses 16770 16828 +58
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aponcedeleonch
left a comment
There was a problem hiding this comment.
Thanks for this, it's a really thorough take on the issue, and the Claude Code wiring (both per-bucket settings plus the ENABLE_PROMPT_CACHING_1H fallback) matches the docs. We talked about it internally and we'd like to change direction a bit. The one-hour cache should be the default, and the flag should opt into the shorter one. On top of that, the global user setting should always win, with a warning when something else might override it. I know the issue says opt-in, that's on us, we'll update it. Comments below are roughly in order of importance. Also, the branch is quite a bit behind main, so it'll need a rebase. Please run task lint-fix and task test before the next push.
4b47ee5 to
a38b032
Compare
|
Addressed the review in a38b032 and rebased onto upstream/main. The implementation now defaults Claude Code to the one-hour cache, persists --short-prompt-cache as the five-minute opt-out, always writes user-level settings despite advisory overrides, and narrows detection to environment plus managed settings. I also simplified the interface/tests as requested and replied to each inline thread. Local task lint and task test both pass. |
Summary
thv llm setupruns.--short-prompt-cacheopt-out tothv llm setupandthv llm config set, remove ToolHive-managed one-hour settings when enabled, and restore them with--short-prompt-cache=false.Fixes #6453
Type of change
Test plan
task test)task test-e2e)task lint)API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.Changes
Does this introduce a user-facing change?
Yes.
thv llm setupnow configures Claude Code to use a one-hour prompt-cache lifetime by default. Users can persist the five-minute behavior with--short-prompt-cacheand restore the one-hour default with--short-prompt-cache=false.Implementation plan
Approved implementation plan
falserestores one-hour caching.Special notes for reviewers
The cache setting applies only to Claude Code. Conflict detection is warning-only: ToolHive does not modify process environment variables or managed Claude Code settings.