fix(cache): delete both breakpoint spellings from the split's volatile half - #44
Merged
Conversation
…e half splitVolatileTail COPIES the system block it splits, then deletes cache_control from the churning half so the breakpoint covers only the stable text. It did not delete cachePoint -- the Bedrock/Vertex spelling of the same thing, which wireBreakpoints counts alongside cache_control. So on those providers a splittable system block carrying an inline cachePoint had its breakpoint DUPLICATED: one on each half, 1 -> 2. That silently spends a slot from the provider's cap of four, and from a request already at the cap it puts five on the wire and takes a 400. Found by an integration review of the five cache/filter/observe merges: neither per-PR review could see it, because the split and the wire-breakpoint counter landed in the same PR but in different files, and the Anthropic path -- the only one the benchmarks exercise -- has no cachePoint to duplicate. The regression test asserts the wire count is unchanged across the split and that the volatile half keeps no breakpoint in either spelling. It fails without the fix with the exact symptom (1 -> 2). Signed-off-by: Osher-Elhadad <Osher.Elhadad@ibm.com>
4 tasks
This was referenced Aug 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes nothing on its own — this is a blocker found by integration review of the five cache/filter/observe merges (#33, #36, #40, #42, #43). Neither per-PR review could see it.
The defect
splitVolatileTailcopies the system block it splits, then deletescache_controlfrom the churning half so the breakpoint covers only the stable text (apply/prefixsplit.go:118).It did not delete
cachePoint— the Bedrock/Vertex spelling of the same thing, whichwireBreakpointscounts alongsidecache_control(apply/metawrite.go:117).So on those providers, a splittable system block carrying an inline
cachePointgets its breakpoint duplicated — one on each half, 1 → 2. That silently spends a slot from the provider's cap of four, and from a request already at the cap it puts 5 on the wire → 400.Why both reviews missed it
The two halves landed in the same PR (#36) but in different files: the split predates it, the
cachePointcounting was added by it. And the Anthropic path — the only one the benchmarks exercise — has nocachePointto duplicate, so no run could have surfaced it.This is the same shape as the bug #36 was written to fix (46 breakpoints applied, 0 forwarded): a provider-specific wire detail invisible to the code path under test.
Fix
One line, plus a comment explaining why both spellings must go.
Test
TestSplitDoesNotDuplicateBedrockCachePointasserts the wire breakpoint count is unchanged across the split, and that the volatile half keeps no breakpoint in either spelling.Verified non-vacuous — with the fix reverted it fails with the exact reported symptom:
Gates
go build -tags cg_skeleton ./...·go test -tags cg_skeleton ./...·go test -race ./apply/...·gofmt -l·go vet— all clean.Related findings from the same review, NOT fixed here
Tracked separately so this stays a one-line blocker fix:
explicitBreakpointProvideradmits Bedrock/Vertex, but on real Converse shapecachePointis its own array entry after the block it terminates — so the split inserts the volatile half before it and the breakpoint still covers the churn. The split reportsChanged: trueandcachesplitlooks active in/stats, yet the −34.1% win it is credited with cannot materialize there. Same class of defect, one provider over./statsfields.cmdfilter'sFilterStatssink has noModecheck, so an observe-only run reports realcmdfilter_families/cmdfilter_filters/cmdfilter_selector_misseswith no mode label and nopotential_*counterpart — a consumer cannot tell enforced from hypothetical. New leakage from feat(cmdfilter): port rtk's filter coverage (3 -> 24) and fix three DSL loss-typing bugs #42 × feat(proxy): add observe mode — measure what compaction would save, without enforcing it #43 composing.TailOnlyfail-open on the/compactroute only (the chat path usesmodes.Trackerand never consultscg:len:). Measurement-accuracy risk for offline eval, not live traffic.