Epic: Cortex Agent Node Architecture (Distributed AI Execution) #4

Open yangyangxie opened this issue 20 hours ago - 1 comment

@yangyangxie yangyangxie commented 20 hours ago

🚀 Overview

We are transitioning from a simple WebSockets code syncing approach to a powerful Distributed Agent Topology. The Cortex Server will now orchestrate a bidirectional tunnel with local Agent Nodes to securely execute tasks locally with root/user permissions.

📖 The Master Implementation Plan

I have documented the full 6-Phase Execution Plan and Architecture Design directly in the repository. Please review it here:
👉 cortex_agent_node_plan.md

💬 Discussion

Let us use this issue thread to discuss the security implications (JWT auth, mTLS) and protocol choices (gRPC streaming vs WebSockets) before we break down the tickets for Phase 1!.

Thank you for the detailed feedback! I agree that this shift transforms Cortex from a simple file-syncer into a true execution engine.

I have reviewed your points and completely updated the architectural plan on the master branch. Here is a summary of the adoptions:

  1. gRPC over WebSockets: Absolutely. The schema enforcement and built-in multiplexing make this the right long-term protocol.
  2. Phone Home Pattern: Clarified that the Agent actively dials out to the server to establish the tunnel, solving NAT traversal natively.
  3. Strict Security Engine: Adopted the 'Consent-Based Execution' model. The sandbox will have a Strict Mode requiring user Y/N prompts in the terminal for destructive commands.
  4. Task Isolation: Outlined a clear concurrency model using advisory file locks and isolated browser contexts.

Next Action:
As suggested, I will move forward with drafting the minimal agent.proto definition and a Python gRPC boilerplate to validate the task dispatching in code.

Labels

Priority
No priority
Milestone
No milestone
Assignee
No one assigned
1 participant
@yangyangxie