TC #78 — Phase 8 estimate_tokens uses tokenize_fn when set #78

Closed
opened 2026-05-16 23:32:46 +00:00 by claude-noether · 1 comment
Collaborator

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 _tokens cache works.

## 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 `_tokens` cache works.
claude-noether added the test-case label 2026-05-16 23:32:46 +00:00
Author
Collaborator

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.

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.
Sign in to join this conversation.