[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
66a9ee258d
commit
affdf24ce7
3 changed files with 16 additions and 15 deletions
|
|
@ -554,6 +554,7 @@ TERMINAL_TOOL = {
|
|||
},
|
||||
}
|
||||
|
||||
|
||||
# Lazy import: don't pull rag stack on inference paths that never see RAG.
|
||||
def _get_rag_tool_spec():
|
||||
from core.rag.tool import SEARCH_KNOWLEDGE_BASE_TOOL
|
||||
|
|
|
|||
|
|
@ -265,9 +265,9 @@ def test_consume_refresh_token_concurrent_only_one_succeeds(tmp_path, monkeypatc
|
|||
results = list(pool.map(attempt, range(workers)))
|
||||
|
||||
successes = [r for r in results if r is not None]
|
||||
assert len(successes) == 1, (
|
||||
f"expected exactly one consumer to win, got {len(successes)}"
|
||||
)
|
||||
assert (
|
||||
len(successes) == 1
|
||||
), f"expected exactly one consumer to win, got {len(successes)}"
|
||||
assert successes[0] == (storage.DEFAULT_ADMIN_USERNAME, False)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -508,9 +508,9 @@ class TestLoopBehaviour:
|
|||
tool_msgs = [m for m in captured[1] if m.get("role") == "tool"]
|
||||
assert tool_msgs, "no tool message reached the model"
|
||||
for tm in tool_msgs:
|
||||
assert "__IMAGES__" not in tm["content"], (
|
||||
f"sentinel leaked to model: {tm['content']!r}"
|
||||
)
|
||||
assert (
|
||||
"__IMAGES__" not in tm["content"]
|
||||
), f"sentinel leaked to model: {tm['content']!r}"
|
||||
|
||||
def test_image_sentinel_stripped_with_multiple_markers(self):
|
||||
# Consecutive sentinels: cut at the first, nothing leaks.
|
||||
|
|
@ -540,12 +540,12 @@ class TestLoopBehaviour:
|
|||
tool_msgs = [m for m in captured[1] if m.get("role") == "tool"]
|
||||
assert tool_msgs
|
||||
for tm in tool_msgs:
|
||||
assert "__IMAGES__" not in tm["content"], (
|
||||
f"second sentinel leaked: {tm['content']!r}"
|
||||
)
|
||||
assert tm["content"] == "panel", (
|
||||
f"expected payload-only 'panel', got {tm['content']!r}"
|
||||
)
|
||||
assert (
|
||||
"__IMAGES__" not in tm["content"]
|
||||
), f"second sentinel leaked: {tm['content']!r}"
|
||||
assert (
|
||||
tm["content"] == "panel"
|
||||
), f"expected payload-only 'panel', got {tm['content']!r}"
|
||||
|
||||
def test_tool_execution_error_is_emitted_but_loop_continues(self):
|
||||
loop, exec_fn = _make_loop(
|
||||
|
|
@ -668,9 +668,9 @@ class TestProseMentioningToolCall:
|
|||
contents = [e for e in events if e["type"] == "content"]
|
||||
assert contents, "expected at least one content event"
|
||||
final = contents[-1]["text"]
|
||||
assert "LLM tool" in final, (
|
||||
f"prose mentioning <tool_call> should not be truncated; got {final!r}"
|
||||
)
|
||||
assert (
|
||||
"LLM tool" in final
|
||||
), f"prose mentioning <tool_call> should not be truncated; got {final!r}"
|
||||
|
||||
def test_tool_result_with_tool_call_text_does_not_retrigger(self):
|
||||
# Tool result text contains the literal ``<tool_call>`` string.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue