Commit 29f5b8b
committed
Raise stale-costly defaults to 100k tokens / 60 min
Bump DEFAULT_STALE_COSTLY_THRESHOLD from 40k/5min to 100k/60min:
- tokens 100k: ~10% of the 1M context window, so the warning only fires
when a cold prefix rebuild is a genuine cost (40k was ~$0.25 at Opus
rates — too small to warrant a dialog).
- staleMs 60 min: the 5-minute value was the *default* ephemeral TTL,
but the 1-hour opt-in TTL may be in effect (the Agent SDK decides, and
we don't observe it). Using the longer bound means we only warn once
the cache is almost certainly cold, avoiding false-positive nags while
a still-warm cache makes continuation cheap.
Also corrects the misleading "5-minute TTL" doc comment.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RkLQSsdj7o4wQjcmjM1SD11 parent 199a7fc commit 29f5b8b
1 file changed
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
134 | 143 | | |
135 | 144 | | |
136 | | - | |
137 | | - | |
| 145 | + | |
| 146 | + | |
138 | 147 | | |
139 | 148 | | |
140 | 149 | | |
| |||
0 commit comments