Skip to content

feat(session_status): include ISO-8601 and Unix timestamps for scheduling (fixes #10841)#10836

Open
jeanlucthumm wants to merge 2 commits intoopenclaw:mainfrom
jeanlucthumm:fix/session-status-unix-timestamp
Open

feat(session_status): include ISO-8601 and Unix timestamps for scheduling (fixes #10841)#10836
jeanlucthumm wants to merge 2 commits intoopenclaw:mainfrom
jeanlucthumm:fix/session-status-unix-timestamp

Conversation

@jeanlucthumm
Copy link
Copy Markdown

@jeanlucthumm jeanlucthumm commented Feb 7, 2026

Problem

Fixes: #10841

The cron scheduler requires ISO-8601 timestamps for schedule.at jobs, but agents don't have access to the current time in a machine-readable format. When users ask to "set a reminder in 30 minutes", the agent has to guess the target timestamp — often getting it wrong.

The system prompt only includes the timezone (e.g., Time zone: America/Chicago), not the actual time. The existing hint says to call session_status, but that tool only returned human-readable time like:

🕒 Time: Friday, February 6th, 2026 — 2:32 PM (America/New_York)

This isn't useful for calculating now + 1800 seconds or formatting an ISO-8601 timestamp.

Solution

Enhance session_status to include machine-readable timestamps:

🕒 Time: Friday, February 6th, 2026 — 2:32 PM (America/New_York)
   ISO-8601: 2026-02-06T19:32:45.123Z | Unix: 1738874365

Also update the system prompt hint to mention these formats are available for scheduling.

Why not inject time into the system prompt?

Several PRs have attempted to add current time to the system prompt:

The problem is prompt cache stability. The system prompt is cached, and injecting a timestamp that changes every second/minute breaks caching. This was an intentional design decision (see commit 66eec29).

Our approach keeps the system prompt stable while giving agents access to precise timestamps when they need them via a tool call.

Related Issues

Main tracking issue: #10841

Test Plan

  • session_status now returns ISO-8601 and Unix timestamps
  • System prompt hint updated to mention scheduling formats
  • Tests added for new timestamp output
  • All existing tests pass

Greptile Overview

Greptile Summary

  • Extends the session_status tool output to include machine-readable current timestamps (ISO-8601 and Unix seconds) alongside the existing human-readable time.
  • Updates the agent system prompt hint to explicitly mention the new scheduling-friendly timestamp formats.
  • Adds/updates tests to assert the presence of the ISO-8601 and Unix timestamp lines in session_status output and the system prompt hint text.
  • Implementation is localized to src/agents/tools/session-status-tool.ts and prompt construction in src/agents/system-prompt.ts, aligning with the repo’s existing “tool call for current time” approach rather than injecting time into the system prompt.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are small and well-scoped (string formatting + prompt hint + tests). No behavior changes outside session_status output formatting. Only noted issue is a brittle test/implicit contract around Unix timestamp digit length, which is easy to adjust.
  • src/agents/openclaw-tools.session-status.test.ts

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added the agents Agent runtime and tooling label Feb 7, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 21, 2026
@jeanlucthumm
Copy link
Copy Markdown
Author

Not stale

@HenryLoenwind
Copy link
Copy Markdown
Contributor

But in need of a rebase...

@openclaw-barnacle openclaw-barnacle bot removed the stale Marked as stale due to inactivity label Feb 23, 2026
@jeanlucthumm jeanlucthumm force-pushed the fix/session-status-unix-timestamp branch from e2c014f to 8528ab6 Compare February 27, 2026 23:12
@jeanlucthumm
Copy link
Copy Markdown
Author

@HenryLoenwind all good

@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Mar 8, 2026
@jeanlucthumm
Copy link
Copy Markdown
Author

not stale

@openclaw-barnacle openclaw-barnacle bot removed the stale Marked as stale due to inactivity label Mar 9, 2026
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Mar 15, 2026
@jeanlucthumm
Copy link
Copy Markdown
Author

Not stale

@openclaw-barnacle openclaw-barnacle bot removed the stale Marked as stale due to inactivity label Mar 18, 2026
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Mar 23, 2026
@jeanlucthumm
Copy link
Copy Markdown
Author

not stale

@openclaw-barnacle openclaw-barnacle bot removed the stale Marked as stale due to inactivity label Mar 24, 2026
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Mar 30, 2026
@jeanlucthumm
Copy link
Copy Markdown
Author

not stale

@openclaw-barnacle openclaw-barnacle bot removed the stale Marked as stale due to inactivity label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reminders set for wrong times because agent doesn't know current time

2 participants