Skip to content

Latest commit

 

History

History
executable file
·
922 lines (739 loc) · 27.6 KB

File metadata and controls

executable file
·
922 lines (739 loc) · 27.6 KB

HelixCode Repository - Comprehensive Analysis Report

Executive Summary

HelixCode is a sophisticated, enterprise-grade distributed AI development platform written in Go with support for multiple LLM providers, advanced reasoning capabilities, distributed worker management, MCP protocol support, and comprehensive task management. It implements cutting-edge AI features including prompt caching, extended thinking, vision capabilities, and streaming.


1. PROJECT STRUCTURE & ARCHITECTURE

Core Directory Layout

helix_code/
├── cmd/                          # Application entry points
│   ├── server/main.go           # REST API server (82 lines)
│   └── cli/main.go              # CLI client (333 lines)
├── internal/                      # Core packages
│   ├── llm/                      # LLM providers (22 files)
│   ├── mcp/                      # Model Context Protocol (3 files)
│   ├── task/                     # Task management (7 files)
│   ├── workflow/                 # Workflow engine (3 files)
│   ├── worker/                   # Distributed workers (6 files)
│   ├── auth/                     # Authentication (3 files)
│   ├── notification/             # Multi-channel notifications
│   ├── server/                   # HTTP server & routes
│   ├── database/                 # PostgreSQL layer
│   ├── redis/                    # Caching layer
│   ├── config/                   # Configuration management
│   ├── hardware/                 # Hardware detection
│   └── event/                    # Event system
├── config/                        # YAML configuration
├── test/                          # Test suites
│   ├── integration/
│   ├── automation/
│   └── e2e/
└── docs/                          # Documentation

Module: dev.helix.code
Go Version: 1.24.0

Architecture Patterns

1. Provider Abstraction Pattern

  • File: /internal/llm/provider.go (lines 112-128)
  • Unified Provider interface for all LLM implementations
  • Supports multiple concurrent providers with fallback
  • Key methods: Generate(), GenerateStream(), IsAvailable(), GetHealth()

2. Plugin-Based Model Manager

  • File: /internal/llm/model_manager.go
  • Intelligent model selection based on:
    • Required capabilities (planning, code_generation, debugging, testing, refactoring, vision)
    • Context window requirements
    • Hardware compatibility
    • Task-specific suitability
    • Quality preferences (fast/balanced/quality)

3. Task Distribution System

  • File: /internal/task/manager.go
  • Priority-based task queue
  • Dependency resolution (DAG execution)
  • Checkpoint system for work preservation
  • Status tracking (pending → assigned → running → completed/failed)
  • Automatic retry with exponential backoff

4. Distributed Worker Pool

  • File: /internal/worker/ssh_pool.go (lines 17-37)
  • SSH-based remote worker management
  • Automatic Helix CLI installation on new workers
  • Health monitoring with configurable intervals
  • Resource tracking (CPU, memory, GPU)
  • Capability-based task assignment

2. SUPPORTED LLM PROVIDERS & MODELS

Provider Implementation Summary

Provider File Status Models Key Features
Anthropic Claude anthropic_provider.go ✓ Full 11 models Extended thinking, prompt caching, vision
Google Gemini gemini_provider.go ✓ Full 11 models 2M token context, multimodal, function calling
OpenAI openai_provider.go ✓ Full 8+ models Vision, function calling, reasoning (O1/O3)
Qwen qwen_provider.go ✓ Full 4+ models OAuth2 auth, Chinese models, free tier
xAI (Grok) xai_provider.go ✓ Full 3 models Fast inference, free models available
OpenRouter openrouter_provider.go ✓ Full 40+ models Multi-provider aggregation
GitHub Copilot copilot_provider.go ✓ Full 4 models GitHub token exchange, free with subscription
Local (Llama.cpp) local_provider.go ✓ Full Dynamic 100% offline, privacy-first
Ollama ollama_provider.go ✓ Full Dynamic Docker-based local models
Llama.cpp llamacpp_provider.go ✓ Full Dynamic Direct C++ integration

