last_activity
last_activity
Epoch seconds of the newest message, or None when nothing is dated. A static method.
This bootstraps a browser’s idle clock across a reload. Without it a widget restarts the clock at zero on load, so a tab closed for 55 minutes of a 60-minute timeout would wait another full hour before warning, while the conversation actually dies in five.
Every role counts, not just the visible ones. The service’s idle clock runs off the conversation’s
own last write, so filtering to user and assistant would report an older time than the service is
measuring and warn early for no reason. Call this before
visible_messages(), which strips timestamps.
Parameters
messages
The raw messages, as returned by AIChatClient.log().
Returns
float | None — epoch seconds of the newest message, converted from the microseconds the service
stores. None when no message carries a timestamp.