mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 23:01:30 +00:00
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:
parent
dc54c308a9
commit
8fda948866
2 changed files with 3 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue