Skip to main content
Advanced

Orchestration

Understand how CogTog orchestrates agents to solve complex tasks through intelligent coordination and automatic recovery.

Execution

Execution Modes

CogTog offers 3 execution modes depending on task complexity: Auto (single agent), Agent (multi-agent), and Orchestration (full autonomous).

Auto Mode (Single Agent)

One agent handles the entire task from start to finish. Best for simple, focused tasks that don't require specialization.

When to use:
  • • Simple, straightforward tasks
  • • Tasks requiring one specific skill
  • • Quick prototyping
  • • When you want direct control

Agent Mode (Multi-Agent)

Multiple specialized agents work together, each handling their area of expertise. The orchestrator coordinates their efforts.

When to use:
  • • Complex projects requiring multiple skills
  • • Large codebases with many files
  • • Tasks needing architecture + implementation + testing
  • • Production-grade work

Orchestration Mode (Full Autonomous)

CogTog automatically decides whether to use single or multi-agent mode based on task complexity. The orchestrator analyzes your request and chooses the best approach.

Benefits:
  • • Optimal resource usage
  • • Faster for simple tasks
  • • Better quality for complex tasks
  • • No manual configuration needed

Meta-Orchestrator

The meta-orchestrator is CogTog's intelligent task coordinator. It analyzes requests, breaks down complex tasks, assigns agents, and monitors progress.

Task Classification

When you submit a task, the meta-orchestrator first classifies it:

Simple Task
Single file edit, read operation, or straightforward question → Single agent
Complex Task
Multi-file changes, new feature, architecture changes → Multi-agent orchestration

Task Breakdown

For complex tasks, the meta-orchestrator breaks the work into subtasks:

// Example task breakdown:
Task: "Add user authentication to the app"
1. Architect: Design auth system architecture
2. Coder: Implement auth backend API
3. Coder: Add login/register UI components
4. Tester: Write tests for auth flows
5. Reviewer: Security review of implementation

Agent Assignment

Each subtask is assigned to the most appropriate agent role:

Architect
→ Planning, design, architecture
Software Engineer
→ Implementation, coding, file operations
Tester
→ Test writing, validation, edge cases
Reviewer
→ Code review, quality checks, security
DevOps
→ Deployment, scripts, CI/CD

Stuck Detection & Recovery

CogTog monitors agent progress and automatically recovers from stuck states. This ensures tasks complete even when agents encounter issues.

Detection Triggers

The orchestrator detects when an agent is stuck:

Repeated Tool Failures

Same tool fails 3+ times with same arguments (e.g., file not found, permission denied)

Repetitive Actions

Agent loops through same actions without making progress

Excessive Iterations

Agent exceeds iteration limit (default: 50) without completing task

Recovery Strategies

When stuck, the orchestrator tries these recovery strategies:

1

Intervention Message

Send a message explaining what went wrong and suggesting alternative approaches (excluding failing tools)

2

Tool Blocking

Temporarily block tools that repeatedly fail to force agent to try different approaches

3

Agent Handoff

Transfer task to a different agent with fresh context (multi-agent mode only)

4

User Notification

If recovery fails, ask user for help or clarification

Automatic Recovery

In most cases, stuck detection and recovery happens automatically without user intervention. The agent learns from failures and adapts its approach.

Progress Monitoring

The orchestration UI shows real-time progress for all active agents:

Current Task
What each agent is working on right now
Tool Calls
Real-time log of tool execution and results
Completion Status
Track which subtasks are complete and which are in progress

Best Practices

Use Auto Mode

Let CogTog decide between single and multi-agent based on task complexity. This usually gives the best results.

Provide Clear Context

Give agents enough context about your project structure, goals, and constraints. This helps the orchestrator make better decisions.

Don't Micro-Manage

Trust the orchestrator to coordinate agents. Avoid manually intervening unless an agent asks for help.

Review Final Output

Always review the final results. While orchestration is powerful, human oversight ensures quality.