fix(delegate-task): make plan agent categories/skills dynamic

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-06 17:31:13 +09:00
parent 3be722b3b1
commit 6b560ebf9e
7 changed files with 268 additions and 79 deletions
+11 -3
View File
@@ -1,14 +1,22 @@
import { PLAN_AGENT_SYSTEM_PREPEND, isPlanAgent } from "./constants"
import type { BuildSystemContentInput } from "./types"
import { buildPlanAgentSystemPrepend, isPlanAgent } from "./constants"
/**
* Build the system content to inject into the agent prompt.
* Combines skill content, category prompt append, and plan agent system prepend.
*/
export function buildSystemContent(input: BuildSystemContentInput): string | undefined {
const { skillContent, categoryPromptAppend, agentName } = input
const {
skillContent,
categoryPromptAppend,
agentName,
availableCategories,
availableSkills,
} = input
const planAgentPrepend = isPlanAgent(agentName) ? PLAN_AGENT_SYSTEM_PREPEND : ""
const planAgentPrepend = isPlanAgent(agentName)
? buildPlanAgentSystemPrepend(availableCategories, availableSkills)
: ""
if (!skillContent && !categoryPromptAppend && !planAgentPrepend) {
return undefined