From a251ca73acd5f04ed4614578e7ae5879da338f19 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:20:39 +0000 Subject: [PATCH 1/2] fix(typing): resolve mypy errors in agent.gns3_copilot.agent.context_manager --- gns3server/agent/gns3_copilot/agent/context_manager.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gns3server/agent/gns3_copilot/agent/context_manager.py b/gns3server/agent/gns3_copilot/agent/context_manager.py index 79c526dbf..5337c3d95 100644 --- a/gns3server/agent/gns3_copilot/agent/context_manager.py +++ b/gns3server/agent/gns3_copilot/agent/context_manager.py @@ -140,7 +140,7 @@ def estimate_tool_tokens(tools: list[Any]) -> int: for tool in tools: try: # Build tool schema in OpenAI format - tool_schema = { + tool_schema: dict[str, Any] = { "type": "function", "function": { "name": tool.name, diff --git a/pyproject.toml b/pyproject.toml index 258447eb6..909ed64d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -295,7 +295,6 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] # Remove modules from this list one small PR at a time. Never add new ones. module = [ "gns3server.agent", # 2 - "gns3server.agent.gns3_copilot.agent.context_manager", # 5 "gns3server.agent.gns3_copilot.agent.model_factory", # 4 "gns3server.agent.gns3_copilot.chat_sessions_repository", # 8 "gns3server.agent.gns3_copilot.gns3_client.api_handlers", # 10 From cd7f5ab8e95b65c004f91d0e99316f776d6cbf83 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:20:33 +0000 Subject: [PATCH 2/2] fix(typing): resolve mypy errors in agent.gns3_copilot.agent.model_factory --- gns3server/agent/gns3_copilot/agent/model_factory.py | 4 ++-- pyproject.toml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gns3server/agent/gns3_copilot/agent/model_factory.py b/gns3server/agent/gns3_copilot/agent/model_factory.py index cfdc26854..f790646bd 100644 --- a/gns3server/agent/gns3_copilot/agent/model_factory.py +++ b/gns3server/agent/gns3_copilot/agent/model_factory.py @@ -110,7 +110,7 @@ def create_base_model( try: # Prepare parameters for init_chat_model - init_params = { + init_params: dict[str, Any] = { "model": config_vars["model_name"], "model_provider": config_vars["model_provider"], "api_key": config_vars["api_key"], @@ -177,7 +177,7 @@ def create_title_model( try: # Prepare parameters for init_chat_model - init_params = { + init_params: dict[str, Any] = { "model": config_vars["model_name"], "model_provider": config_vars["model_provider"], "api_key": config_vars["api_key"], diff --git a/pyproject.toml b/pyproject.toml index 909ed64d9..ee3fb2bbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -295,7 +295,6 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] # Remove modules from this list one small PR at a time. Never add new ones. module = [ "gns3server.agent", # 2 - "gns3server.agent.gns3_copilot.agent.model_factory", # 4 "gns3server.agent.gns3_copilot.chat_sessions_repository", # 8 "gns3server.agent.gns3_copilot.gns3_client.api_handlers", # 10 "gns3server.agent.gns3_copilot.gns3_client.connector_factory", # 1