Provider Factory Pattern

File: /internal/llm/provider.go (lines 335-360)

type ProviderFactory struct{}

func (pf *ProviderFactory) CreateProvider(config ProviderConfigEntry) (Provider, error) {
    switch config.Type {
    case ProviderTypeAnthropic:
        return NewAnthropicProvider(config)
    // ... other providers
    }
}

Anthropic Claude - Advanced Features

Extended Thinking

File: /internal/llm/anthropic_provider.go (lines 86-90)

  • Auto-detected from prompt keywords: "think", "reason", "analyze", "step by step"
  • Allocates 80% of max_tokens to reasoning budget
  • Temperature auto-adjusted to 1.0 for thinking mode
  • Budget configurable via anthropicThinkingConfig.Budget

Prompt Caching (Up to 90% Cost Savings)

File: /internal/llm/anthropic_provider.go (lines 48-70)

  • System Message Caching: Ephemeral cache for system instructions
  • Content Block Caching: Last user message cached with cache_control: ephemeral
  • Tool Caching: Last tool definition automatically cached
  • Cache metadata in response:
    • cache_creation_input_tokens: New cache creation
    • cache_read_input_tokens: Cache hits

Vision Support

File: /internal/llm/anthropic_provider.go (lines 72-77)

type anthropicImageSource struct {
    Type      string // "base64", "url"
    MediaType string // "image/jpeg", "image/png", etc.
    Data      string // base64 encoded
    URL       string
}

Streaming with Server-Sent Events

File: /internal/llm/anthropic_provider.go

  • SSE-based token-by-token streaming
  • Tool call streaming support
  • Usage tracking in final event

Google Gemini - Advanced Features

Massive Context Windows

File: /internal/llm/gemini_provider.go

  • Gemini 2.5 Pro: 2,097,152 tokens (2M tokens)
  • Gemini 2.5 Flash: 1,048,576 tokens (1M tokens)
  • Gemini 1.5 Pro: 2,097,152 tokens (2M tokens)
  • Can process entire codebases in single request

Multimodal Support

File: /internal/llm/gemini_provider.go (lines 42-74)

type geminiTextPart struct {
    Text string `json:"text"`
}

type geminiInlineDataPart struct {
    InlineData *geminiBlob `json:"inlineData"`
}

type geminiBlob struct {
    MimeType string // MIME type
    Data     string // base64 encoded
}

Function Calling

File: /internal/llm/gemini_provider.go (lines 75-91)

type geminiTool struct {
    FunctionDeclarations []geminiFunctionDeclaration `json:"functionDeclarations,omitempty"`
}

type geminiFunctionDeclaration struct {
    Name        string
    Description string
    Parameters  map[string]interface{}
}

Safety Settings

File: /internal/llm/gemini_provider.go (lines 93-96)

  • Configurable safety thresholds per category
  • Content filtering controls

Free & Premium Models Available

Free Providers (No API Key):

  • XAI (Grok): grok-3-fast-beta, grok-3-mini-fast-beta, grok-3-beta
  • OpenRouter: deepseek-r1-free, meta-llama/llama-3.2-3b-instruct:free
  • GitHub Copilot: gpt-4o, claude-3.5-sonnet, o1, gemini-2.0-flash (with GitHub subscription)
  • Qwen: OAuth2 authentication, 2,000 requests/day free tier

Premium Providers:

  • Anthropic Claude: All models with 200K context + extended thinking
  • Google Gemini: Up to 2M token context
  • OpenAI: GPT-4.1, GPT-4.5 Preview, O1/O3 reasoning
  • Qwen, xAI, OpenRouter: Various paid tiers

3. KEY FEATURES & CAPABILITIES

3.1 Tool & Function Calling System

File: /internal/llm/tool_provider.go (lines 14-53)

type ToolGenerationRequest struct {
    ID          uuid.UUID
    Prompt      string
    Tools       []Tool
    MaxTokens   int
    Temperature float64
    Stream      bool
    Context     map[string]interface{}
}

