[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-05-24 15:36:20 +00:00
commit 693bd89a79
2 changed files with 13 additions and 10 deletions

View file

@ -4917,12 +4917,14 @@ class LlamaCppBackend:
_visible = content_accum.strip()
_reasoning = reasoning_accum.strip()
_stripped = _visible if _visible else _reasoning
_artifact_text = _visible if _visible else (
_reasoning if not has_content_tokens else ""
_artifact_text = (
_visible
if _visible
else (_reasoning if not has_content_tokens else "")
)
_visible_has_artifact = bool(_artifact_text) and _has_answer_artifact(
_visible_has_artifact = bool(
_artifact_text
)
) and _has_answer_artifact(_artifact_text)
if (
tools
and _reprompt_count < _MAX_REPROMPTS

View file

@ -672,7 +672,9 @@ def test_reasoning_only_visible_artifact_suppresses_reprompt():
visible = content_accum.strip()
reasoning = reasoning_accum.strip()
stripped = visible if visible else reasoning
artifact_text = visible if visible else (reasoning if not has_content_tokens else "")
artifact_text = (
visible if visible else (reasoning if not has_content_tokens else "")
)
would_reprompt = bool(
0 < len(stripped) < _REPROMPT_MAX_CHARS
and _INTENT_SIGNAL.search(stripped)
@ -689,17 +691,16 @@ def test_hidden_reasoning_artifact_still_reprompts():
content_accum = ""
reasoning_accum = (
"First, let me draft it.\n"
"```python\n"
"print('hidden answer')\n"
"```"
"First, let me draft it.\n" "```python\n" "print('hidden answer')\n" "```"
)
has_content_tokens = True # content existed but was stripped
visible = content_accum.strip()
reasoning = reasoning_accum.strip()
stripped = visible if visible else reasoning
artifact_text = visible if visible else (reasoning if not has_content_tokens else "")
artifact_text = (
visible if visible else (reasoning if not has_content_tokens else "")
)
would_reprompt = bool(
0 < len(stripped) < _REPROMPT_MAX_CHARS
and _INTENT_SIGNAL.search(stripped)