| 8774 | if (tool_before_close) { |
| 8775 | limit = trim_tool_separator_ws(raw, st->emit_pos, |
| 8776 | (size_t)(tool - raw)); |
| 8777 | } else if (close) { |
| 8778 | limit = (size_t)(close - raw); |
| 8779 | } else if (final) { |
| 8780 | limit = raw_len; |
| 8781 | } else { |
| 8782 | const size_t hold = strlen("</think>") - 1; |
| 8783 | limit = raw_len > hold ? raw_len - hold : st->emit_pos; |