FFFFFFF [100%] =================================== FAILURES =================================== __ TestCleanupAgentResourcesPassesMessages.test_populated_messages_forwarded ___ self = def test_populated_messages_forwarded(self): """Real-world path: an agent that ran a turn has a populated ``_session_messages`` list and the cleanup call forwards it.""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:65: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError ___ TestCleanupAgentResourcesPassesMessages.test_empty_list_still_forwarded ____ self = def test_empty_list_still_forwarded(self): """An agent that initialised but ran no turns has an empty list on ``_session_messages``. Forwarding it (rather than falling through to the no-arg path) makes the absence of content explicit to providers and matches the pre-fix observable behaviour (``on_session_end([])``).""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:84: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError _ TestCleanupAgentResourcesPassesMessages.test_missing_attribute_falls_back_to_no_arg _ self = def test_missing_attribute_falls_back_to_no_arg(self): """Test stubs built via ``object.__new__(AIAgent)`` skip ``__init__`` and therefore have no ``_session_messages`` attribute. The fix must not explode — it falls back to the legacy no-arg call so existing suites keep passing.""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError _ TestCleanupAgentResourcesPassesMessages.test_non_list_attribute_falls_back_to_no_arg _ self = def test_non_list_attribute_falls_back_to_no_arg(self): """A MagicMock-based agent auto-synthesises ``_session_messages`` as a nested MagicMock. ``isinstance(mock, list)`` is False, so we fall back to the no-arg path rather than passing a garbage value to providers that expect ``List[Dict]``.""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:108: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError _ TestCleanupAgentResourcesPassesMessages.test_provider_exception_is_swallowed _ self = def test_provider_exception_is_swallowed(self): """Provider teardown must be best-effort — a raising ``shutdown_memory_provider`` must not prevent ``close()`` from running (tool resource leak is worse than a missed memory flush).""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:122: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError _______ TestCleanupAgentResourcesPassesMessages.test_none_agent_is_noop ________ self = def test_none_agent_is_noop(self): """Defensive: None agent short-circuits (idle sweeps may observe a None entry in the cache during eviction races).""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:135: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError _ TestCleanupAgentResourcesPassesMessages.test_agent_without_shutdown_method_is_tolerated _ self = def test_agent_without_shutdown_method_is_tolerated(self): """An agent without ``shutdown_memory_provider`` (old test stub, partial mock) must still have ``close()`` called.""" > runner = _make_runner() ^^^^^^^^^^^^^^ tests/gateway/test_shutdown_memory_provider_messages.py:142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/gateway/test_shutdown_memory_provider_messages.py:38: in _make_runner from gateway.run import GatewayRunner gateway/__init__.py:12: in from .config import ( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ Gateway configuration management. Handles loading and validating configuration for: - Connected platforms (Telegram, Discord, WhatsApp, Weixin, and more) - Home channels for each platform - Session reset policies - Delivery preferences """ import hashlib import io import logging import os import json import stat from pathlib import Path from dataclasses import dataclass, field from typing import Dict, List, Optional, Any, Callable, Mapping from enum import Enum import yaml > from dotenv import dotenv_values E ImportError: cannot import name 'dotenv_values' from 'dotenv' (unknown location) gateway/config.py:23: ImportError =========================== short test summary info ============================ FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_populated_messages_forwarded FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_empty_list_still_forwarded FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_missing_attribute_falls_back_to_no_arg FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_non_list_attribute_falls_back_to_no_arg FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_provider_exception_is_swallowed FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_none_agent_is_noop FAILED tests/gateway/test_shutdown_memory_provider_messages.py::TestCleanupAgentResourcesPassesMessages::test_agent_without_shutdown_method_is_tolerated 7 failed in 0.38s