feat(atlas): mandate parallel delegation and add per-model variants
Atlas was delegating tasks one-by-one because the workflow framed parallel
as a conditional ("if tasks can run in parallel..."), letting models default
to the safer sequential path. The new shared ATLAS_PARALLEL_BY_DEFAULT block
flips the default: parallel is mandatory; sequential requires a NAMED
blocking dependency (input dependency or file conflict).
Adds two new prompt variants — kimi (K2.6 thinking-mode calibration:
commitment framing + concrete budgets) and opus-4-7 (counters 4.7's lower
default subagent count and literal-following bias). Recalibrates default
(Claude 4.6 family), gpt (GPT-5.5 outcome-first / decision rules over
absolutes), and gemini (preserves TOOL_CALL_MANDATE; replaces stale
session_id with task_id). All five variants share the parallel mandate
positioned BEFORE the workflow so "mandate above" references resolve.
Strengthens the orchestrator-direct-edit reminder hooks
(ORCHESTRATOR_DELEGATION_REQUIRED + DIRECT_WORK_REMINDER) with the central
challenge "Do you ACTUALLY need to be the one doing this?" — replacing the
previous bullet-heavy framing.
Tests now parametrized over all 5 variants. Adds prompt-routing.test
covering GPT/Gemini/Kimi/Opus 4.7/default routing and edge cases, plus a
session_id rejection test (every variant must use task_id for retries).
This commit is contained in:
+20
-13
@@ -2,17 +2,18 @@
|
||||
* Atlas - Master Orchestrator Agent
|
||||
*
|
||||
* Orchestrates work via task() to complete ALL tasks in a todo list until fully done.
|
||||
* You are the conductor of a symphony of specialized agents.
|
||||
*
|
||||
* Routing:
|
||||
* 1. GPT models (openai/*, github-copilot/gpt-*) → gpt.ts (GPT-5.4 optimized)
|
||||
* 2. Gemini models (google/*, google-vertex/*) → gemini.ts (Gemini-optimized)
|
||||
* 3. Default (Claude, etc.) → default.ts (Claude-optimized)
|
||||
* Prompt routing (`getAtlasPromptSource`, evaluated in this order):
|
||||
* 1. GPT family → gpt.ts (calibrated for GPT-5.5)
|
||||
* 2. Gemini family → gemini.ts
|
||||
* 3. Kimi K2.x family → kimi.ts (Claude-family base + K2.6 thinking-mode calibration)
|
||||
* 4. Claude Opus 4.7 → opus-4-7.ts (literal-following + explicit fan-out push)
|
||||
* 5. Default (Claude 4.6 family: opus-4-6, sonnet-4-6, haiku-4-5, etc.) → default.ts
|
||||
*/
|
||||
|
||||
import type { AgentConfig } from "@opencode-ai/sdk"
|
||||
import type { AgentMode, AgentPromptMetadata } from "../types"
|
||||
import { isGptModel, isGeminiModel } from "../types"
|
||||
import { isClaudeOpus47Model, isGeminiModel, isGptModel, isKimiK2Model } from "../types"
|
||||
import type { AvailableAgent, AvailableSkill, AvailableCategory } from "../dynamic-agent-prompt-builder"
|
||||
import { buildAgentIdentitySection, buildCategorySkillsDelegationGuide } from "../dynamic-agent-prompt-builder"
|
||||
import type { CategoryConfig } from "../../config/schema"
|
||||
@@ -21,6 +22,8 @@ import { mergeCategories } from "../../shared/merge-categories"
|
||||
import { getDefaultAtlasPrompt } from "./default"
|
||||
import { getGptAtlasPrompt } from "./gpt"
|
||||
import { getGeminiAtlasPrompt } from "./gemini"
|
||||
import { getKimiAtlasPrompt } from "./kimi"
|
||||
import { getOpus47AtlasPrompt } from "./opus-4-7"
|
||||
import {
|
||||
getCategoryDescription,
|
||||
buildAgentSelectionSection,
|
||||
@@ -31,11 +34,8 @@ import {
|
||||
|
||||
const MODE: AgentMode = "primary"
|
||||
|
||||
export type AtlasPromptSource = "default" | "gpt" | "gemini"
|
||||
export type AtlasPromptSource = "default" | "gpt" | "gemini" | "kimi" | "opus-4-7"
|
||||
|
||||
/**
|
||||
* Determines which Atlas prompt to use based on model.
|
||||
*/
|
||||
export function getAtlasPromptSource(model?: string): AtlasPromptSource {
|
||||
if (model && isGptModel(model)) {
|
||||
return "gpt"
|
||||
@@ -43,6 +43,12 @@ export function getAtlasPromptSource(model?: string): AtlasPromptSource {
|
||||
if (model && isGeminiModel(model)) {
|
||||
return "gemini"
|
||||
}
|
||||
if (model && isKimiK2Model(model)) {
|
||||
return "kimi"
|
||||
}
|
||||
if (model && isClaudeOpus47Model(model)) {
|
||||
return "opus-4-7"
|
||||
}
|
||||
return "default"
|
||||
}
|
||||
|
||||
@@ -53,9 +59,6 @@ export interface OrchestratorContext {
|
||||
userCategories?: Record<string, CategoryConfig>
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the appropriate Atlas prompt based on model.
|
||||
*/
|
||||
export function getAtlasPrompt(model?: string): string {
|
||||
const source = getAtlasPromptSource(model)
|
||||
|
||||
@@ -64,6 +67,10 @@ export function getAtlasPrompt(model?: string): string {
|
||||
return getGptAtlasPrompt()
|
||||
case "gemini":
|
||||
return getGeminiAtlasPrompt()
|
||||
case "kimi":
|
||||
return getKimiAtlasPrompt()
|
||||
case "opus-4-7":
|
||||
return getOpus47AtlasPrompt()
|
||||
case "default":
|
||||
default:
|
||||
return getDefaultAtlasPrompt()
|
||||
|
||||
Reference in New Issue
Block a user