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

@@ -7,6 +7,7 @@
- Fixed interactive input fields backed by the TUI `Input` component to scroll by visual column width for wide Unicode text (CJK, fullwidth characters), preventing rendered line overflow and TUI crashes in places like search and filter inputs ([#1982](https://github.com/badlogic/pi-mono/issues/1982))
- Fixed `shift+tab` and other modified Tab bindings in tmux when `extended-keys-format` is left at the default `xterm`
- Fixed EXIF orientation not being applied during image convert and resize, causing JPEG and WebP images from phone cameras to display rotated or mirrored ([#2105](https://github.com/badlogic/pi-mono/pull/2105) by [@melihmucuk](https://github.com/melihmucuk))
- Fixed the default coding-agent system prompt to include only the current date in ISO format, not the current time, so prompt prefixes stay cacheable across reloads and resumed sessions ([#2131](https://github.com/badlogic/pi-mono/issues/2131))
## [0.57.1] - 2026-03-07

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;