"""GGUF client helpers — Qwen3 stripping (no model load needed).""" from __future__ import annotations from models.llm import _strip_thinking def test_strips_closed_think_block() -> None: assert _strip_thinking("chain of thoughtThe answer.") == "The answer." def test_strips_dangling_unclosed_think() -> None: # a truncated reasoning block (ran out of tokens) leaves only what precedes it assert _strip_thinking("Result line\nreasoning that got cut") == "Result line" def test_plain_text_is_untouched_but_trimmed() -> None: assert _strip_thinking(" Senior AI Engineer profile ") == "Senior AI Engineer profile"