From 5e213963dc97a92056b42bd00fd74f02f530f7d9 Mon Sep 17 00:00:00 2001 From: Graham Neubig Date: Thu, 26 Jun 2025 23:43:13 -0400 Subject: [PATCH] Fix typing --- openhands/memory/memory.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/openhands/memory/memory.py b/openhands/memory/memory.py index 276a459432..74ae47148b 100644 --- a/openhands/memory/memory.py +++ b/openhands/memory/memory.py @@ -270,17 +270,13 @@ class Memory: """ Loads microagents from the global microagents_dir """ - repo_agents_dict, knowledge_agents_dict = load_microagents_from_dir( + repo_agents, knowledge_agents = load_microagents_from_dir( GLOBAL_MICROAGENTS_DIR ) - # See https://github.com/python/mypy/issues/18440 for type narrowing issue with dict items - for name, agent_obj in knowledge_agents_dict.items(): # type: ignore[assignment] - if isinstance(agent_obj, KnowledgeMicroagent): - self.knowledge_microagents[name] = agent_obj - # See https://github.com/python/mypy/issues/18440 for type narrowing issue with dict items - for name, agent_obj in repo_agents_dict.items(): # type: ignore[assignment] - if isinstance(agent_obj, RepoMicroagent): - self.repo_microagents[name] = agent_obj + for name, agent_knowledge in knowledge_agents.items(): + self.knowledge_microagents[name] = agent_knowledge + for name, agent_repo in repo_agents.items(): + self.repo_microagents[name] = agent_repo def _load_user_microagents(self) -> None: """