ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

GLM: assistant prefill ending in </think> misfiles the continued answer into reasoning_content in thinking mode

Open nomishbhardwaj opened this issue 3 months ago • 0 comments

Setup: glm-5.3-flash branch @ a60a2a0, GLM-5.3-Flash-Q2.gguf, /v1/chat/completions.

Repro

{"model": "glm-5.3-flash-reasoner",
 "messages": [
   {"role": "user", "content": "What is 17*23? Explain briefly."},
   {"role": "assistant", "content": "<think>17*23 = 340 + 51 = 391. I will answer directly.</think>"}
 ],
 "max_tokens": 300}

Expected

The renderer correctly passes the trailing assistant <think>…</think> through verbatim and leaves the turn open, so the model continues with the final answer — that part works. The generated text ("17 × 23 = 391 …") should come back as content, since the prompt already closed the think block.

Actual

content is empty; the answer text lands in reasoning_content (finish_reason: "stop", rc holds the full answer). The output parser appears to be initialized assuming generation starts inside an open <think>, ignoring that the rendered prompt for this request already emitted </think>.

Same request with glm-5.3-flash-nothink classifies correctly (answer in content), which is the current workaround.

Matters because assistant-prefill continuation is the only way to do client-side forced think-closing / reasoning budgets today (see companion feature-request issue #898 on unbounded GLM 5.3 thinking).

nomishbhardwaj avatar Aug 29 '26 18:08 nomishbhardwaj