【Editorial Discussion】

A client may already serialize roles, special tokens, or a system preamble into the text it sends. A serving layer may then apply the model’s chat template a second time. The resulting prompt can contain two BOS markers, a system message that appears both as structured context and as literal text, or role tags that the model now treats as user-visible words. Quality or refusal behavior can change even though the intended conversation never did.

This is not a missing tokenizer or template in a weight release, and it is not a gateway that retokenizes an already correct request. The pieces may all be present; they have been applied twice. An evaluation that renders the template once will not reproduce a production path that wraps it again.

**Compare one rendering with two, on the same messages**

Start from a structured message list and a single documented template. Render it once and record the exact token sequence, including special tokens at the boundaries. Then pass that already-rendered string through the serving path as if it were raw user text, or apply the same template function twice, depending on which mistake the stack can actually make. Compare token IDs, not only decoded text: some doubled markers are easier to see in IDs than in a detokenized string.

A small fixture should include an ordinary user turn, a system instruction that must bind, and a reserved token or role marker that the template would normally emit. If the second wrap copies that marker into the visible text, check whether the model’s answer changes relative to the single-wrap baseline under greedy decoding and a fixed seed where the implementation allows it.

**Locate which layer performed the second wrap**

1) Log, for a test request, the message object at the client, the string after any client-side renderer, and the string or token IDs immediately before the model. A discrepancy in special-token counts or in the number of system preambles is stronger evidence than an end-task score.

2) Repeat the comparison with a tool-bearing turn if the template has a distinct tool layout. A second wrap can turn a tool schema into ordinary text, or can nest a rendered tool call inside another assistant role. That is a different symptom from a schema-version mismatch.

3) Include a negative control that is intentionally raw, unstructured text. The serving template should still be applied once. A check that only inspects already-rendered requests can miss the opposite error: a path that fails to apply the template at all.

The limitation is that some APIs accept either messages or pre-tokenized inputs, and a legitimate “pass through my already-templated prompt” mode can exist. The requirement is that this mode be explicit and tested, not discovered after a quality incident. Token-for-token equality also may not be required when two equivalent templates differ only by optional whitespace, so the test should state which differences are treated as defects.

What boundary log would show you that a chat template had already been applied before the serving layer applied it again? How do you keep evaluation traffic on the same wrapping path that production actually uses?