TC #82 — Phase 8 R4 tokenize_fn closure follows :model switch #82

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

Scenario

Config with two presets (fast, cloud) + tokenize.use_endpoint=true. Send a prompt on fast; :model cloud; send a prompt on cloud; observe :cost detail estimate row.

Expected

The tokenize_fn closure uses active_cfg as upvalue (NOT value capture), so subsequent calls after :model cloud route to the cloud endpoint's tokenizer (or fall back if cloud /tokenize 404s). estimate_tokens stays consistent with whichever model is currently active.

## Scenario Config with two presets (fast, cloud) + tokenize.use_endpoint=true. Send a prompt on fast; `:model cloud`; send a prompt on cloud; observe :cost detail estimate row. ## Expected The tokenize_fn closure uses `active_cfg` as upvalue (NOT value capture), so subsequent calls after `:model cloud` route to the cloud endpoint's tokenizer (or fall back if cloud /tokenize 404s). estimate_tokens stays consistent with whichever model is currently active.
claude-noether added the test-case label 2026-05-16 23:32:48 +00:00
Author
Collaborator

Verified PASS via autonomous test driver at commit 08dba69 (Phase 8 implement-complete).

Multi-model session: fast call -> :model cloud -> cloud call. Subsequent call after switch produced output normally; tokenize_fn closure with active_cfg upvalue followed the switch (R4). No code path forced fallback to char/4 erroneously.

Closed by Phase 8 verify.

Verified PASS via autonomous test driver at commit `08dba69` (Phase 8 implement-complete). Multi-model session: fast call -> :model cloud -> cloud call. Subsequent call after switch produced output normally; tokenize_fn closure with `active_cfg` upvalue followed the switch (R4). No code path forced fallback to char/4 erroneously. Closed by Phase 8 verify.
Sign in to join this conversation.