fix(cli): add <THINKING> to streaming tag suppression list

Anthropic native models emit <THINKING> tags in text content (separate
from the SDK's thinking_delta events). Without suppression, these tags
leak into the streamed CLI output. Found during live provider testing.
This commit is contained in:
teknium1 2026-03-16 07:34:29 -07:00
parent 8e07f9ca56
commit fc4080c58a

4
cli.py
View file

@ -1431,8 +1431,8 @@ class HermesCLI:
# These tags are model-generated (system prompt tells the model
# to use them) and get stripped from final_response. We must
# suppress them during streaming too.
_OPEN_TAGS = ("<REASONING_SCRATCHPAD>", "<think>", "<reasoning>")
_CLOSE_TAGS = ("</REASONING_SCRATCHPAD>", "</think>", "</reasoning>")
_OPEN_TAGS = ("<REASONING_SCRATCHPAD>", "<think>", "<reasoning>", "<THINKING>")
_CLOSE_TAGS = ("</REASONING_SCRATCHPAD>", "</think>", "</reasoning>", "</THINKING>")
# Append to a pre-filter buffer first
self._stream_prefilt = getattr(self, "_stream_prefilt", "") + text