Просмотр исходного кода

Fix issue #5591: Clean up unused code (#5592)

Co-authored-by: openhands <openhands@all-hands.dev>
Engel Nyst 1 год назад
Родитель
Сommit
ad822a31e1

+ 2 - 2
docs/modules/usage/micro-agents.md

@@ -14,7 +14,7 @@ Micro-agents are defined in markdown files under the `openhands/agenthub/codeact
 ## Available Micro-Agents
 
 ### GitHub Agent
-**File**: `github.md`  
+**File**: `github.md`
 **Triggers**: `github`, `git`
 
 The GitHub agent specializes in GitHub API interactions and repository management. It:
@@ -30,7 +30,7 @@ Key features:
 - API-first approach for GitHub operations
 
 ### NPM Agent
-**File**: `npm.md`  
+**File**: `npm.md`
 **Triggers**: `npm`
 
 Specializes in handling npm package management with specific focus on:

+ 1 - 1
docs/modules/usage/prompting-best-practices.md

@@ -90,7 +90,7 @@ When working with a customized repository:
 
 Example customized prompt:
 ```
-Add a new task completion feature to src/components/TaskList.tsx following our existing component patterns. 
+Add a new task completion feature to src/components/TaskList.tsx following our existing component patterns.
 Include unit tests in tests/components/ and update the documentation in docs/features/.
 The component should use our shared styling from src/styles/components.
 ```

+ 3 - 1
openhands/agenthub/codeact_agent/codeact_agent.py

@@ -166,7 +166,9 @@ class CodeActAgent(Agent):
 
             # Add the LLM message (assistant) that initiated the tool calls
             # (overwrites any previous message with the same response_id)
-            logger.debug(f'Tool calls type: {type(assistant_msg.tool_calls)}, value: {assistant_msg.tool_calls}')
+            logger.debug(
+                f'Tool calls type: {type(assistant_msg.tool_calls)}, value: {assistant_msg.tool_calls}'
+            )
             pending_tool_call_action_messages[llm_response.id] = Message(
                 role=assistant_msg.role,
                 # tool call content SHOULD BE a string

+ 0 - 2
openhands/core/schema/__init__.py

@@ -1,11 +1,9 @@
 from openhands.core.schema.action import ActionType
 from openhands.core.schema.agent import AgentState
-from openhands.core.schema.config import ConfigType
 from openhands.core.schema.observation import ObservationType
 
 __all__ = [
     'ActionType',
     'ObservationType',
-    'ConfigType',
     'AgentState',
 ]

+ 0 - 49
openhands/core/schema/config.py

@@ -1,49 +0,0 @@
-from enum import Enum
-
-
-class ConfigType(str, Enum):
-    # For frontend
-    AGENT = 'AGENT'
-    AGENT_MEMORY_ENABLED = 'AGENT_MEMORY_ENABLED'
-    AGENT_MEMORY_MAX_THREADS = 'AGENT_MEMORY_MAX_THREADS'
-    AWS_ACCESS_KEY_ID = 'AWS_ACCESS_KEY_ID'
-    AWS_REGION_NAME = 'AWS_REGION_NAME'
-    AWS_SECRET_ACCESS_KEY = 'AWS_SECRET_ACCESS_KEY'
-    BASE_CONTAINER_IMAGE = 'BASE_CONTAINER_IMAGE'
-    CACHE_DIR = 'CACHE_DIR'
-    CONFIRMATION_MODE = 'CONFIRMATION_MODE'
-    DEBUG = 'DEBUG'
-    DISABLE_COLOR = 'DISABLE_COLOR'
-    E2B_API_KEY = 'E2B_API_KEY'
-    FILE_UPLOADS_ALLOWED_EXTENSIONS = 'FILE_UPLOADS_ALLOWED_EXTENSIONS'
-    FILE_UPLOADS_MAX_FILE_SIZE_MB = 'FILE_UPLOADS_MAX_FILE_SIZE_MB'
-    FILE_UPLOADS_RESTRICT_FILE_TYPES = 'FILE_UPLOADS_RESTRICT_FILE_TYPES'
-    LLM_API_KEY = 'LLM_API_KEY'
-    LLM_API_VERSION = 'LLM_API_VERSION'
-    LLM_BASE_URL = 'LLM_BASE_URL'
-    LLM_CACHING_PROMPT = 'LLM_CACHING_PROMPT'
-    LLM_CUSTOM_LLM_PROVIDER = 'LLM_CUSTOM_LLM_PROVIDER'
-    LLM_DROP_PARAMS = 'LLM_DROP_PARAMS'
-    LLM_EMBEDDING_BASE_URL = 'LLM_EMBEDDING_BASE_URL'
-    LLM_EMBEDDING_DEPLOYMENT_NAME = 'LLM_EMBEDDING_DEPLOYMENT_NAME'
-    LLM_EMBEDDING_MODEL = 'LLM_EMBEDDING_MODEL'
-    LLM_MAX_INPUT_TOKENS = 'LLM_MAX_INPUT_TOKENS'
-    LLM_MAX_OUTPUT_TOKENS = 'LLM_MAX_OUTPUT_TOKENS'
-    LLM_MODEL = 'LLM_MODEL'
-    LLM_NUM_RETRIES = 'LLM_NUM_RETRIES'
-    LLM_RETRY_MAX_WAIT = 'LLM_RETRY_MAX_WAIT'
-    LLM_RETRY_MIN_WAIT = 'LLM_RETRY_MIN_WAIT'
-    LLM_TEMPERATURE = 'LLM_TEMPERATURE'
-    LLM_TIMEOUT = 'LLM_TIMEOUT'
-    LLM_TOP_P = 'LLM_TOP_P'
-    LLM_DISABLE_VISION = 'LLM_DISABLE_VISION'
-    MAX_ITERATIONS = 'MAX_ITERATIONS'
-    RUN_AS_OPENHANDS = 'RUN_AS_OPENHANDS'
-    SANDBOX_TIMEOUT = 'SANDBOX_TIMEOUT'
-    SANDBOX_USER_ID = 'SANDBOX_USER_ID'
-    SECURITY_ANALYZER = 'SECURITY_ANALYZER'
-    USE_HOST_NETWORK = 'USE_HOST_NETWORK'
-    WORKSPACE_BASE = 'WORKSPACE_BASE'
-    WORKSPACE_MOUNT_PATH = 'WORKSPACE_MOUNT_PATH'
-    WORKSPACE_MOUNT_PATH_IN_SANDBOX = 'WORKSPACE_MOUNT_PATH_IN_SANDBOX'
-    WORKSPACE_MOUNT_REWRITE = 'WORKSPACE_MOUNT_REWRITE'