fix: inject agent identity into system prompt for built-in agents (#2964)

Built-in agents (Sisyphus, Hephaestus, Atlas) now include explicit
identity section in their system prompts, matching custom agent behavior.

12 agent identity tests pass, 266 total pass, tsc clean.

Closes #2964
This commit is contained in:
YeonGyu-Kim
2026-04-07 15:24:01 +09:00
parent be562905d6
commit b2e7ddfb73
7 changed files with 188 additions and 6 deletions
+6 -2
View File
@@ -14,7 +14,7 @@ import type { AgentConfig } from "@opencode-ai/sdk"
import type { AgentMode, AgentPromptMetadata } from "../types"
import { isGptModel, isGeminiModel } from "../types"
import type { AvailableAgent, AvailableSkill, AvailableCategory } from "../dynamic-agent-prompt-builder"
import { buildCategorySkillsDelegationGuide } from "../dynamic-agent-prompt-builder"
import { buildAgentIdentitySection, buildCategorySkillsDelegationGuide } from "../dynamic-agent-prompt-builder"
import type { CategoryConfig } from "../../config/schema"
import { mergeCategories } from "../../shared/merge-categories"
@@ -88,9 +88,13 @@ function buildDynamicOrchestratorPrompt(ctx?: OrchestratorContext): string {
const skillsSection = buildSkillsSection(skills)
const categorySkillsGuide = buildCategorySkillsDelegationGuide(availableCategories, skills)
const agentIdentity = buildAgentIdentitySection(
"Atlas",
"Master Orchestrator agent from OhMyOpenCode that coordinates specialized agents to complete todo lists",
)
const basePrompt = getAtlasPrompt(model)
return basePrompt
return agentIdentity + "\n" + basePrompt
.replace("{CATEGORY_SECTION}", categorySection)
.replace("{AGENT_SECTION}", agentSection)
.replace("{DECISION_MATRIX}", decisionMatrix)