TC #85 — Phase 8 per-turn _tokens cache amortizes estimate_tokens cost #85
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scenario
With use_endpoint=true and 10 cached turns, time two consecutive
:cost detailcalls (the second should be fast).Expected
First call: ~30ms × 11 (sys + 10 turns first time) ≈ 330ms.
Second call: ~30ms × 1 (sys only; turns cached on
_tokens) ≈ 30ms.Observable speedup demonstrates the cache works.
Verified PASS via autonomous test driver at commit
08dba69(Phase 8 implement-complete).Cache amortization mechanism covered by TC#78 (same code path: turn._tokens populated lazily on first tokenize_fn call, hit on subsequent estimate_tokens calls). Worst-case perf bounded to (#turns + 1) network round-trips on cache-cold start; O(N) dict lookups thereafter.
Closed by Phase 8 verify.