type EnhancedLLMProvider interface {
    Provider
    GenerateWithTools(ctx context.Context, req ToolGenerationRequest) (*ToolGenerationResponse, error)
    StreamWithTools(ctx context.Context, req ToolGenerationRequest) (<-chan ToolStreamChunk, error)
    ListAvailableTools() []Tool
    RegisterTool(tool Tool) error
}

Implementation:

  • Tool detection from response content
  • Tool execution with handler callbacks
  • Multi-turn tool conversations
  • Streaming tool chunks
  • Tool registration system

3.2 Advanced Reasoning Engine

File: /internal/llm/reasoning.go (lines 13-87)

Reasoning Types Supported:

  • chain_of_thought: Step-by-step reasoning with intermediate thoughts
  • tree_of_thoughts: Multi-path exploration
  • self_reflection: Reflexive thinking
  • progressive: Progressive refinement

ReasoningEngine Features:

  • Tool integration during reasoning steps
  • Confidence scoring per step
  • Multi-step execution with max steps control
  • Tool result incorporation
  • Final answer extraction

Example Usage:

type ReasoningRequest struct {
    ID            uuid.UUID
    Prompt        string
    Tools         []ReasoningTool
    ReasoningType ReasoningType
    MaxSteps      int
    Temperature   float64
    Context       map[string]interface{}
}

type ReasoningResponse struct {
    ID             uuid.UUID
    FinalAnswer    string
    ReasoningSteps []ReasoningStep
    ToolsUsed      []string
    Duration       time.Duration
    Confidence     float64
}

3.3 MCP (Model Context Protocol) Support

File: /internal/mcp/server.go

Protocol Implementation:

  • Version: 2024-11-05
  • Transport: WebSocket with JSON-RPC
  • Sessions: Per-connection session management with context
  • Tool System: Centralized tool registry with permissions

Key Methods:

  • initialize: Protocol handshake
  • tools/list: List all available tools
  • tools/call: Execute tool with parameters
  • notifications/capabilities: Capability exchange
  • ping: Keep-alive mechanism

Session Management (lines 26-33):

type MCPSession struct {
    ID           uuid.UUID
    Conn         *websocket.Conn
    CreatedAt    time.Time
    LastActivity time.Time
    UserID       uuid.UUID
    Context      map[string]interface{}
}

Tool Execution (lines 35-42):

type Tool struct {
    ID          string
    Name        string
    Description string
    Parameters  map[string]interface{}
    Handler     ToolHandler
    Permissions []string
}

Broadcasting Capabilities:

  • BroadcastNotification(): Send to all active sessions
  • Support for experimental features

3.4 Task Management System

File: /internal/task/manager.go

Task Types:

  • TaskTypePlanning: Requirements analysis and breakdown
  • TaskTypeBuilding: Code generation and integration
  • TaskTypeTesting: Unit, integration, E2E tests
  • TaskTypeRefactoring: Code optimization
  • TaskTypeDebugging: Error diagnosis and fixes
  • TaskTypeDesign: Architecture and design
  • TaskTypeDiagram: Visual representations
  • TaskTypeDeployment: Release management
  • TaskTypePorting: Platform migration

Task Features:

  • Priority Levels: Low (1), Normal (5), High (10), Critical (20)
  • Status Tracking: pending → assigned → running → completed/failed
  • Dependency Resolution: Task DAG execution
  • Checkpointing: Work preservation at 300s intervals
  • Retry Mechanism: Max 3 retries with exponential backoff
  • Resource Management: Worker capability matching

Checkpoint System (lines in checkpoint.go):

  • Automatic checkpoint creation
  • Work recovery on failure
  • Configurable checkpoint interval

3.5 Workflow Engine

File: /internal/workflow/workflow.go

Workflow Structure:

type Workflow struct {
    ID          string
    Name        string
    Mode        string
    Steps       []Step
    Status      WorkflowStatus
}

