Multi-Language Code Execution Support for Coder Agent#26
Open
AryanGurav106 wants to merge 24 commits intomainfrom
Open
Multi-Language Code Execution Support for Coder Agent#26AryanGurav106 wants to merge 24 commits intomainfrom
AryanGurav106 wants to merge 24 commits intomainfrom
Conversation
✅ **Implemented MCP integration in Cortexon using `pydantic-ai-mcp`** - The **Orchestrator Agent** now acts as the **MCP client**, while the other agents function as **MCP servers**. - This enables seamless coordination and communication between distributed agents.⚠️ **Current Blocker:** Encountering a `ModuleNotFoundError` for `pydantic_ai.mcp`, which seems to be a dependency issue. > cc @AryanGurav106 — need help resolving this import issue.
- Updated `anthropic`, `groq`, and `openai` dependencies to their latest versions. - Refactored agent initialization to use `provider` instead of `anthropic_client` for better clarity.
…alization - Updated pydantic-ai dependencies to version 0.1.2. - Initialized AnthropicProvider with API key in code, planner, and orchestrator agents as per new updates - Added MCP server initialization and proper client call to server
1. Changed MCP Server initialisation using MCPServerHTTP 2. Updated cortex_on Dockerfile to run server on 3001 port
- Updated `anthropic`, `groq`, and `openai` dependencies to their latest versions. - Refactored agent initialization to use `provider` instead of `anthropic_client` for better clarity.
…alization - Updated pydantic-ai dependencies to version 0.1.2. - Initialized AnthropicProvider with API key in code, planner, and orchestrator agents as per new updates - Added MCP server initialization and proper client call to server
1. Changed MCP Server initialisation using MCPServerHTTP 2. Updated cortex_on Dockerfile to run server on 3001 port
- Updated Dockerfile to run only the main API, with the MCP server started programmatically in a separate thread. - Refactored instructor.py to dynamically register MCP server tools and manage their execution, improving modularity and reducing direct dependencies in the MCP server. - Added threading support for MCP server initialization to enhance responsiveness.
- Moved the ask_human function from instructor.py to orchestrator_agent.py, attached to client directly to avoid future event loops
…-docker execution - Updated docker-compose.yaml to mount Docker socket and enable privileged mode for container access. - Modified Dockerfile to install Docker CLI and necessary build tools for executing code within Docker environments. - Added cleanup functionality for Docker environments in instructor.py to ensure proper resource management. - Implemented file reading and execution capabilities in the code agent, allowing interaction with files in the Docker environment. - Enhanced stream response format to include source code and metadata for better tracking of execution results. - Removed deprecated local code executor and related utilities to streamline the codebase.
…environments - Updated docker-compose.yaml to define separate services for Python, Java, C++, JavaScript, TypeScript, Ruby, Go, Rust, and PHP environments. - Each environment includes setup scripts for necessary dependencies and health checks. - Refactored Docker execution logic to utilize language-specific containers, enhancing isolation and resource management. - Removed deprecated cleanup functionality from instructor.py, streamlining the orchestration process. - Improved code execution handling in the code agent to support the new environment structure.
- Modified the TypeScript environment in docker-compose.yaml to install TypeScript quietly and check its availability as part of the health check. - Removed the previous environment setup script in favor of a more streamlined command execution. - Cleaned up unnecessary environment variables for better clarity and maintainability.
… container - Refactored docker-compose.yaml to remove individual language environment services and replace them with a single multi-language environment service. - Updated the Docker executor to support the new multi-language structure, allowing for dynamic language handling and execution. - Enhanced the code agent to activate the appropriate language environment within the container, improving execution context management. - Adjusted resource limits and health check configurations for the new multi-language environment. - Added guidelines for file naming conventions in the code agent documentation.
- Expanded the LANGUAGE_EXTENSIONS dictionary in code_agent.py to include JavaScript, TypeScript, Ruby, Go, Rust, and PHP. - This enhancement allows the code agent to recognize and handle a broader range of programming languages, improving its versatility.
Karbelekedar
approved these changes
May 6, 2025
Contributor
Karbelekedar
left a comment
There was a problem hiding this comment.
Looks good. Ready to merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Features
Technical Details
Testing
Future Improvements