fix(coding-agent): keep only ISO date in system prompt closes #2131
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user