Quick Start
Enable timestamps in your gateway config
Add one line under Run with:The model now sees each turn with its real arrival time:
session: to stamp every inbound turn:How It Works
The session manager strips any stale prefix and re-stamps each turn with its real arrival time before the agent sees it.| Behavior | Detail |
|---|---|
| Scope | Applied to both per_user (DM) and per_chat (group) turns |
| Group ordering | The time sits outermost, after sender attribution — e.g. [Fri 2026-07-09 10:15 UTC] [alice] hello |
| Replay-safe | Leading prefixes are stripped and re-rendered each turn, so compaction / reset never accumulates [ts] [ts] … text |
| Fallback | Without a platform receive time, a timezone-aware UTC now() is used so %Z renders UTC |
| Fail-open | On a strftime error the raw un-stamped content is returned — a bad template never breaks chat |
Configuration Options
Set these undersession: in your channel config.
| Option | Type | Default | Description |
|---|---|---|---|
timestamps | bool | False | When true, each inbound turn is prefixed with its arrival time. Off by default for prompt-cache stability |
timestamp_template | str | "[%a %Y-%m-%d %H:%M %Z] " | strftime template for the prefix. Must contain a YYYY-MM-DD HH:MM date-time — the replay de-dup regex anchors on it |
Common Patterns
Relative-time reminders — the model reads the prefix to resolve “in 2 hours” against a real clock:per_chat scope; the timestamp sits outermost so sender attribution stays intact:
[Fri 2026-07-09 10:15 UTC] [alice] when's the launch?
Minimal prefix — drop the weekday and timezone to save tokens:
Best Practices
Enable it only when you need a clock
Enable it only when you need a clock
Leave
timestamps off for bots that never reason about time. The prefix changes on every turn, so it disrupts prompt caching and adds tokens to each replayed message. Turn it on for scheduling, reminders, or gap-aware assistants.Keep the template short
Keep the template short
Every character in the prefix is billed on every replayed turn.
"[%Y-%m-%d %H:%M] " is enough for most agents; the default adds the weekday and timezone for readability.Keep the date-time in custom templates
Keep the date-time in custom templates
A custom
timestamp_template must render a YYYY-MM-DD HH:MM inside the bracket — the replay de-dup regex anchors on that date-time, not on the English weekday. Templates that omit %a (or run under non-English locales) stay safe.Let the session manager stamp turns
Let the session manager stamp turns
Don’t hand-format time prefixes in
instructions. The session manager strips and re-stamps each turn so replay de-dup works; a manual prefix bypasses that and accumulates on history replay.Related
Per-Chat Session Scope
Share one transcript across a group — the scope this feature stacks on top of
Session Compaction
How stamped turns survive history compaction
Bot Gateway
Top-level gateway config that owns the
session: blockChat
Chat-level docs where
received_at shows up
