Reported by ChrisJ_AI on X: Claude Code on an agy-cli model showed 268K-input turns
at 0% cache hit, turn after turn.
Two places dropped cache reuse; both are klarkxy's #971 (closes#970):
- a follow-up turn after the client filled defaults into historical
tool_use.input (Edit's replace_all) failed matchesHistory / takeParked, so
the live agy session was retired and the whole prefix replayed;
- tool steps of a fresh process's first prompt reported every token as a
cache miss until the prompt ended (no ratio learned yet).
Run at reviewed head 27245320 (win-run, xiaomi-gpu): node --test
test/usage-settlement.mjs 26/26 pass; the same file against c27ba5f7's
index.mjs fails tests 20, 21 and 24 (red on old code). bun test
packages/agy-cli: 7 of 8 pass, smoke.mjs 1 failure of 321 checks, the same
count on c27ba5f7.
Not tried: a real agy (signed out on every machine here, mote refused SSH),
so the 0% was not reproduced against Google's cache; the in-turn figure is
an estimate, not ACP usage.