From 8508d2aea9ca455edbcb4818ef3c84a88128e21e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 08:01:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../backend/tests/test_context_compaction_edge.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/studio/backend/tests/test_context_compaction_edge.py b/studio/backend/tests/test_context_compaction_edge.py index d1e60f662e..4f9c368d80 100644 --- a/studio/backend/tests/test_context_compaction_edge.py +++ b/studio/backend/tests/test_context_compaction_edge.py @@ -690,7 +690,7 @@ def test_compact_drops_orphan_tool_left_by_user_boundary(): {"role": "user", "content": "again"}, {"role": "tool", "tool_call_id": "t1", "content": "stale"}, ] - out = SlidingWindowCompact(keep_recent=2).compact(msgs, budget_tokens=1) + out = SlidingWindowCompact(keep_recent = 2).compact(msgs, budget_tokens = 1) # Any surviving tool message must have its assistant earlier in # the output. seen_ids: set[str] = set() @@ -702,9 +702,9 @@ def test_compact_drops_orphan_tool_left_by_user_boundary(): seen_ids.add(tcid) elif m.get("role") == "tool": tcid = m.get("tool_call_id") - assert isinstance(tcid, str) and tcid in seen_ids, ( - f"orphan tool {tcid!r} survived; seen={seen_ids}" - ) + assert ( + isinstance(tcid, str) and tcid in seen_ids + ), f"orphan tool {tcid!r} survived; seen={seen_ids}" def test_compact_does_not_drop_anchored_multimodal_tool(): @@ -725,8 +725,6 @@ def test_compact_does_not_drop_anchored_multimodal_tool(): {"role": "user", "content": "more"}, {"role": "user", "content": "even more"}, ] - out = SlidingWindowCompact(keep_recent=2).compact(msgs, budget_tokens=1) + out = SlidingWindowCompact(keep_recent = 2).compact(msgs, budget_tokens = 1) # The anchored tool survives. - assert any( - m.get("role") == "tool" and m.get("tool_call_id") == "t1" for m in out - ) + assert any(m.get("role") == "tool" and m.get("tool_call_id") == "t1" for m in out)