Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Clément Sirieix 2026-04-21 15:19:59 +02:00 committed by GitHub
parent 95336528f6
commit 04305bd77c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 3473 additions and 1764 deletions

View file

@ -29,6 +29,12 @@ _FAKE_CONNECTORS = {
],
}
_FAKE_CONNECTORS_MIXED_CONNECTION = {
"zeta": [],
"alpha": [RemoteTool(name="lookup", description="Lookup Alpha records")],
"beta": [],
}
class SnapshotTestAppNoMcpServers(BaseSnapshotTestApp):
def __init__(self) -> None:
@ -174,6 +180,20 @@ def test_snapshot_mcp_escape_closes(snap_compare: SnapCompare) -> None:
)
def test_snapshot_mcp_refresh_shortcut(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await _run_mcp_command(pilot, "/mcp")
await pilot.press("r")
await pilot.pause(0.2)
with patch(_MCP_PATCH, FakeMCPRegistry):
assert snap_compare(
"test_ui_snapshot_mcp_command.py:SnapshotTestAppWithMcpServers",
terminal_size=(120, 36),
run_before=run_before,
)
# ---------------------------------------------------------------------------
# Apps with connectors
# ---------------------------------------------------------------------------
@ -203,6 +223,17 @@ class SnapshotTestAppConnectorsOnly(BaseSnapshotTestApp):
self.agent_loop.tool_manager.integrate_connectors()
class SnapshotTestAppConnectorsMixedState(BaseSnapshotTestApp):
def __init__(self) -> None:
config = default_config()
config.mcp_servers = []
super().__init__(config=config)
registry = FakeConnectorRegistry(connectors=_FAKE_CONNECTORS_MIXED_CONNECTION)
self.agent_loop.connector_registry = registry
self.agent_loop.tool_manager._connector_registry = registry
self.agent_loop.tool_manager.integrate_connectors()
# ---------------------------------------------------------------------------
# Connector snapshot tests
# ---------------------------------------------------------------------------
@ -235,6 +266,19 @@ def test_snapshot_mcp_connectors_only(snap_compare: SnapCompare) -> None:
)
@patch.dict("os.environ", {CONNECTORS_ENV_VAR: "1"})
def test_snapshot_mcp_connectors_sorted_by_status(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await _run_mcp_command(pilot, "/mcp")
assert snap_compare(
"test_ui_snapshot_mcp_command.py:SnapshotTestAppConnectorsMixedState",
terminal_size=(120, 36),
run_before=run_before,
)
@patch.dict("os.environ", {CONNECTORS_ENV_VAR: "1"})
def test_snapshot_mcp_drill_into_connector(snap_compare: SnapCompare) -> None: