Skip to main content

Module clock

Module clock 

Source
Expand description

BP-3 (catalog row “Clock / sleep tools”, cc§1 ScheduleWakeup variant / cx§1 clock+sleep features): the two tools that let a model read the wall clock and pace itself.

  • CurrentTimeTool (current_time) — the current instant as an ISO-8601/RFC3339 UTC timestamp plus, where the platform can tell us, the local timezone name and UTC offset. Built on crate::sidecar::ms_to_rfc3339, the same formatter every session timestamp in this workspace is written with — one clock rendering, not a second one.
  • SleepTool (sleep) — pause the turn for a bounded number of seconds. Bounded by MAX_SLEEP_SECS (a model cannot park a session indefinitely) and cancel-safe: the pause is a tokio::time::sleep inside the tool’s own future, so interrupting the turn drops it immediately rather than leaving a timer running.

Neither tool is a scheduler. ScheduleWakeup (crate::agent’s Claude-compat intrinsic) edits an imported manifest and owns no timer; these two report the time and pause THIS turn. Nothing here starts background work.

Structs§

CurrentTimeTool
current_time — the wall clock, ISO-8601 plus timezone.
SleepTool
sleep — pause this turn for a bounded number of seconds.

Constants§

CURRENT_TIME
Registered name of the clock tool.
MAX_SLEEP_SECS
The longest a single sleep call may pause the turn: four hours, the “pause up to hours” the catalog row describes, with a hard ceiling so a runaway loop cannot park a session forever.
SLEEP
Registered name of the sleep tool.