Repository navigation
This release moves latest from v0.7.16 to v0.7.17.
It fixes two bugs in the 1-hour cache strategies. A main thread was judged cold after about 5 minutes, so cuts meant for a cold cache broke a live 1-hour cache. And behind a litellm gateway, the proxy read every 1-hour write as 0, so it turned the 1-hour strategies off.
Items marked [Notice] change something you will see, or need an action from you.
New and changed
-
[Notice] A 1-hour main thread is no longer judged cold after 5 minutes (#1655, closes #1654).
- Who: main threads under
1-hour-always, or under1-hour-on-waitafter the thread enters the 1-hour mode. Every host: the proxy, Cortex and the bifrost adapter. - Before: the 1-hour relabel was not recorded. The next request was judged cold after about 5 minutes. Cuts that run only on a cold cache, and sweep applies, then changed the prefix of a live 1-hour cache and broke it. One live request paid a cache write for no saving.
- Now: the relabel is recorded. The thread stays warm until the 1-hour lifetime ends. A failed request earns no 1-hour mark.
- A silent downgrade: if a gateway quietly bills 5 minutes, the thread stays warm for one gap. Then the existing downgrade check turns the 1-hour route off.
- Turn it off: no switch, except leaving the 1-hour strategies.
- Who: main threads under
-
[Notice] The proxy reads the 1-hour write behind a litellm gateway (#1658, closes #1657).
- Who: any host behind a gateway that ends a stream with a
message_stopevent that has input counts but no 5-minute and 1-hour split (for example litellm), on1-hour-alwaysor1-hour-on-wait. - Before: that last event set the 1-hour write to 0. The downgrade check then said "billed at 5 minutes" and turned the 1-hour route off. The strategy fell back to 5-minute pings. The 1-hour cost was booked at the 5-minute rate.
- Now: the parser keeps the earlier 1-hour figure when the last event carries the same cache-write total and no split. The route stays on.
- Turn it off: no switch.
- Who: any host behind a gateway that ends a stream with a
How to upgrade
- Run
/context-guru:update. - Plugin versions:
- OpenCode: the plugin pins context-guru v0.7.17 (was v0.7.16).
- Claude Code plugin 0.7.13, Codex 0.2.17, Pi package 0.1.10 and Bob plugin 0.1.5: unchanged. No plugin changed since v0.7.16.
- Operators: on the 1-hour strategies, expect fewer cache writes after a wait of 5 to 60 minutes.
- Embedders (Cortex and other hosts): see "For library users".
For library users
- Changed (#1655):
applyrecords the 1-hour relabel, so the cold test of the next request reads the 1-hour lifetime. No API changes. - Changed (#1658):
respfacts.ParseSSEUsagekeeps the earlier 1-hour write when a later event has the same write total and nocache_creationsplit. - Cortex: context-guru requires accountant v0.18.0 since v0.7.16. In v0.18.0, the last argument of
SizedPricer.PriceAtisaccountant.RequestContext. Cortex must adapt the 2 methods incore/accounting(price.go,metrics.go) when it moves to v0.7.17.
Known limits
New in this release:
- SSE usage edge cases (#1659, low): a
"cache_creation": nullor{}still zeroes the 1-hour write, and a last event withoutcache_creation_input_tokensstill zeroes the write. The captured gateway shape does not send either.
Carried from v0.7.16:
- Blind spot of the 400k assumption (#1644, #1649): Claude Code may move its default back up, for example from 400k to 1M. The proxy then keeps 400k. With the summarizer on (
high,xhigh), it summarizes at about 330k, earlier than needed. The client never compacts, so nothing corrects the point. Saving figures are lower than the real ones. Fix: setautoCompactWindow. README, Troubleshooting, names it. claude_raisedrows (#1649): a row written by a build between #1644 and #1649 reads as an unknown source. The table point applies and no point is stored for it. A conversation withclaude_assumedandclaude_raisedrows reads the older assumed point (367k). The dashboard can under-report for these rows.- Guessed constants (#1644):
ClientToBilled(1.0) is still a guess. - Learned point (#1645): a manual
/compactabove 100k counts as an observation. The median and the group rule limit its effect. The lookup is by client, model and route, not by session. - Project and local settings (#1632): not read, because no request carries a working directory. Remote policy and the Windows registry are not read either.
- Python 3.8 (#1650): the plugin scripts and the tests that run
install.shnow refuse Python 3.8. - bash 3.2 (#1650): whether
install.shsupports bash 3.2 as a shell is open. A bash version check with a clear message is not added. No CI job runs the shell tests on macOS. - Nested
cache_controlmark (#1631, open):apply.AllBreakpointsAskExtendedTTLdoes not see a mark nested inside atool_result's content.acadapterdoes. The wiring change must decide. acadapter(#1622):ChangeNamespace = "cg:"repeats a literal thataccwirewrites inline.PingKeytakes the raw thread id, not a mapped one.- Events (#1623):
events:is host config. A tenant document'seventsblock is parsed but never used. It is not refused yet. - Script audit (#1639, open):
local-tests_test.sh:268has the same SIGPIPE shape.
Carried from v0.7.15:
- Reasoning models and
summarize(#1613): a model that reasons by default can spend the whole reply allowance on reasoning. The reply then holds no text, and the summary is dropped. The inline path counts it (gatesummary_empty_reply). The async path has no counter. Turning reasoning off for the summary call is a follow-up. - Claude Code markers in
waitcause(#1620, open): the teammate and idle-notice markers still live inwaitcause, not in the agent package. The move is pending. - Stale "cache split" text (#1625, open): some plugin and dashboard docs still describe the retired cache-split saving.
Carried from v0.7.14:
- Route-off state (#1597): the state of a downgraded 1-hour route is still memory only. After a restart, one request per downgraded route relabels again. The keeper then detects the downgrade again.
- Two close writes (#1597): two close writes for one thread have no write order. The record is at most one touch old. This fails in the safe direction.
- Parallel sibling requests (#1603): requests that start within about 1 s share the prefix, and the later one really misses. The store counts it once. Both orders give the safe under-count.
- Old threads (#1576, #1594): a thread that holds an old hashed ChangeID books the stale op until it ends.
- Billed elsewhere (#1587, #1590): two rare cases carry the mark but no ping row books them. A summary substitute that does not commit. A sweep question that touches no cache. A metered host books them nowhere, so its saving shows slightly too high. The proxy is not affected.
x-context-guru-*headers from Claude Code (#1516): Claude Code 2.1.332 does not sendANTHROPIC_CUSTOM_HEADERS.- Manual pings in insights (#1517): the row shows a cost of $0. The spend total is right.
searchcapwith the store off (#1556): the cut matches cannot be restored.- Recorder (#1473, medium): it trusts
x-stainless-*headers by prefix. - Live-ratio comparison (#1533): the request-ratio pricing is not yet measured against the table on live traffic. The comparison is due after a day of live data.
- Refactor-scan follow-ups (#1503): the open findings stay tracked there.
- Price tiers, not everywhere:
extract_llmper-candidate calls and the flat gate estimates price below tier. 1-hour-on-waiton Opus: the 0 of 13 read test is on one gateway, not on Anthropic first-party.- Dashboard cache-mark panel: the same panel for Cortex is in rossoctl/cortex#2189.
- Automatic caching (#1281), OpenCode shared binary (#1233), OpenCode fallback (#1235): unchanged.
- Bob sweep (#1191, open) and Bob plugin install suite (#1221, open, on hold): unchanged.
The numbers #1281, #1233 and #1235 are merged PRs, not issues. They name the origin of each limit.
Tests for this release: the full release checks passed on macOS, Go 1.27.4 (vet, builds, -race on every package, the timing tests). The Bob install suite was skipped while it is on hold (#1221). The heavy CI and the release dry run on GitHub passed. The live checks with Claude Code through the proxy passed. Under 1-hour-always, the route stayed on and the first write was billed at 1 hour, and a request after a 6.7-minute idle read the cache with no cold-only cut.
Changelog
- afd3c99: chore(plugins): bump the plugin versions for v0.7.17 (#1660) (@amiddavid)
- 7677f49: fix(apply): record a 1-hour relabel, so the next request is not judged cold after 5 minutes (#1655) (@amiddavid)
- bb8b270: fix(respfacts): keep the 1-hour write when a final SSE event has no cache_creation split (#1658) (@amiddavid)
Install
No Go toolchain and no C compiler are needed — the binary is statically linked.
Download the tarball for your platform, untar it, and put context-guru-proxy on your
PATH. The archive unpacks into its own directory, so this is safe to run anywhere:
tar xzf context-guru_*_darwin_arm64.tar.gz
install -m 755 context-guru_*/context-guru-proxy ~/.local/bin/
Then see docs/get-started/quickstart-proxy.md.