fix(coding-agent): keep only ISO date in system prompt closes #2131

This commit is contained in:
Mario Zechner
2026-03-13 21:05:56 +01:00
parent cea27bb899
commit 4b9e6006fa
2 changed files with 6 additions and 15 deletions

View File

@@ -49,17 +49,7 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin
} = options;
const resolvedCwd = cwd ?? process.cwd();
const now = new Date();
const dateTime = now.toLocaleString("en-US", {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
timeZoneName: "short",
});
const date = new Date().toISOString().slice(0, 10);
const appendSection = appendSystemPrompt ? `\n\n${appendSystemPrompt}` : "";
@@ -88,8 +78,8 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin
prompt += formatSkillsForPrompt(skills);
}
// Add date/time and working directory last
prompt += `\nCurrent date and time: ${dateTime}`;
// Add date and working directory last
prompt += `\nCurrent date: ${date}`;
prompt += `\nCurrent working directory: ${resolvedCwd}`;
return prompt;
@@ -210,8 +200,8 @@ Pi documentation (read only when the user asks about pi itself, its SDK, extensi
prompt += formatSkillsForPrompt(skills);
}
// Add date/time and working directory last
prompt += `\nCurrent date and time: ${dateTime}`;
// Add date and working directory last
prompt += `\nCurrent date: ${date}`;
prompt += `\nCurrent working directory: ${resolvedCwd}`;
return prompt;