type Step struct {
    ID           string
    Type         StepType     // analysis, generation, execution, validation
    Action       StepAction   // analyze_code, generate_code, run_tests, etc.
    Dependencies []string     // For DAG execution
    Status       StepStatus   // pending, running, completed, failed, skipped
}

Workflow Types:

  • Planning Mode: Analyze requirements, create specs, break into tasks
  • Building Mode: Code generation, dependency management, integration
  • Testing Mode: Unit, integration, E2E test execution
  • Refactoring Mode: Code analysis, optimization, restructuring
  • Debugging Mode: Error analysis, RCA, fix generation
  • Deployment Mode: Build, package, deploy to targets

3.6 Distributed Worker Management

File: /internal/worker/ssh_pool.go

Worker Pool Capabilities:

  • SSH-Based Remote Execution: Using golang.org/x/crypto/ssh
  • Auto-Installation: Automatic Helix CLI deployment on new workers
  • Health Monitoring: 30-second health check intervals
  • Resource Detection: CPU, memory, GPU capabilities
  • Task Assignment: Capability-based worker selection
  • Connection Pooling: Persistent SSH connections

Worker Configuration (lines 12-29):

type WorkerConfig struct {
    Enabled             bool
    Pool                map[string]WorkerConfigEntry
    AutoInstall         bool
    HealthCheckInterval int
    MaxConcurrentTasks  int
    TaskTimeout         int
}

type SSHWorker struct {
    ID           uuid.UUID
    Hostname     string
    Capabilities []string
    Resources    Resources
    Status       WorkerStatus
    HealthStatus WorkerHealth
}

3.7 Model Capability & Selection

File: /internal/llm/model_manager.go

Model Capabilities:

  • CapabilityTextGeneration: General text output
  • CapabilityCodeGeneration: Code synthesis
  • CapabilityCodeAnalysis: Code review and understanding
  • CapabilityPlanning: Requirement analysis
  • CapabilityDebugging: Error diagnosis
  • CapabilityRefactoring: Code optimization
  • CapabilityTesting: Test generation and validation
  • CapabilityVision: Image understanding

Intelligent Model Selection (lines 74-101):

type ModelSelectionCriteria struct {
    TaskType             string
    RequiredCapabilities []ModelCapability
    MaxTokens            int
    Budget               float64
    LatencyRequirement   time.Duration
    QualityPreference    string // "fast", "balanced", "quality"
}

func (m *ModelManager) SelectOptimalModel(criteria ModelSelectionCriteria) (*ModelInfo, error)

Scoring Factors:

  • Capability matching (0-1.0)
  • Context adequacy (up to 2.0x requirement)
  • Task-specific suitability (1.1-1.3x for specialized models)
  • Hardware compatibility (0.0-1.0)
  • Quality preference (variable)
  • Provider availability

4. CONFIGURATION SYSTEM

Primary Configuration File

File: /config/config.yaml

Server Configuration (lines 3-9)

server:
  address: "0.0.0.0"
  port: 8080
  read_timeout: 30
  write_timeout: 30
  idle_timeout: 60

Database Configuration (lines 11-17)

database:
  host: "localhost"
  port: 5432
  user: "helixcode"
  password: "" # Via HELIX_DATABASE_PASSWORD env var
  dbname: "helixcode"
  sslmode: "disable"

LLM Provider Configuration (lines 42-48)

llm:
  default_provider: "local"
  providers:
    local: "http://localhost:11434"
    openai: "" # Via env var
  max_tokens: 4096
  temperature: 0.7

Notification Configuration (lines 55-109)

Channels Supported:

  • Slack (webhook-based)
  • Telegram (bot-based)
  • Email (SMTP)
  • Discord (webhook-based)

Example Rule:

rules:
  - name: "Critical Task Failures"
    condition: "type==error"
    channels: ["slack", "email", "telegram"]
    priority: urgent
    enabled: true

Environment Variables for Secret Management

Database:

  • HELIX_DATABASE_PASSWORD: PostgreSQL password

Authentication:

  • HELIX_AUTH_JWT_SECRET: JWT signing secret

