fix(coding-agent): string systemPrompt now works as full replacement
When passing a string systemPrompt to createAgentSession(), it is now used as-is without appending context files and skills. This matches the documented behavior: 'String replaces default, function receives default and returns final.' Previously, string systemPrompt would have context files and skills appended, causing duplication if they were already in the string. fixes #543
This commit is contained in:
@@ -549,14 +549,8 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
||||
if (options.systemPrompt === undefined) {
|
||||
return defaultPrompt;
|
||||
} else if (typeof options.systemPrompt === "string") {
|
||||
return buildSystemPromptInternal({
|
||||
cwd,
|
||||
agentDir,
|
||||
skills,
|
||||
contextFiles,
|
||||
selectedTools: validToolNames,
|
||||
customPrompt: options.systemPrompt,
|
||||
});
|
||||
// String is a full replacement - use as-is without appending context/skills
|
||||
return options.systemPrompt;
|
||||
} else {
|
||||
return options.systemPrompt(defaultPrompt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user