feat(chat,seahorse): persist and display model_name across history (#2897)

* feat(chat,seahorse): persist and display model_name across history

* test(seahorse): fix lint regressions in repair coverage

* fix(pico): preserve model_name in live updates

* fix(pico): preserve model_name through live stream wrappers
This commit is contained in:
LC
2026-05-20 13:42:21 +08:00
committed by GitHub
parent 548dc15acd
commit b7db059544
41 changed files with 1266 additions and 139 deletions
@@ -33,6 +33,7 @@ interface AssistantMessageProps {
content: string
attachments?: ChatAttachment[]
kind?: AssistantMessageKind
modelName?: string
toolCalls?: ChatToolCall[]
timestamp?: string | number
}
@@ -41,6 +42,7 @@ export function AssistantMessage({
content,
attachments = [],
kind = "normal",
modelName,
toolCalls = [],
timestamp = "",
}: AssistantMessageProps) {
@@ -66,13 +68,20 @@ export function AssistantMessage({
const copyMessageLabel = isCopied
? t("chat.copiedLabel")
: t("chat.copyMessage")
const trimmedModelName = modelName?.trim() ?? ""
return (
<div className="group flex w-full flex-col gap-1.5">
{!isCollapsedBlock && (
<div className="text-muted-foreground/60 flex items-center justify-between gap-2 px-1 text-xs opacity-70">
<div className="text-muted-foreground/60 flex items-center justify-between gap-2 px-1 text-xs opacity-70">
<div className="flex items-center gap-2">
<span>PicoClaw</span>
{trimmedModelName && (
<>
<span className="opacity-50"></span>
<span>{trimmedModelName}</span>
</>
)}
{formattedTimestamp && (
<>
<span className="opacity-50"></span>
@@ -104,6 +113,9 @@ export function AssistantMessage({
<IconTool className="size-3.5" />
)}
<span>{collapsedLabel}</span>
{trimmedModelName && (
<span className="text-muted-foreground/45">{trimmedModelName}</span>
)}
</div>
<IconChevronDown
className={cn(
@@ -376,6 +376,7 @@ export function ChatPage() {
content={msg.content}
attachments={msg.attachments}
kind={msg.kind}
modelName={msg.modelName}
toolCalls={msg.toolCalls}
timestamp={msg.timestamp}
/>