Cache:

  • HELIX_REDIS_PASSWORD: Redis password (optional)

Providers:

  • ANTHROPIC_API_KEY: Anthropic Claude
  • OPENAI_API_KEY: OpenAI
  • GEMINI_API_KEY or GOOGLE_API_KEY: Google Gemini
  • XAI_API_KEY: XAI (Grok)
  • OPENROUTER_API_KEY: OpenRouter
  • QWEN_API_KEY: Qwen (fallback to OAuth2)
  • GITHUB_TOKEN: GitHub Copilot

Notifications:

  • HELIX_SLACK_WEBHOOK_URL: Slack integration
  • HELIX_TELEGRAM_BOT_TOKEN: Telegram bot
  • HELIX_TELEGRAM_CHAT_ID: Telegram chat
  • HELIX_EMAIL_SMTP_SERVER: Email SMTP
  • HELIX_DISCORD_WEBHOOK_URL: Discord

5. CONTEXT WINDOW & TOKEN MANAGEMENT

Model Context Information

Anthropic Claude (provider.go implementation):

  • Context: 200K tokens (all models)
  • Max Output: 4K-50K depending on model
  • Implementation: Automatic prompt caching reduces effective token usage by 70-90%

Google Gemini:

  • Gemini 2.5 Pro: 2,097,152 tokens (2M)
  • Gemini 2.5 Flash: 1,048,576 tokens (1M)
  • Gemini 1.5 Pro: 2,097,152 tokens (2M)
  • Max Output: 8K tokens

OpenAI:

  • GPT-4.1: Up to 1,024K tokens
  • GPT-4.5 Preview: Variable context
  • O1/O3 Models: Up to 128K context

Local Models (via Llama.cpp/Ollama):

  • Depends on model size and quantization
  • Typically 4K-32K context window
  • No token cost

Token Usage Tracking

File: /internal/llm/provider.go (lines 105-110)

type Usage struct {
    PromptTokens     int `json:"prompt_tokens"`
    CompletionTokens int `json:"completion_tokens"`
    TotalTokens      int `json:"total_tokens"`
}

Enhanced Tracking (anthropic_provider.go):

type anthropicUsage struct {
    InputTokens      int
    OutputTokens     int
    CacheCreationTokens int  // New cache entries
    CacheReadTokens     int  // Cache hits
}

Context Management Strategy

  1. Prompt Caching (Anthropic): Reuse context across requests
  2. Streaming: Token-by-token delivery reduces perceived latency
  3. Model Selection: Choose smallest sufficient model for task
  4. Checkpointing: Preserve state to avoid re-computation

6. HANDLING DIFFERENT LLM PROVIDERS

Provider Registration Flow

File: /internal/llm/provider.go (lines 175-194)

func (pm *ProviderManager) RegisterProvider(provider Provider) error {
    providerType := provider.GetType()
    if _, exists := pm.providers[providerType]; exists {
        return fmt.Errorf("provider %s already registered", providerType)
    }
    pm.providers[providerType] = provider
    log.Printf("✅ LLM Provider registered: %s (%s)", provider.GetName(), providerType)
    return nil
}

Provider Abstraction

All providers implement the Provider Interface (lines 112-128):

type Provider interface {
    // Basic provider information
    GetType() ProviderType
    GetName() string
    GetModels() []ModelInfo
    GetCapabilities() []ModelCapability
    
    // Core functionality
    Generate(ctx context.Context, request *LLMRequest) (*LLMResponse, error)
    GenerateStream(ctx context.Context, request *LLMRequest, ch chan<- LLMResponse) error
    
    // Provider management
    IsAvailable(ctx context.Context) bool
    GetHealth(ctx context.Context) (*ProviderHealth, error)
    Close() error
}

Request/Response Transformation

Each provider implements request transformation:

Anthropic Example:

func (ap *AnthropicProvider) convertToAnthropicRequest(request *LLMRequest) (*anthropicRequest, error) {
    // Transform generic LLMRequest to Anthropic-specific format
    // Handle tool definitions, vision content, thinking config, etc.
}

