← Back to blog

Understanding the 8-Phase Pipeline

A deep dive into how AgenticKode orchestrates AI coding tasks through eight sequential phases, from workspace setup to finalization.

By AgenticKode Team

Understanding the 8-Phase Pipeline

⚠️ This post describes the legacy 8-phase pipeline. As of v0.5.0, AgenticKode uses composable workflows — see Composable Agentic Workflows for the current model. The 8-phase pipeline is preserved as the default workflow template for back-compat; the content below is retained for historical reference.

At the heart of AgenticKode is an 8-phase worker pipeline that transforms a task description into a reviewed, tested pull request. Each phase has a clear responsibility, configurable trigger modes, and built-in status tracking. This post walks through every phase and explains the design decisions behind the architecture.

Why a Pipeline?

Throwing an entire task at an AI agent and hoping for the best produces inconsistent results. By breaking the process into discrete phases, AgenticKode gains several advantages:

  • Observability: You can see exactly where a task is in the process and inspect the output of each phase independently.
  • Recoverability: If a phase fails, the system can retry from that specific phase without repeating earlier work.
  • Flexibility: Different phases can use different AI agents. Your planning phase might use a large reasoning model while the coding phase uses a fast code-specialized model.
  • Quality gates: Each phase boundary is a natural checkpoint where human review or automated validation can occur.

The Eight Phases

Phase 1: Workspace Setup

The pipeline begins by preparing an isolated workspace on a remote server. This phase:

  • Connects to the configured workspace server via SSH
  • Clones the target repository (or pulls latest changes)
  • Creates a new feature branch named after the task
  • Ensures the workspace has the required tooling installed

All workspace operations happen over SSH through the SSHService. AgenticKode never runs code locally -- workspace servers are remote machines with their own isolated environments.

Phase 2: Init (Context Gathering)

Before any AI agent touches the code, the init phase gathers context about the project:

  • Analyzes the repository structure and technology stack
  • Identifies relevant files and patterns
  • Collects project-specific instructions configured by the team
  • Prepares the context payload that downstream phases will use

This phase ensures that AI agents receive focused, relevant context rather than an entire repository dump.

Phase 3: Planning

The planning phase decomposes the task into actionable subtasks:

  • Takes the original task description and project context
  • Uses an AI agent (configurable per workflow) to break the task into ordered subtasks
  • Each subtask includes a description, target files, and acceptance criteria
  • The plan is stored and visible in the UI for human review

Teams can configure the planning phase with a wait_for_trigger mode, requiring manual approval of the plan before coding begins.

Phase 4: Coding

This is where the primary implementation happens:

  • Iterates through each subtask from the planning phase
  • Dispatches each subtask to the configured AI coding agent
  • The agent works within the isolated workspace, making file changes
  • Supports multiple agent types: Claude CLI, Ollama, OpenHands, and custom adapters

The coding phase uses the RoleAdapter protocol, meaning any AI agent that implements the adapter interface can be plugged in. In comparison mode, multiple agents work on the same task in parallel, and the team picks the best result.

Phase 5: Testing

After coding completes, the testing phase validates the changes:

  • Detects the project's test framework and runs the test suite
  • Reports test results, pass/fail counts, and coverage metrics
  • Captures test output for review in the UI
  • Failures here can trigger a retry of the coding phase with test feedback included

Phase 6: Reviewing

An AI reviewer examines the changes with fresh eyes:

  • Runs a separate AI agent (which can differ from the coding agent) as a code reviewer
  • Checks for bugs, security issues, style violations, and architectural concerns
  • Produces a structured review with actionable feedback
  • Critical issues can loop back to the coding phase for fixes

Using a different agent for review than for coding provides genuine independent verification rather than self-review.

Phase 7: Approval

The approval phase bridges AI automation and human oversight:

  • Pushes the feature branch to the remote repository
  • Creates a pull request with a summary of changes, test results, and review findings
  • Returns an "awaiting" status that parks the run
  • The task remains paused until a human approves or rejects via the UI or API

This is the critical human-in-the-loop checkpoint. No code merges without explicit human approval.

Phase 8: Finalization

Once approved, the finalization phase wraps everything up:

  • Sends notifications through configured channels (Slack, Discord, Telegram, webhooks)
  • Updates the originating issue tracker with completion status
  • Records cost and token usage metrics
  • Cleans up temporary workspace resources
  • Marks the task run as complete

Trigger Modes

Each phase supports three trigger modes that control execution flow:

  • auto (default): The phase runs automatically when the previous phase completes.
  • wait_for_trigger: The pipeline pauses and waits for a manual trigger before running this phase. Useful for plan review before coding.
  • wait_for_approval: Similar to wait_for_trigger, but semantically indicates a human approval gate. Used by the approval phase.

These modes are configurable per workflow template, allowing teams to define exactly how much automation they want.

Error Handling and Retries

The pipeline handles failures at every phase:

  • Each phase can be individually retried without restarting the entire pipeline
  • The worker engine tracks phase status (pending, running, completed, failed, awaiting)
  • Failed phases include error details and logs for debugging
  • Teams can restart a run from any phase through the UI

Comparison Mode

For critical tasks, AgenticKode supports running multiple agents in parallel:

  • Configure two or more agents for the coding phase
  • Each agent works independently on the same task
  • Results are presented side-by-side in the UI
  • The team picks the winning implementation, which continues through the remaining phases

This is particularly useful when evaluating new agents or when the task is complex enough to benefit from multiple approaches.

Configuration Through Workflow Templates

Workflow templates let teams define reusable pipeline configurations:

  • Assign specific agents to specific phases
  • Set trigger modes per phase
  • Define label-based routing (e.g., tasks labeled "frontend" use one template, "backend" uses another)
  • Include custom instructions and role configurations

This means different types of work can flow through differently configured pipelines, all within the same AgenticKode instance.

Wrapping Up

The 8-phase pipeline is designed to make AI-assisted development predictable, observable, and safe. Every phase has a clear boundary, every transition is a potential checkpoint, and human approval is always the final gate before code ships.

To explore the pipeline in detail, check out the Worker Pipeline Technical Reference in the repository.