diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py index ab4a078d92..b82c262485 100644 --- a/studio/backend/core/inference/llama_cpp.py +++ b/studio/backend/core/inference/llama_cpp.py @@ -217,7 +217,7 @@ def _has_unclosed_code_fence(text: str) -> bool: if not m: continue fence = m.group("backticks") or m.group("tildes") - trailing = line[m.end():].strip() + trailing = line[m.end() :].strip() ch = fence[0] if active_char is None: active_char = ch diff --git a/studio/backend/tests/test_llama_cpp_reprompt_guard.py b/studio/backend/tests/test_llama_cpp_reprompt_guard.py index 94a368a7ea..7ec3464cad 100644 --- a/studio/backend/tests/test_llama_cpp_reprompt_guard.py +++ b/studio/backend/tests/test_llama_cpp_reprompt_guard.py @@ -875,9 +875,7 @@ def test_same_line_open_fence_with_numbered_body_still_reprompts(): fallback. The unclosed-fence helper now uses ``search`` so inline openers are tracked, not just openers at column 0.""" content = ( - "First, let me write it. ```text\n" - "1. Install dependencies\n" - "2. Run the app" + "First, let me write it. ```text\n" "1. Install dependencies\n" "2. Run the app" ) assert not _has_answer_artifact(content) assert _would_reprompt(content) @@ -909,11 +907,7 @@ def test_reprompts_on_first_step_numbered_compute_plan(): "1. Load rows.\n" "2. Compute the total." ), - ( - "I'll look that up:\n" - "1. Search the docs.\n" - "2. Summarize the result." - ), + ("I'll look that up:\n" "1. Search the docs.\n" "2. Summarize the result."), ] for content in samples: assert _would_reprompt(content), content