chore(lint): Apply comprehensive linting and formatting fixes (#10287)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang
2025-08-13 15:13:19 -04:00
committed by GitHub
parent e39bf80239
commit c2f46200c0
164 changed files with 526 additions and 1023 deletions

View File

@@ -39,8 +39,7 @@ USER_MICROAGENTS_DIR = Path.home() / '.openhands' / 'microagents'
class Memory:
"""
Memory is a component that listens to the EventStream for information retrieval actions
"""Memory is a component that listens to the EventStream for information retrieval actions
(a RecallAction) and publishes observations with the content (such as RecallObservation).
"""
@@ -145,7 +144,6 @@ class Memory:
This method collects information from all available repo microagents and concatenates their contents.
Multiple repo microagents are supported, and their contents will be concatenated with newlines between them.
"""
# Create WORKSPACE_CONTEXT info:
# - repository_info
# - runtime_info
@@ -211,7 +209,6 @@ class Memory:
event: RecallAction,
) -> RecallObservation | None:
"""When a microagent action triggers microagents, create a RecallObservation with structured data."""
# Find any matched microagents based on the query
microagent_knowledge = self._find_microagent_knowledge(event.query)
@@ -257,8 +254,7 @@ class Memory:
def load_user_workspace_microagents(
self, user_microagents: list[BaseMicroagent]
) -> None:
"""
This method loads microagents from a user's cloned repo or workspace directory.
"""This method loads microagents from a user's cloned repo or workspace directory.
This is typically called from agent_session or setup once the workspace is cloned.
"""
@@ -272,9 +268,7 @@ class Memory:
self.repo_microagents[user_microagent.name] = user_microagent
def _load_global_microagents(self) -> None:
"""
Loads microagents from the global microagents_dir
"""
"""Loads microagents from the global microagents_dir"""
repo_agents, knowledge_agents = load_microagents_from_dir(
GLOBAL_MICROAGENTS_DIR
)
@@ -284,8 +278,7 @@ class Memory:
self.repo_microagents[name] = agent_repo
def _load_user_microagents(self) -> None:
"""
Loads microagents from the user's home directory (~/.openhands/microagents/)
"""Loads microagents from the user's home directory (~/.openhands/microagents/)
Creates the directory if it doesn't exist.
"""
try:
@@ -307,8 +300,7 @@ class Memory:
)
def get_microagent_mcp_tools(self) -> list[MCPConfig]:
"""
Get MCP tools from all repo microagents (always active)
"""Get MCP tools from all repo microagents (always active)
Returns:
A list of MCP tools configurations from microagents
@@ -365,8 +357,7 @@ class Memory:
def set_conversation_instructions(
self, conversation_instructions: str | None
) -> None:
"""
Set contextual information for conversation
"""Set contextual information for conversation
This is information the agent may require
"""
self.conversation_instructions = ConversationInstructions(