Skip to content

test(agents): the pinned Claude Code tells the model when the date changes between turns - #889

Merged
earakely-scale merged 1 commit into
mainfrom
edgararakelyan/fd-6474-claude-code-date-reminder-guard
Nov 23, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
edgararakelyan/fd-6474-claude-code-date-reminder-guard

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Why

FD-6474 reported that on an env clock that jumps between turns, Claude Code's "Today's date is" line keeps the session's first date, so the model sees two dates. A repro on the published image says that isn't so. The 11-20 test that found it scanned only the system prompt and the first user message, and missed where the CLI announces the change.

Repro: the published agentenv-claude-code image, Claude Code 2.1.322, with its clock page set by hand. I ran real claude -p turns with the bridge's flags (--session-id, then --resume) against a stand-in endpoint that saved every request.

  • Jumps between turns (2027-02-04 → 2200-01-01 → 1950-01-01 → real time → 2027-02-04): the first user message keeps "Today's date is 2027-02-04." as history. Each later turn's message adds "The date has changed. Today's date is now .", on the first request after each jump. History stayed intact every turn.
  • A jump during a turn, made while the Bash tool ran, with --system-prompt set: the tool-result request carries "The date has changed. Today's date is now 2200-01-01."

On every request, the CLI compares today's date with the last date in the conversation, and adds the reminder when they differ.

What

  • tst/integration/agent/claude_code_date_test.py downloads the Claude Code build the Dockerfile pins, from its checksummed release manifest, as the image installs it. It runs two turns with the bridge's own argv (_command) against the fake Anthropic endpoint, in time zones 26 hours apart (UTC+14, then UTC-12), so the date changes with no clock faked. It checks that the resumed turn keeps the first turn and its date line, and that it tells the model "The date has changed. Today's date is now <the second zone's date>." Bumping the CLI runs this test against the new version, so a version that stopped telling the model fails CI.
  • The agents README says how a resumed Claude Code session learns the date.
  • The version-pin test's message points at the new test.

Tests

  • The new test passes against 2.1.322. I checked it: with the second turn in the same zone, it fails with "Claude Code 2.1.322 didn't tell the model the date changed".
  • The Claude Code unit tests pass (380).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

This PR appears safe to merge.

Summary

Adds a regression test for date changes in resumed Claude Code sessions.

  • Claude Code's pinned-version checks now cover date changes across resumed turns.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "test(agents): the pinned Claude Code tel..." · Reviewed by Greptile

…anges between turns

A resumed Claude Code session keeps its first turn's "Today's date is" line, and the CLI adds "The date has changed.
Today's date is now ..." on its next model call once the date differs, between turns or during one. That is how the
model learns an env clock's jump. An integration test downloads the CLI the Dockerfile pins, from its checksummed
release manifest, and runs two turns with the bridge's own argv in time zones 26 hours apart, so a CLI that stopped
telling the model fails CI. The README says how a resumed session learns the date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 23, 2026 16:57
@earakely-scale
earakely-scale merged commit ce08948 into main Nov 23, 2026
35 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-6474-claude-code-date-reminder-guard branch November 23, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant