Fix custom system prompts missing context, skills, date/time, cwd

fixes #321
This commit is contained in:
Mario Zechner 2025-12-26 03:06:10 +01:00
parent 9652072f20
commit fbfdeb2c2e
2 changed files with 11 additions and 1 deletions

View file

@ -550,7 +550,13 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
if (options.systemPrompt === undefined) {
systemPrompt = defaultPrompt;
} else if (typeof options.systemPrompt === "string") {
systemPrompt = options.systemPrompt;
systemPrompt = buildSystemPromptInternal({
cwd,
agentDir,
skills,
contextFiles,
customPrompt: options.systemPrompt,
});
} else {
systemPrompt = options.systemPrompt(defaultPrompt);
}