fix(status): return current time from session_status and harden time-hint prompt#100187
fix(status): return current time from session_status and harden time-hint prompt#100187connermo wants to merge 1 commit into
Conversation
…hint prompt The session_status status card had a timeLine render slot that was never populated, so the model was told to call session_status for the date/time yet got none back and would guess (time hallucination). Derive the live Current time line from now + config timezone in buildStatusMessage so both the /status command and session_status tool surface it, and strengthen the system-prompt hint to forbid guessing the current time. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 2:03 AM ET / 06:03 UTC. Summary PR surface: Source +7, Tests +20. Total +27 across 3 files. Reproducibility: yes. by source inspection: current main documents Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the centralized status-renderer fix after the contributor adds redacted real behavior proof showing Do we have a high-confidence way to reproduce the issue? Yes by source inspection: current main documents Is this the best way to solve the issue? Yes: computing the missing line inside the shared status renderer with the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 062f88e3e3af. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +7, Tests +20. Total +27 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Confirmed the root cause and the fix. The fix is correct and well scoped:
On the prompt-cache seam, which is the part most likely to bite: the live per-call time lands only in the tool result and status card, which is dynamic and sits after the cached system-prompt prefix. The system-prompt change is static instruction text with no embedded clock value, so the cached prefix stays byte-stable. No cache-busting, and it follows the existing cron/heartbeat current-time pattern. The new test fails without the fix (pre-fix the One optional nit: the test only covers |
|
Thank you for the contribution. This fix landed with contributor co-authorship preserved in #100258 ( I consolidated the source fixes into a maintainer takeover because the contributor branches were based on rewritten pre- |
What Problem This Solves
The
session_statuscard exposed a "Current time" slot, and the agent system prompt told the model to runsession_statuswhenever it needed the date/time. ButbuildStatusMessagenever populated the time line —args.timeLinewas alwaysundefined— so the tool returned no clock value. The model, having no real time to read, would fall back to guessing from stale training data (wrong day/date), breaking anything time-dependent (scheduling, "today/now", elapsed/age math).Why This Change Was Made
Make the status card actually carry a live wall-clock line so the documented "call session_status for the time" contract works. The time is derived from
now+ the configureduserTimezoneviaresolveCronStyleNow, so every render path (the/statuscommand and thesession_statustool) surfaces the same value. The prompt hint is also hardened to explicitly forbid guessing the current moment and to name theCurrent timefield to read.User Impact
Agents now get an accurate current date/time from
session_statusinstead of guessing. No config or API changes; the time line renders from existing config/timezone.Evidence
src/status/status-message.test.tsasserts the rendered card containsCurrent time:, the timezone, and the fixedReference UTCline for a knownnow.node scripts/run-vitest.mjs src/status/status-message.test.ts→ 3 passed.🤖 Generated with Claude Code