TC #78 — Phase 8 estimate_tokens uses tokenize_fn when set #78
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
Context.new with stub tokenize_fn returning N=10 per call; append 3 turns; call estimate_tokens.
Expected
Returns 10 (sys) + 10*3 (turns) = 40. Stub called 4 times on first estimate; only 1 (sys) on subsequent. Per-turn
_tokenscache works.Verified PASS via autonomous test driver at commit
08dba69(Phase 8 implement-complete).Stub tokenize_fn returns 10/call. First estimate_tokens: 4 calls (sys + 3 turns) -> 40 total. Second estimate: only 1 new call (sys); turn _tokens cache hit. Amortization confirmed.
Closed by Phase 8 verify.