Fallback Mechanism

File: /internal/llm/provider.go (lines 215-244)

func (pm *ProviderManager) Generate(ctx context.Context, request *LLMRequest) (*LLMResponse, error) {
    var provider Provider
    var err error
    
    // Use specified provider or default
    if request.ProviderType != "" {
        provider, err = pm.GetProvider(request.ProviderType)
    } else {
        provider, err = pm.GetDefaultProvider()
    }
    
    if err != nil {
        return nil, fmt.Errorf("failed to get provider: %v", err)
    }
    
    return provider.Generate(ctx, request)
}

Health Monitoring

File: /internal/llm/provider.go (lines 259-276)

func (pm *ProviderManager) GetProviderHealth(ctx context.Context) map[ProviderType]*ProviderHealth {
    health := make(map[ProviderType]*ProviderHealth)
    
    for providerType, provider := range pm.providers {
        if healthStatus, err := provider.GetHealth(ctx); err == nil {
            health[providerType] = healthStatus
        }
    }
    
    return health
}

ProviderHealth Structure (lines 142-149):

type ProviderHealth struct {
    Status     string        // "healthy" or "unhealthy"
    Latency    time.Duration
    LastCheck  time.Time
    ErrorCount int
    ModelCount int
}

Capability-Based Provider Selection

File: /internal/llm/provider.go (lines 278-290)

func (pm *ProviderManager) FindProviderForCapabilities(capabilities []ModelCapability) []Provider {
    var matching []Provider
    
    for _, provider := range pm.GetAvailableProviders() {
        providerCaps := provider.GetCapabilities()
        if hasAllCapabilities(providerCaps, capabilities) {
            matching = append(matching, provider)
        }
    }
    
    return matching
}

7. UNIQUE CAPABILITIES & NOTABLE FEATURES

7.1 Intelligent Workflow Engine

Unique Aspect: Multi-stage development workflow with AI assistance

  • Analyzes code structure and requirements
  • Generates implementation plans
  • Executes changes with verification
  • Provides explanations and documentation

7.2 Distributed Computing Architecture

Unique Aspect: SSH-based worker pool with auto-installation

  • Deploy workers without pre-configuration
  • Automatic capability detection
  • Health-aware task distribution
  • Resource-aware scheduling

7.3 Hybrid Provider Support

Unique Aspect: Mix cloud and local models dynamically

  • Free models for development
  • Premium models for critical tasks
  • Fallback chain with automatic provider switching
  • Cost-optimized routing

7.4 Prompt Caching Integration

Unique Aspect: Integrated caching for 70-90% cost reduction

  • Automatic system message caching
  • Last message caching
  • Tool definition caching
  • Provider-aware cache management

7.5 Reasoning Engine Integration

Unique Aspect: Pluggable reasoning for complex tasks

  • Chain-of-thought reasoning
  • Tool integration during reasoning
  • Multi-step problem solving
  • Confidence scoring

7.6 Comprehensive Notification System

Unique Aspect: Rule-based multi-channel notifications

  • 4 channel types (Slack, Telegram, Email, Discord)
  • Condition-based routing
  • Priority levels
  • Event-driven architecture

7.7 Vision Capability Support

Unique Aspect: Image understanding across multiple providers

  • Anthropic Claude: All models support vision
  • Google Gemini: Full multimodal support
  • OpenAI: Vision-enabled models
  • Base64 encoding, URL references, file upload paths

7.8 Extended Thinking (Anthropic)

Unique Aspect: Automatic reasoning mode activation

  • Detect complex queries
  • Allocate 80% of tokens to thinking
  • Temperature optimization
  • Cost tracking for thinking budget

7.9 MCP Protocol Implementation

Unique Aspect: Full Model Context Protocol support

  • WebSocket-based real-time communication
  • Per-session tool execution
  • Tool permission system
  • Broadcast notifications

7.10 OAuth2 Authentication (Qwen)

