I have a significant incremental update. It turns out that a few days ago, I collapsed from exhaustion just before the finish line.
A new architectural mode I designed; In which all of the potential volatile tail content that was previously poisoning my cache is delivered as a static tool result during a known cache-busting maintenance window, I finally got it to an operational state and tested it.
This mode guarantees that as much as the other systems keep the body content stable, the tail is also kept append-only and stable, and all of the live-churn, high-volatility, heads-up display content that the agent would normally rely on is instead delivered in heavy blocks during these maintenance windows.
For anything operationally critical, like access tokens for write operations to disk, these still get injected in-band, but their content mass is relatively small, and so it’s tolerable for them to accumulate.
tokens=330,628 cached=0 tail=330,628 ratio=0.00%
tokens=331,078 cached=330,496 tail=582 ratio=99.82%
tokens=331,740 cached=330,496 tail=1,244 ratio=99.63%
tokens=332,381 cached=331,520 tail=861 ratio=99.74%
tokens=341,628 cached=332,032 tail=9,596 ratio=97.19%
tokens=342,859 cached=341,248 tail=1,611 ratio=99.53%
tokens=345,898 cached=342,272 tail=3,626 ratio=98.95%
tokens=346,422 cached=345,344 tail=1,078 ratio=99.69%
tokens=349,013 cached=345,856 tail=3,157 ratio=99.10%
tokens=349,911 cached=348,416 tail=1,495 ratio=99.57%
tokens=350,748 cached=349,440 tail=1,308 ratio=99.63%
tokens=351,614 cached=350,464 tail=1,150 ratio=99.67%
tokens=354,257 cached=351,488 tail=2,769 ratio=99.22%
tokens=355,829 cached=354,048 tail=1,781 ratio=99.50%
tokens=361,141 cached=355,584 tail=5,557 ratio=98.46%
Look at that: Incremental, adaptive, continuous, cache prefix tail growth.
This breaks a bunch of my systems and workflows and violates a lot of expectations in my application, but it’s a promising first look. There may actually be a way for me to continue to use the API in my application without suffering the previous level of financial damages in the future.