fix: add <thought> stripping to auxiliary_client + tests

auxiliary_client.py had its own regex mirroring _strip_think_blocks
but was missing the <thought> variant. Also adds test coverage for
<thought> paired and orphaned tags.
This commit is contained in:
Teknium 2026-04-12 12:38:24 -07:00 committed by Teknium
parent 326d5febe5
commit 400fe9b2a1
2 changed files with 13 additions and 2 deletions

View file

@ -302,6 +302,17 @@ class TestStripThinkBlocks:
assert "<think>" not in result
assert "visible" in result
def test_thought_block_removed(self, agent):
"""Gemma 4 uses <thought> tags for inline reasoning."""
result = agent._strip_think_blocks("<thought>internal reasoning</thought> answer")
assert "internal reasoning" not in result
assert "<thought>" not in result
assert "answer" in result
def test_orphaned_thought_tag(self, agent):
result = agent._strip_think_blocks("<thought>orphaned reasoning without close")
assert "<thought>" not in result
class TestExtractReasoning:
def test_reasoning_field(self, agent):