vibe/tests/acp/test_tool_call_session_update.py
Mathias Gesbert 1fd7eea289
v2.9.1 (#644)
Co-authored-by: Brice Carpentier <brice.carpentier@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Lucas Marandat <31749711+lucasmrdt@users.noreply.github.com>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-04-29 17:20:27 +02:00

45 lines
1.4 KiB
Python

from __future__ import annotations
from acp.schema import ToolCallStart
from vibe.acp.tools.builtins.read_file import ReadFile
from vibe.acp.tools.session_update import tool_call_session_update
from vibe.core.tools.builtins.read_file import ReadFileArgs
from vibe.core.types import ToolCallEvent
class TestToolCallSessionUpdate:
def _create_event(self) -> ToolCallEvent:
return ToolCallEvent(
tool_name="read_file",
tool_call_id="test_call_123",
args=ReadFileArgs(path="/tmp/test.txt"),
tool_class=ReadFile,
)
def test_returns_tool_call_start(self) -> None:
event = self._create_event()
update = tool_call_session_update(event)
assert update is not None
assert isinstance(update, ToolCallStart)
assert update.session_update == "tool_call"
assert update.tool_call_id == "test_call_123"
def test_returns_tool_call_start_for_streaming_event(self) -> None:
event = ToolCallEvent(
tool_name="read_file",
tool_call_id="test_call_123",
tool_class=ReadFile,
args=None,
)
update = tool_call_session_update(event)
assert update is not None
assert isinstance(update, ToolCallStart)
assert update.session_update == "tool_call"
assert update.tool_call_id == "test_call_123"
assert update.kind == "read"
assert update.raw_input is None