feat: add support for Windows-only tools and enhance platform checks
Some checks failed
CI / test (push) Failing after 10s

This commit is contained in:
Space-Banane
2026-05-31 21:02:56 +02:00
parent d514fe161c
commit f0058d1057
2 changed files with 28 additions and 3 deletions

View File

@@ -752,6 +752,23 @@ def test_tool_schemas_hide_optional_native_tools_when_mode_off(tmp_path: Path, m
assert "list_ui_elements" not in schemas
def test_tool_schemas_hide_windows_only_tools_on_non_windows_host(tmp_path: Path, monkeypatch) -> None:
agent = _build_agent(tmp_path, monkeypatch)
monkeypatch.setattr(agent_module.sys, "platform", "linux")
schemas = {tool["name"]: tool for tool in agent._tool_schemas()}
assert "get_active_window" not in schemas
assert "list_windows" not in schemas
assert "detect_dialog" not in schemas
assert "list_ui_elements" not in schemas
result = agent._dispatch_tool("get_active_window", {})
assert result["ok"] is False
assert result["error"] == "Tool 'get_active_window' is only available on Windows."
def test_list_windows_returns_structured_surface_metadata(tmp_path: Path, monkeypatch) -> None:
agent = _build_agent(tmp_path, monkeypatch)
monkeypatch.setattr(