Unique Aspect: Interactive OAuth flow for free tier

  • 2,000 requests/day free
  • User authentication without API keys
  • Token refresh mechanism

8. TECHNOLOGY STACK

Core Dependencies

// HTTP Framework
"github.com/gin-gonic/gin"

// Database
"github.com/jackc/pgx/v5"

// Authentication
"github.com/golang-jwt/jwt/v4"

// Configuration
"github.com/spf13/viper"

// WebSocket
"github.com/gorilla/websocket"

// SSH Client
"golang.org/x/crypto/ssh"

// UUID Generation
"github.com/google/uuid"

// Testing
"github.com/stretchr/testify"

Platform Support

  • Standard: Linux, macOS, Windows
  • Mobile: iOS (gomobile), Android
  • Embedded: Aurora OS, Symphony OS (Russian platforms)
  • Containers: Docker with Compose

9. RECOMMENDED FEATURES TO PORT

Based on the analysis, these features provide the most value for a new AI coding platform:

High Priority (Core Functionality)

  1. Multi-Provider LLM System: Supports 10+ providers with unified interface
  2. Tool Calling Framework: Extensible tool system with caching
  3. Reasoning Engine: Chain-of-thought with tool integration
  4. Task Management: Priority queue, dependencies, checkpoints
  5. Worker Pool: SSH-based distributed execution

Medium Priority (Advanced Features)

  1. Prompt Caching: 70-90% cost reduction on repeated contexts
  2. Extended Thinking: Automatic reasoning mode for complex tasks
  3. Vision Support: Multi-provider image understanding
  4. MCP Protocol: Real-time tool execution protocol
  5. Workflow Engine: Multi-stage development workflows

Nice-to-Have (Polish)

  1. Hardware Detection: Optimize model selection for device capabilities
  2. Notification System: Multi-channel event notifications
  3. OAuth2 Integration: Interactive authentication flows
  4. Streaming: Token-by-token response delivery

10. KEY CODE REFERENCES

Core Files by Feature

Feature File Lines Key Functions
Provider Interface provider.go 361 Provider, ProviderManager, ProviderFactory
Anthropic Claude anthropic_provider.go 400+ Extended thinking, prompt caching, vision
Google Gemini gemini_provider.go 400+ 2M token context, multimodal, function calling
Tool Calling tool_provider.go 404 GenerateWithTools, StreamWithTools
Reasoning reasoning.go 332 ReasoningEngine, multiple reasoning types
MCP Server mcp/server.go 383 WebSocket handling, tool execution
Task Manager task/manager.go 200+ Task queue, dependencies, retry logic
Worker Pool worker/ssh_pool.go 300+ SSH management, auto-install, health checks
Model Manager model_manager.go 420 Intelligent model selection, scoring
Configuration config/config.yaml 109 Server, database, LLM, notification config

11. DEPLOYMENT & USAGE

Build Commands

make build               # Build main server binary
make test              # Run all tests
make prod              # Cross-platform production builds
make mobile-ios        # Build iOS framework
make mobile-android    # Build Android AAR

Docker Deployment

docker-compose up -d
# Includes: Server, PostgreSQL, Redis, Nginx, Prometheus, Grafana

API Endpoints

  • Auth: /api/auth/register, /api/auth/login, /api/auth/me
  • Tasks: /api/tasks, /api/tasks/{id}
  • Workers: /api/workers, /api/workers/{id}
  • Health: /health
  • MCP: /ws/mcp (WebSocket)

CONCLUSION

HelixCode is a production-ready, feature-rich AI development platform with:

10+ LLM provider support with advanced features
Intelligent model selection based on capabilities
Distributed worker management with auto-installation
Prompt caching for 70-90% cost reduction
Advanced reasoning with tool integration
MCP protocol implementation
Comprehensive task management with dependencies
Multi-channel notifications
Vision support across providers
100% offline local model support

The architecture emphasizes flexibility (plugin-based providers), scalability (distributed workers), cost-efficiency (caching, model selection), and reliability (health monitoring, task checkpoints).