From c7c7e3b5839e0825aa11262a9cdae4102919e901 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:00:35 +0000 Subject: [PATCH 1/3] fix(typing): resolve mypy errors in agent.gns3_copilot.skills.loader --- gns3server/agent/gns3_copilot/skills/loader.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gns3server/agent/gns3_copilot/skills/loader.py b/gns3server/agent/gns3_copilot/skills/loader.py index 655d76263..0295e2520 100644 --- a/gns3server/agent/gns3_copilot/skills/loader.py +++ b/gns3server/agent/gns3_copilot/skills/loader.py @@ -248,7 +248,7 @@ class SkillsLoader: continue # Use device_type from YAML content as the key # Fallback to filename stem if device_type not present - skill_key = skill_data.get("device_type") if isinstance(skill_data, dict) else None + skill_key = skill_data.get("device_type") if not skill_key: skill_key = yaml_file.stem logger.warning(f"No device_type in {yaml_file}, using filename '{skill_key}' as key") diff --git a/pyproject.toml b/pyproject.toml index 5f0789a77..0c02c3d5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -302,7 +302,6 @@ module = [ "gns3server.agent.gns3_copilot.gns3_client.api_handlers", # 10 "gns3server.agent.gns3_copilot.gns3_client.connector_factory", # 1 "gns3server.agent.gns3_copilot.gns3_client.project_inventory", # 2 - "gns3server.agent.gns3_copilot.skills.loader", # 1 "gns3server.agent.gns3_copilot.skills.manager", # 4 "gns3server.agent.gns3_copilot.tools_v2.config_tools_nornir", # 6 "gns3server.agent.gns3_copilot.tools_v2.display_tools_nornir", # 6 From d6ae597f366bdbf1e70ac02fdf1e08e364cf3a43 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:21:57 +0000 Subject: [PATCH 2/3] fix(typing): resolve mypy errors in agent.gns3_copilot.skills.manager --- .../agent/gns3_copilot/skills/manager.py | 18 ++++++++++-------- pyproject.toml | 1 - 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gns3server/agent/gns3_copilot/skills/manager.py b/gns3server/agent/gns3_copilot/skills/manager.py index 473fb2b09..1a511ec29 100644 --- a/gns3server/agent/gns3_copilot/skills/manager.py +++ b/gns3server/agent/gns3_copilot/skills/manager.py @@ -37,8 +37,10 @@ from typing import Optional, Dict, Any try: import git + + GIT_AVAILABLE = True except ImportError: - git = None + GIT_AVAILABLE = False from gns3server.config import Config from .loader import SkillsLoader @@ -66,7 +68,7 @@ class SkillsManager: - Version tracking """ - def __init__(self, repo_url: str = None, branch: str = "main", auto_update: bool = False): + def __init__(self, repo_url: Optional[str] = None, branch: str = "main", auto_update: bool = False): """ Initialize the skills manager. @@ -90,7 +92,7 @@ class SkillsManager: self._repo: Optional["git.Repo"] = None self._prompt_count = 0 - if git is None: + if not GIT_AVAILABLE: logger.warning("GitPython is not installed. Skills management features will be limited.") def initialize(self) -> bool: @@ -134,7 +136,7 @@ class SkillsManager: - Up to date → nothing - Network error → use existing files, log warning """ - if git is None or self._repo is None: + if not GIT_AVAILABLE or self._repo is None: return # Check for uncommitted changes @@ -173,7 +175,7 @@ class SkillsManager: Returns: True if successful, False otherwise """ - if git is None: + if not GIT_AVAILABLE: logger.error("GitPython is not installed. Cannot clone repository.") return False @@ -347,7 +349,7 @@ class SkillsManager: Returns: Commit hash as string, or empty string if not available """ - if git is None or self._repo is None: + if not GIT_AVAILABLE or self._repo is None: try: self._repo = git.Repo(self.local_path) except Exception: @@ -409,7 +411,7 @@ class SkillsManager: Returns: True if successful, False otherwise """ - if git is None: + if not GIT_AVAILABLE: logger.error("GitPython is not installed. Cannot rollback.") return False @@ -436,7 +438,7 @@ class SkillsManager: Returns: List of commit information dictionaries """ - if git is None: + if not GIT_AVAILABLE: return [] try: diff --git a/pyproject.toml b/pyproject.toml index 0c02c3d5a..bab14b8c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -302,7 +302,6 @@ module = [ "gns3server.agent.gns3_copilot.gns3_client.api_handlers", # 10 "gns3server.agent.gns3_copilot.gns3_client.connector_factory", # 1 "gns3server.agent.gns3_copilot.gns3_client.project_inventory", # 2 - "gns3server.agent.gns3_copilot.skills.manager", # 4 "gns3server.agent.gns3_copilot.tools_v2.config_tools_nornir", # 6 "gns3server.agent.gns3_copilot.tools_v2.display_tools_nornir", # 6 "gns3server.agent.gns3_copilot.tools_v2.gns3_packet_filter", # 1 From a51af4a32eedecd8a803ab423f4a97581595db53 Mon Sep 17 00:00:00 2001 From: Jeremy Grossmann Date: Tue, 29 Sep 2026 12:35:33 +0200 Subject: [PATCH 3/3] Fix module list after merging Removed unused modules from the project configuration. --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6677635c2..1bb396c59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -297,10 +297,6 @@ module = [ "gns3server.agent", # 2 "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 - "gns3server.agent.gns3_copilot.gns3_client.project_inventory", # 2 - "gns3server.agent.gns3_copilot.skills.loader", # 1 - "gns3server.agent.gns3_copilot.skills.manager", # 4 "gns3server.agent.gns3_copilot.tools_v2.config_tools_nornir", # 6 "gns3server.agent.gns3_copilot.tools_v2.display_tools_nornir", # 6 "gns3server.agent.gns3_copilot.tools_v2.gns3_packet_filter", # 1