Skip to content

v1.8.1 — Orchestrator + Specialized Agents (Phase 2)

Choose a tag to compare

@Zafer83 Zafer83 released this 17 Apr 18:17
· 1 commit to main since this release

Orchestrator — Master/Sub-Agent Pipeline

Phase 2 of the multi-agent architecture. For highly complex tasks (classifier score ≥ 4), VertexAgent now runs a full Planner → parallel Coders → Security Auditor → Test Writer → Judge pipeline. The single-call path is preserved unchanged for simple and trivial tasks.

What's new

Orchestrator (src/agent/orchestrator.ts)

  • Planner LLM decomposes the task into a structured JSON plan with roles, target files, and per-step prompts. Falls back to a single coder step on any parse error — the flow is never blocked.
  • Up to maxSubAgents (default: 3) Coder sub-agents run in parallel via Promise.all, each receiving only its relevant file context.
  • Edit conflicts resolved by last-write-wins per filepath.

Implicit Security Audit

  • When the prompt contains keywords like auth, password, jwt, encrypt, sql, xss, a security_auditor step is automatically appended even if the Planner didn't include it.

Test Writer

  • When autoWriteTests is enabled (default: true), a test_writer step is added for tasks that create new modules or classes.

Mixed-Provider Routing (src/ai/providerRouter.ts)

  • vertexAgent.plannerProvider: route Planner calls to Claude/Gemini while coding with your main (cheaper) model.
  • vertexAgent.judgeApiKey: separate API key for the judge provider.

Sub-Agent Progress

  • Real-time status in chat: 🗺 Planning task… → ⚡ Coding N file(s) in parallel… → 🔒 Security audit… → 🧪 Writing tests… → 🔍 Reviewing edits…

Role-Specific Prompts (src/ai/prompts.ts)

  • Each sub-agent role receives a focused, token-efficient English system prompt.

New settings

Setting Default Description
vertexAgent.orchestratorEnabled true Enable Orchestrator for score ≥ 4 tasks
vertexAgent.plannerProvider "same" Provider for Planner sub-agent
vertexAgent.maxSubAgents 3 Max parallel Coder sub-agents (1–6)
vertexAgent.autoWriteTests true Auto-add Test Writer step for new modules

Tests

  • orchestrator-planning.test.js — 45 assertions: plan parsing, fallback scenarios, role sanitization, maxSubAgents capping, code block extraction, path traversal blocking, edit deduplication, security keyword detection
  • orchestrator-routing.test.js — 28 assertions: all provider combinations, judgeApiKey fallback, access token propagation

223 total unit test assertions across 8 test files — all passing.

Bug fix

  • Removed duplicate multiAgentForOllama variable declaration in aiClient.ts that caused a compile error.