Optional timestamps on messages, so replayed history keeps its time #2364
fzred
started this conversation in
Protocol Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
When a client restores a session with history replay (
session/loadin v1,session/resumewithreplayFromin the v2 draft), every message comes back without any notion of when it happened. A client can stamp live updates with its own clock, but once the session is reloaded (after a restart, or when opening an older conversation) that information is gone, and nothing in the protocol lets the agent hand it back.The agents usually have it:
timestampon every entry.startedAt/completedAt/durationMsper turn (thread/turns/list) andstartedAtMs/completedAtMsper item (thread/items/list).Concrete use case: our client shows "Completed · 4m 56s · Oct 11, 14:31" under each turn. That works for turns that ran while the client was connected, and disappears for every replayed turn, which is exactly when users ask "when did I do this?". Grouping a long conversation by day, or showing how old a resumed session's last answer is, runs into the same gap.
Proposal
Let the agent attach an optional creation time to messages:
createdAt(RFC 3339, likeSessionInfo.updatedAt) onuser_message,agent_messageandagent_thought. This fits the patch semantics of the Message Updates RFD, which already leaves room for future message-level fields: replay sends it with the content, a live agent sends it on the first update for amessageId.user_message_chunk/agent_message_chunk/agent_thought_chunk(meaningful on the first chunk of amessageId), or a documented_metakey if a v1 schema change is not wanted.Agents that don't know the time omit it, and clients fall back to what they do today.
Open questions
Related adapter issues
All reactions