Co-authored-by: Albert Jiang <aj@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Laure Hugo <201583486+laure0303@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Mert Unsal <mert.unsal@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@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>
This commit is contained in:
maiengineering 2026-07-01 19:03:09 +02:00 committed by GitHub
parent 4e495f658d
commit ac8f1a09fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
83 changed files with 1979 additions and 572 deletions

View file

@ -16,7 +16,7 @@ from tests.stubs.fake_mcp_registry import FakeMCPRegistry
from vibe.core import agent_loop as agent_loop_module
from vibe.core.agent_loop import AgentLoop
from vibe.core.config import MCPStdio
from vibe.core.telemetry.types import TerminalEmulator
from vibe.core.telemetry.types import LaunchContext, TerminalEmulator
from vibe.core.tools.manager import ToolManager
from vibe.core.tools.mcp import AuthStatus
from vibe.core.tools.remote import RemoteTool
@ -371,7 +371,15 @@ class TestStartInitializeExperiments:
@pytest.mark.asyncio
async def test_refreshes_system_prompt_when_experiments_update(self) -> None:
loop = build_test_agent_loop(terminal_emulator=TerminalEmulator.VSCODE)
loop = build_test_agent_loop(
launch_context=LaunchContext(
agent_entrypoint="cli",
agent_version="1.0.0",
client_name="vibe_cli",
client_version="1.0.0",
terminal_emulator=TerminalEmulator.VSCODE,
)
)
refresh_mock = AsyncMock()
init_mock = AsyncMock(return_value=True)
@ -387,21 +395,31 @@ class TestStartInitializeExperiments:
init_mock.assert_awaited_once()
init_args = init_mock.await_args
assert init_args is not None
assert init_args.kwargs["terminal_emulator"] is TerminalEmulator.VSCODE
assert (
init_args.kwargs["launch_context"].terminal_emulator
is TerminalEmulator.VSCODE
)
def test_new_session_telemetry_uses_provided_terminal_emulator(self) -> None:
loop = build_test_agent_loop(terminal_emulator=TerminalEmulator.VSCODE)
send_new_session = MagicMock()
loop = build_test_agent_loop(
launch_context=LaunchContext(
agent_entrypoint="cli",
agent_version="1.0.0",
client_name="vibe_cli",
client_version="1.0.0",
terminal_emulator=TerminalEmulator.VSCODE,
)
)
send_event = MagicMock()
with patch.object(
loop.telemetry_client, "send_new_session", new=send_new_session
loop.telemetry_client, "send_telemetry_event", new=send_event
):
loop.emit_new_session_telemetry()
assert (
send_new_session.call_args.kwargs["terminal_emulator"]
is TerminalEmulator.VSCODE
)
payload = send_event.call_args.args[1]
assert payload["terminal_emulator"] == "vscode"
assert type(payload["terminal_emulator"]) is str
@pytest.mark.asyncio
async def test_does_not_refresh_system_prompt_when_experiments_unchanged(