Keep-warm pings go out for requests that carry no cache mark

A prompt-compression proxy for coding agents that keeps its output byte-stable for the provider cache and checks its savings against the real bill.
≈ 900,000 tokens per 1,000 calls, prompt tokens read at full price by pings that find nothing cached estimate
Audited with leanprompt 0.1.0-dev.15
Estimates, not measurements. Every figure on this page is an estimate from reading the code, not a measurement of the app in use.
- Repository
- hystax/optscale-kompressor
- Commit audited
afcd4de- leanprompt version
- 0.1.0-dev.15
- Audit date
- Status
- The maintainers have been told about this audit; no response yet.
- Maintainers
- the issue
- How it ran
- Unattended audit: nobody was asked during the run, so priority, volume and prices were left open; the questions for the owner are listed at the end.
leanprompt read the code at commit afcd4de and found 1 place where its LLM calls could use fewer tokens, plus 1 other problem, not scored. Static score: 99 of 100 (an estimate from the findings). The code may have changed since.
This project is a gateway or proxy. 0 items are about the gateway's own calls, 1 item about what it does to its clients' calls; each card says which.
Findings
-
LP-PC-11Keep pauses inside the cache lifetimecrates/kompressor-proxy/src/handler.rs:555· severity low · saves prefill · how often is assumed · clients' calls through the gatewayWhat happens. The proxy arms a keep-warm ping for any Anthropic request that stops on tool_use, whether or not the request carries a cache_control mark. A request with no mark leaves nothing in the provider's cache, so the ping, which re-sends the whole prompt, is billed at the full input price and finds nothing to read.
The change. Arm keep-warm only when the body that was sent carries a cache_control mark (top-level, system, tools or messages, nested tool_result content included).
Why it helps. Each such ping is one full-price read of the whole prompt, on a pause that already passed 270 seconds. It is the same cost the module comment says the feature exists to avoid, and it repeats on every later long tool wait because the next tool_use response arms a new timer.
Estimate about 900k prompt tokens per 1,000 calls, only for clients that send no cache_control
Assumptions. 60,000-token prompt; half of the calls stop on tool_use; 3% of those waits pass 270 seconds; every affected call comes from an unmarked client. All three rates are assumptions.
Who reaches this. only clients that send /v1/messages requests with no cache_control
How often. how many Anthropic /v1/messages clients behind the proxy send no cache_control anywhere, and how often their tool waits pass 270 seconds (the proxy's own stats rows with keep_warm = 1 and cache_read_tokens = 0 count them)
Other problems the audit found
Problems read in the code that cost no tokens of their own, such as a cost meter or an error path. Not scored.
-
CLAUDE-CODE.md says keep-warm is both on and off by default
What happens. Line 615 says keep-warm is on by default and that cache_keep_warm = false turns it off. Line 631 of the same paragraph says "It is off because it is the one thing the proxy does that no client asked for", and the example that follows exports CACHE_KEEP_WARM=true as the way to enable it. The code default is true (crates/kompressor-core/src/config.rs:1443).
The change. Drop the sentence at line 631 and the enabling example, or turn the example into the cache_keep_warm = false opt-out that README.md:435 shows.
To check. Read lines 615 to 637 together; the paragraph states one default.
The maintainers’ response
No response from the maintainers yet.
How this was made
The llm-call-audit skill read the code and wrote findings.json; nothing was run against the project’s providers. The full audit page is what leanprompt report --html writes from the same findings.
Corrections and takedown: email info@podwarden.com or open an issue.