Files
oh-my-pi/packages/coding-agent/src/task/template.ts
T
can1357 2e20d87151 feat(coding-agent): simplified skill management by removing per-task pinning
- Removed per-task skill pinning feature; subagents now inherit session skill set instead of per-task selection.
- Removed `preloadedSkills` option from `CreateAgentSessionOptions` interface and related system prompt plumbing.
- Removed `skills` field from Task schema; task execution now passes available session skills directly to subagents.
- Simplified task execution pipeline by removing skill resolution logic and preloaded skills handling from system prompt templates.
2026-02-26 20:47:54 +01:00

31 lines
896 B
TypeScript

import { renderPromptTemplate } from "../config/prompt-templates";
import subagentUserPromptTemplate from "../prompts/system/subagent-user-prompt.md" with { type: "text" };
import type { TaskItem } from "./types";
interface RenderResult {
/** Full task text sent to the subagent */
task: string;
id: string;
description: string;
}
/**
* Build the full task text from shared context and per-task assignment.
*
* If context is provided, it is prepended with a separator.
*/
export function renderTemplate(context: string | undefined, task: TaskItem): RenderResult {
let { id, description, assignment } = task;
assignment = assignment.trim();
context = context?.trim();
if (!context || !assignment) {
return { task: assignment || context!, id, description };
}
return {
task: renderPromptTemplate(subagentUserPromptTemplate, { context, assignment }),
id,
description,
};
}