diff --git a/src/ClaudeDo.Ui/Helpers/StreamLineFormatter.cs b/src/ClaudeDo.Ui/Helpers/StreamLineFormatter.cs index 3c2fdb6..aec50f7 100644 --- a/src/ClaudeDo.Ui/Helpers/StreamLineFormatter.cs +++ b/src/ClaudeDo.Ui/Helpers/StreamLineFormatter.cs @@ -43,11 +43,30 @@ public class StreamLineFormatter { if (!root.TryGetProperty("subtype", out var subtypeProp)) return null; - return subtypeProp.GetString() switch + + var subtype = subtypeProp.GetString(); + switch (subtype) { - "api_retry" => "[Retrying API call...]\n", - _ => null, - }; + case "api_retry": + return "[Retrying API call...]\n"; + + case "init": + { + var sessionId = root.TryGetProperty("session_id", out var sid) + ? sid.GetString() : null; + var model = root.TryGetProperty("model", out var m) + ? m.GetString() : null; + + var shortId = sessionId is { Length: >= 8 } + ? sessionId[..8] + : sessionId ?? "?"; + var modelPart = string.IsNullOrEmpty(model) ? "" : $" ยท {model}"; + return $"[session {shortId}{modelPart}]\n"; + } + + default: + return null; + } } private static string? FormatAssistant(JsonElement root) => null;