assemble() runs the max_input_tokens truncation tokenizer inline in the coroutine; longbench_v2's 2M-token docs take seconds of CPU per encode, and each one BLOCKED the whole loop -- heartbeat frozen, gate probes dead, zero HTTP while the process sat at 100% single-core. encode now runs in a worker thread (loop stays live, encodes parallelize). Co-Authored-By: Claude <noreply@anthropic.com>