Skip to main content

entry_to_message

Function entry_to_message 

Source
pub fn entry_to_message(entry: TranscriptEntry) -> Message
Expand description

Convert a persisted TranscriptEntry into a runtime Message.

Drops persistence-only fields (id, parent_id, timestamp, and — once g153 lands — audit). The result is what run_resumed expects as its seed argument and what provider adapters serialise onto the wire.

This is the isolation point between the persisted shape (TranscriptEntry) and the LLM wire shape (Message): provider adapters never see persistence-only fields. An unknown role string maps to Role::User defensively so a corrupted transcript can’t panic the resume handler — in practice this never fires because the writer only ever emits the four known roles.