Repository navigation
Studio: stop writing the date into user messages - #12699
Conversation
There was a problem hiding this comment.
Review + reproduction evidence
Pinned review: 85bef7215e. Three regressions found and fixed in cf8831b455, 0d7a881800 and 85bef7215e; follow-ups below.
Same steps on main (9d76f755) and on this branch, Linux with an NVIDIA L4, default settings ("Tell the model today's date" on, no system prompt):
- Echo test, Gemma 4 12B, "Repeat my message above exactly as you received it": main repeats
[Current date: 2026-10-05]before the message in 3/3 runs. This branch repeats the message as typed in 3/3. Asked "What's today's date?", both answer October 5, 2026. - Role-play chat started three weeks earlier, next turn sent: on main the reasoning brings up the date in 3/3 replies ("The current date changed from 2026-09-15 to 2026-10-05 ... let me check the date jump"). On this branch it does in 0/3.
Fixed on this branch
cf8831b455: with Search or Code on and no system prompt, a model whose template states the date itself (Granite 3.x, Mistral Small 3.x) got no date, because the tool instructions became the only system turn. Granite 3.3 2B, "What is today's date?": main2026-10-05, as submitted2023-03-15, now2026-10-05, 3/3 each. The same commit makes safetensors and MLX read an applied chat template override instead of the shipped template.0d7a881800: a model whosechat_templateis a list of named templates (Hermes-3) lost its built-in system prompt. Thedefaulttemplate is now read.85bef7215e: the template's own default is now rendered for the user's day, not the server's. Granite 3.3 on a UTC server, browser on October 5, tools off: before "October 04, 2026", now "October 05, 2026" (3/3). Mistral Small 3.2 works out "yesterday" from that same day. The same commit keeps the default of templates that read text from content parts: granite-vision 3.2 lost "A chat between a curious user and an artificial intelligence assistant...", and its prompt goes from 45 to 78 tokens on a text turn and from 1,363 to 1,396 with an image, the same counts its own tokenizer and processor give for the date plus that default.
The PR's tests and the tool passthrough suites pass on this branch (2281 passed); on main the PR's tests fail (15 failed, 6 errors).
Follow-ups, not in this PR
- On vLLM/SGLang engines and for Gemma 3n audio, the date line can still replace the template's own default system prompt or instruction.
Codex coverageCodex does not answer
Status: no open items on the current head. Every finding above is fixed or rejected, and rounds 3 and 4 raised only items that were rejected. |
…or managed engines
…default that replays exactly
…every special token
Final review and repair evidenceReviewed from merge base The repair commit preserves native chat-template defaults across generation-tag templates, Transformers-compatible Verification:
The full source CI matrix has been retriggered for the repaired head. The prior source head was green across Linux, macOS, Windows, cross-browser, lint, CodeQL, wheel, and startup checks. |
mahiatlinux
left a comment
There was a problem hiding this comment.
LGTM! Ready to merge, all manually checked.



With "Tell the model today's date" on, Studio has been adding
[Current date: YYYY-MM-DD]to the user's own messages since #12096, and with no system prompt also to the first message since #12382. Models read it as part of the chat. In role-play, Gemma 4 replies "The date has turned" and jumps the story ahead.Now the date is one line in the system prompt,
The current date is YYYY-MM-DD., and user messages are sent as written.Before / after this PR
Gemma 4 26B-A4B (UD-Q4_K_M), a role-play chat started 3 weeks earlier, no system prompt, default settings. Same chat and turn on both.
[Current date: 2026-09-14]on the first user message,[Current date: 2026-10-05]on the newestThe current date is 2026-10-05.in the system prompt, user messages as writtenBefore (main): the reasoning opens with "October 5, 2026 (Current date in-prompt)".
After (this PR): the reasoning goes straight to the scene.
Where it started
v0.1.815, with the date only in the system prompt: the reasoning goes straight to the scene.
v0.1.902, after #12096 and #12382: the reasoning opens with "Current date: 2026-10-04 (this is a metadata update…)".
Tests updated for the removed note, plus new tests for the system-prompt date and template-default handling.