|
17 | 17 | from hatch.installers.dependency_installation_orchestrator import DependencyInstallerOrchestrator |
18 | 18 | from hatch.installers.installation_context import InstallationContext |
19 | 19 | from hatch.python_environment_manager import PythonEnvironmentManager, PythonEnvironmentError |
| 20 | +from hatch.mcp_host_config.models import MCPServerConfig |
20 | 21 |
|
21 | 22 | class HatchEnvironmentError(Exception): |
22 | 23 | """Exception raised for environment-related errors.""" |
@@ -724,7 +725,7 @@ def clear_host_from_all_packages_all_envs(self, hostname: str) -> int: |
724 | 725 | self.logger.error(f"Failed to clear host from all packages: {e}") |
725 | 726 | return 0 |
726 | 727 |
|
727 | | - def apply_restored_host_configuration_to_environments(self, hostname: str, restored_servers: dict) -> int: |
| 728 | + def apply_restored_host_configuration_to_environments(self, hostname: str, restored_servers: Dict[str, MCPServerConfig]) -> int: |
728 | 729 | """Update environment tracking to match restored host configuration. |
729 | 730 |
|
730 | 731 | Args: |
@@ -754,7 +755,7 @@ def apply_restored_host_configuration_to_environments(self, hostname: str, resto |
754 | 755 | "config_path": self._get_host_config_path(hostname), |
755 | 756 | "configured_at": configured_hosts.get(hostname, {}).get("configured_at", current_time), |
756 | 757 | "last_synced": current_time, |
757 | | - "server_config": server_config |
| 758 | + "server_config": server_config.model_dump(exclude_none=True) |
758 | 759 | } |
759 | 760 | updates_count += 1 |
760 | 761 | self.logger.info(f"Updated host {hostname} tracking for package {package_name} in env {env_name}") |
|
0 commit comments