From 5ead392a481b325ca720a63c51b9dfd3891c2fa1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:37:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/core/inference/llama_cpp.py | 12 +++--------- .../tests/test_conversation_recall_injection.py | 6 +++++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py index a1bba06305..7afecc1dd9 100644 --- a/studio/backend/core/inference/llama_cpp.py +++ b/studio/backend/core/inference/llama_cpp.py @@ -557,9 +557,7 @@ def _branch_boundary(conversation: list[dict], branch: Optional[list[dict]]) -> def _branch_non_system(branch: Optional[list[dict]]) -> list[dict]: """The branch as ``_branch_boundary`` counts it: system and developer turns removed.""" return [ - message - for message in (branch or ()) - if message.get("role") not in ("system", "developer") + message for message in (branch or ()) if message.get("role") not in ("system", "developer") ] @@ -21409,9 +21407,7 @@ class LlamaCppBackend: truncation = { **truncation, "boundary_messages": _branch_boundary(openai_messages, _before_fit), - "boundary_anchor": _branch_boundary_anchor( - openai_messages, _before_fit - ), + "boundary_anchor": _branch_boundary_anchor(openai_messages, _before_fit), } payload["messages"] = neutralize_control_markup_in_messages( openai_messages, None, self.markup_profile @@ -23467,9 +23463,7 @@ class LlamaCppBackend: truncation = { **truncation, "boundary_messages": _branch_boundary(conversation, _request_branch), - "boundary_anchor": _branch_boundary_anchor( - conversation, _request_branch - ), + "boundary_anchor": _branch_boundary_anchor(conversation, _request_branch), } # `fits` False too: it carries the diagnosis the client needs to explain # WHY. Otherwise the user only sees llama-server's error, which reports diff --git a/studio/backend/tests/test_conversation_recall_injection.py b/studio/backend/tests/test_conversation_recall_injection.py index 3802b001cf..5a078fabca 100644 --- a/studio/backend/tests/test_conversation_recall_injection.py +++ b/studio/backend/tests/test_conversation_recall_injection.py @@ -509,7 +509,11 @@ def test_sticky_boundary_prefers_the_recorded_branch_boundary(monkeypatch): assert llama_cpp._sticky_compaction_boundary("t1") == 4 -def _anchored_row(boundary, anchor, content = "a"): +def _anchored_row( + boundary, + anchor, + content = "a", +): return { "role": "assistant", "content": content,