Skip to content

v0.7.17

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 20:14
afd3c99

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 under 1-hour-on-wait after 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.
  • [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_stop event that has input counts but no 5-minute and 1-hour split (for example litellm), on 1-hour-always or 1-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.

How to upgrade

  1. Run /context-guru:update.
  2. 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.
  3. Operators: on the 1-hour strategies, expect fewer cache writes after a wait of 5 to 60 minutes.
  4. Embedders (Cortex and other hosts): see "For library users".

For library users

  • Changed (#1655): apply records the 1-hour relabel, so the cold test of the next request reads the 1-hour lifetime. No API changes.
  • Changed (#1658): respfacts.ParseSSEUsage keeps the earlier 1-hour write when a later event has the same write total and no cache_creation split.
  • Cortex: context-guru requires accountant v0.18.0 since v0.7.16. In v0.18.0, the last argument of SizedPricer.PriceAt is accountant.RequestContext. Cortex must adapt the 2 methods in core/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": null or {} still zeroes the 1-hour write, and a last event without cache_creation_input_tokens still 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: set autoCompactWindow. README, Troubleshooting, names it.
  • claude_raised rows (#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 with claude_assumed and claude_raised rows 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 /compact above 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.sh now refuse Python 3.8.
  • bash 3.2 (#1650): whether install.sh supports 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_control mark (#1631, open): apply.AllBreakpointsAskExtendedTTL does not see a mark nested inside a tool_result's content. acadapter does. The wiring change must decide.
  • acadapter (#1622): ChangeNamespace = "cg:" repeats a literal that accwire writes inline. PingKey takes the raw thread id, not a mapped one.
  • Events (#1623): events: is host config. A tenant document's events block is parsed but never used. It is not refused yet.
  • Script audit (#1639, open): local-tests_test.sh:268 has 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 (gate summary_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 in waitcause, 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 send ANTHROPIC_CUSTOM_HEADERS.
  • Manual pings in insights (#1517): the row shows a cost of $0. The spend total is right.
  • searchcap with 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_llm per-candidate calls and the flat gate estimates price below tier.
  • 1-hour-on-wait on 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

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.