# Subagent Routing Configuration

# When to use which subagent based on task type

subagents:
  # Code Reviewer Subagent
  code-reviewer:
    enabled: true
    path: src/harness/subagents/code-reviewer
    triggers:
      keywords:
        - "review code"
        - "check code"
        - "code review"
        - "analyze code"
        - "audit code"
      patterns:
        - "review.*code"
        - "check.*strategy"
        - "analyze.*function"
    priority: high
    timeout: 60000  # 1 minute

  # Risk Analyzer Subagent (TODO: implement)
  risk-analyzer:
    enabled: false
    path: src/harness/subagents/risk-analyzer
    triggers:
      keywords:
        - "risk"
        - "exposure"
        - "drawdown"
        - "volatility"
      patterns:
        - "assess.*risk"
        - "calculate.*risk"
        - "risk.*analysis"
    priority: high
    timeout: 30000

  # Market Analyst Subagent (TODO: implement)
  market-analyst:
    enabled: false
    path: src/harness/subagents/market-analyst
    triggers:
      keywords:
        - "market"
        - "trend"
        - "technical analysis"
        - "price action"
      patterns:
        - "analyze.*market"
        - "market.*conditions"
    priority: medium
    timeout: 45000

# Routing strategy
routing:
  # Check triggers in priority order
  strategy: priority

  # Fallback to main agent if no subagent matches
  fallback: main_agent

  # Allow chaining (one subagent can invoke another)
  allowChaining: true
  maxChainDepth: 3

# Subagent memory settings
memory:
  # Reload memory files on every request (dev mode)
  hotReload: false

  # Cache memory files in production
  cacheMemory: true
  cacheTTL: 3600000  # 1 hour

# Parallel execution
parallel:
  # Allow multiple subagents to run in parallel
  enabled: true

  # Max concurrent subagents
  maxConcurrent: 3

  # Combine results strategy
  combineStrategy: merge  # merge | first | best

# Monitoring
monitoring:
  # Log subagent performance
  logPerformance: true

  # Track usage by subagent
  trackUsage: true

  # Alert on slow subagents
  alertThreshold: 30000  # 30 seconds
