diff options
| author | adamdotdevin <[email protected]> | 2025-08-11 09:38:52 -0500 |
|---|---|---|
| committer | adamdotdevin <[email protected]> | 2025-08-11 09:38:52 -0500 |
| commit | e8d144d2a21f884483eb47713dd52a83df7c859e (patch) | |
| tree | 030e261101dccc451476756905361e305d5b99e8 | |
| parent | a760e8364ff70e0fdefcbd2ff17077a5b9b2a5ea (diff) | |
| download | opencode-e8d144d2a21f884483eb47713dd52a83df7c859e.tar.gz opencode-e8d144d2a21f884483eb47713dd52a83df7c859e.zip | |
fix: reformat assistant message footer
| -rw-r--r-- | packages/tui/internal/components/chat/message.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go index ee3535ad8..b5579883f 100644 --- a/packages/tui/internal/components/chat/message.go +++ b/packages/tui/internal/components/chat/message.go @@ -225,6 +225,9 @@ func renderText( bg = t.BackgroundPanel() } ts = time.UnixMilli(int64(casted.Time.Created)) + if casted.Time.Completed > 0 { + ts = time.UnixMilli(int64(casted.Time.Completed)) + } content = util.ToMarkdown(text, width, bg) if isThinking { content = styles.NewStyle().Background(bg).Foreground(t.TextMuted()).Render("Thinking") + "\n\n" + content @@ -333,7 +336,7 @@ func renderText( timestamp = timestamp[12:] } - // Check if this is an assistant message with mode (agent) information + // Check if this is an assistant message with agent information var modelAndAgentSuffix string if assistantMsg, ok := message.(opencode.AssistantMessage); ok && assistantMsg.Mode != "" { // Find the agent index by name to get the correct color @@ -349,17 +352,15 @@ func renderText( agentColor := util.GetAgentColor(agentIndex) // Style the agent name with the same color as status bar - agentName := strings.Title(assistantMsg.Mode) - styledAgentName := styles.NewStyle().Foreground(agentColor).Bold(true).Render(agentName) - modelAndAgentSuffix = fmt.Sprintf(" | %s | %s", assistantMsg.ModelID, styledAgentName) + agentName := cases.Title(language.Und).String(assistantMsg.Mode) + styledAgentName := styles.NewStyle().Foreground(agentColor).Render(agentName) + modelAndAgentSuffix = fmt.Sprintf("%s %s", styledAgentName, assistantMsg.ModelID) } var info string if modelAndAgentSuffix != "" { - // For assistant messages: "timestamp | modelID | agentName" - info = fmt.Sprintf("%s%s", timestamp, modelAndAgentSuffix) + info = fmt.Sprintf("%s (%s)", modelAndAgentSuffix, timestamp) } else { - // For user messages: "author (timestamp)" info = fmt.Sprintf("%s (%s)", author, timestamp) } info = styles.NewStyle().Foreground(t.TextMuted()).Render(info) |
