Skip to content

Conversation

AryanGurav106
Copy link
Contributor

Key Features

  • Multi-Language Support: Added support for Python, Java, C++, JavaScript, TypeScript, Ruby, Go, Rust, and PHP
  • Containerized Execution: Implemented secure Docker-based execution environments with appropriate isolation and resource limitations
  • Persistent Language Environments: Each programming language has its own dedicated persistent container
  • Enhanced Frontend Integration: Improved code execution output visibility in the frontend with formatted results
  • File Management System: Added capabilities to create, read, and execute files within the Docker environment

Technical Details

  • Consolidated individual language environments into a multi-language container architecture
  • Implemented language-specific execution paths with appropriate file extensions mapping
  • Added proper error handling and result formatting for each language
  • Enhanced websocket communication to stream execution updates in real-time
  • Improved security by running all code in isolated containers with resource limits

Testing

  • Verified code execution across all supported languages
  • Tested file management operations (create, read, execute) within containers
  • Confirmed proper isolation between different language environments
  • Validated frontend display of execution results, errors, and status

Future Improvements

  • Additional language support
  • Package management integration for each language
  • Enhanced IDE-like features for code editing

3rd-Son and others added 24 commits April 17, 2025 11:28
✅ **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.
Copy link
Contributor

@Karbelekedar Karbelekedar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants