|
@@ -30,6 +30,7 @@ import {
|
|
|
createOrchestratorAgent,
|
|
createOrchestratorAgent,
|
|
|
resolvePrompt,
|
|
resolvePrompt,
|
|
|
} from './orchestrator';
|
|
} from './orchestrator';
|
|
|
|
|
+import { appendTaskRejectionInstruction } from './task-rejection';
|
|
|
|
|
|
|
|
export type { AgentDefinition } from './orchestrator';
|
|
export type { AgentDefinition } from './orchestrator';
|
|
|
|
|
|
|
@@ -231,7 +232,10 @@ function buildCustomAgentDefinition(
|
|
|
filePrompt?: string,
|
|
filePrompt?: string,
|
|
|
fileAppendPrompt?: string,
|
|
fileAppendPrompt?: string,
|
|
|
): AgentDefinition {
|
|
): AgentDefinition {
|
|
|
- const basePrompt = override.prompt ?? `You are the ${name} specialist.`;
|
|
|
|
|
|
|
+ const defaultPrompt = appendTaskRejectionInstruction(
|
|
|
|
|
+ `You are the ${name} specialist.`,
|
|
|
|
|
+ );
|
|
|
|
|
+ const basePrompt = override.prompt ?? defaultPrompt;
|
|
|
const primaryModel = getPrimaryModelFromOverride(override);
|
|
const primaryModel = getPrimaryModelFromOverride(override);
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
@@ -388,7 +392,9 @@ export function createAgents(
|
|
|
|
|
|
|
|
const override = getAgentOverride(config, name);
|
|
const override = getAgentOverride(config, name);
|
|
|
const inlinePrompt = override?.prompt;
|
|
const inlinePrompt = override?.prompt;
|
|
|
- const defaultPrompt = agent.config.prompt ?? '';
|
|
|
|
|
|
|
+ const defaultPrompt = appendTaskRejectionInstruction(
|
|
|
|
|
+ agent.config.prompt ?? '',
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
const basePrompt =
|
|
const basePrompt =
|
|
|
inlinePrompt !== undefined ? inlinePrompt : defaultPrompt;
|
|
inlinePrompt !== undefined ? inlinePrompt : defaultPrompt;
|
|
@@ -508,6 +514,12 @@ export function createAgents(
|
|
|
...councillorAgents,
|
|
...councillorAgents,
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
|
|
+ for (const agent of [...acpSubAgents, ...councillorAgents]) {
|
|
|
|
|
+ agent.config.prompt = appendTaskRejectionInstruction(
|
|
|
|
|
+ agent.config.prompt ?? '',
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 3. Create Orchestrator (with its own overrides and custom prompts)
|
|
// 3. Create Orchestrator (with its own overrides and custom prompts)
|
|
|
// DEFAULT_MODELS.orchestrator is undefined; model is resolved via override or
|
|
// DEFAULT_MODELS.orchestrator is undefined; model is resolved via override or
|
|
|
// left unset so the runtime chat.message hook can pick it from _modelArray.
|
|
// left unset so the runtime chat.message hook can pick it from _modelArray.
|