Fix sampled-token matching after hidden demonstration text - #910
Conversation
|
Consolidated review record (automated agent review traffic removed 2026-09-17) Change. When a chat template omits demonstration text that recurs in a later sampled reply, approximate context matching could advance the search cursor past that reply, so tokenization dropped its sampled tokens or raised despite proven boundaries. The fix resets the cursor to the proven sampled-message boundary, resolving a live Qwen truncated-reasoning trace hit while smoke-testing Caladan experiment 056. Review. Minsky and McCarthy independently reviewed the merged head |
When a template omits demonstration text that also appears in a later sampled reply, approximate context matching can advance beyond that reply. Tokenization then drops its sampled tokens or raises even though its boundaries are already proven.
Reset the search cursor to the proven sampled-message boundary. This fixes a live Qwen truncated-reasoning trace encountered while smoke-testing Caladan experiment 056 after OpenPipe/caladan#419.
Validation: