feat(coding-agent): added prompt markers to system prompt assembly
- Added explicit prompt markers and wrappers across system templates, including `[env]`, `[role]`, `[coop]`, `[closure]`, and `[now]`. - Removed `renderTemplate` and `sectionSeparator` flows, deleted `task/template.ts`, and switched to per-task `renderSubagentUserPrompt` rendering. - Updated system prompt assembly to `shortenPath`-normalize `cwd`, append rendered now metadata, and preserve trailing `[now]` blocks. - Removed legacy template tests and added prompt-composition tests for ordered `[contract]`->`[project]`->`[now]` blocks and context-only system placement. - Reworked shared prompt utilities by collapsing consecutive blank lines and removing obsolete `OPENING_HBS`/`LIST_ITEM` helper behavior.
This commit is contained in:
@@ -139,6 +139,7 @@ export interface ExecutorOptions {
|
||||
agent: AgentDefinition;
|
||||
task: string;
|
||||
assignment?: string;
|
||||
context?: string;
|
||||
description?: string;
|
||||
index: number;
|
||||
id: string;
|
||||
@@ -994,17 +995,20 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
skills: options.skills,
|
||||
promptTemplates: options.promptTemplates,
|
||||
workspaceTree: options.workspaceTree,
|
||||
systemPrompt: defaultPrompt => [
|
||||
prompt.render(subagentSystemPromptTemplate, {
|
||||
base: defaultPrompt.join("\n\n"),
|
||||
systemPrompt: defaultPrompt => {
|
||||
const subagentPrompt = prompt.render(subagentSystemPromptTemplate, {
|
||||
agent: agent.systemPrompt,
|
||||
context: options.context?.trim() ?? "",
|
||||
worktree: worktree ?? "",
|
||||
outputSchema: normalizedOutputSchema,
|
||||
contextFile: options.contextFile,
|
||||
ircPeers: ircEnabled ? renderIrcPeerRoster(id) : "",
|
||||
ircSelfId: ircEnabled ? id : "",
|
||||
}),
|
||||
],
|
||||
});
|
||||
return defaultPrompt.length === 0
|
||||
? [subagentPrompt]
|
||||
: [...defaultPrompt.slice(0, -1), subagentPrompt, defaultPrompt[defaultPrompt.length - 1]];
|
||||
},
|
||||
sessionManager,
|
||||
hasUI: false,
|
||||
spawns: spawnsEnv,
|
||||
|
||||
Reference in New Issue
Block a user