NormalizeForSession returns a provider-safe message for chatwitheino's JSONL session store. Agentic model implementations attach Responses API item IDs to content blocks, and those IDs are required when replaying provider-native output items such as assistant messages, reasoning blocks, and tool cal
(msg M)
| 35 | // output items such as assistant messages, reasoning blocks, and tool calls. |
| 36 | // The examples persist those IDs while dropping streaming-only metadata. |
| 37 | func NormalizeForSession[M adk.MessageType](msg M) M { |
| 38 | if KindOf[M]() != KindAgentic { |
| 39 | return msg |
| 40 | } |
| 41 | agenticMsg, ok := any(msg).(*schema.AgenticMessage) |
| 42 | if !ok || agenticMsg == nil { |
| 43 | return msg |
| 44 | } |
| 45 | return any(normalizeAgenticMessage(agenticMsg)).(M) |
| 46 | } |
| 47 | |
| 48 | // NormalizeMessagesForModelInput prepares stored messages before passing them |
| 49 | // back to Runner/ChatModel. Today this matches NormalizeForSession; keeping the |
no test coverage detected