Co-authored-by: Carlo <carloantonio.patti@mistral.ai>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Clement Sirieix <clem.sirieix@gmail.com>
Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai>
Co-authored-by: Thomas Kenbeek <thomas.kenbeek@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Quentin 2026-02-27 17:31:58 +01:00 committed by GitHub
parent a560a47ce8
commit 5d2e01a6d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 7152 additions and 1457 deletions

View file

@ -0,0 +1,44 @@
from __future__ import annotations
from acp.schema import ToolCallStart
from vibe.acp.tools.session_update import tool_call_session_update
from vibe.core.tools.builtins.read_file import ReadFile, 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