From 9b75afe9f19d243905f8833ed17604241baf8123 Mon Sep 17 00:00:00 2001
From: Autumn-27 <53844290+Autumn-27@users.noreply.github.com>
Date: Sat, 22 Aug 2026 06:18:07 -0400
Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E4=BC=9A=E8=AF=9D=E5=BE=BD?=
=?UTF-8?q?=E6=A0=87=E6=94=B9=E6=98=BE=E7=A4=BA=20LLM=20=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
会话标题右侧的徽标原本显示模型 ID,改为显示配置名称;模型 ID 移到 hover
的 tooltip 里,并去掉其中的协议名(openai/anthropic 等)。
- 抽出 resolutionLabel(),徽标、aria-label、tooltip 共用一处取名逻辑;
environment 来源的配置可能没有 name,按 name → model → 未命名配置 降级,
避免渲染出空徽标
- 去掉 font-mono:等宽字体是为模型 ID 准备的,配置名多为中文
- tooltip 用 filter(Boolean).join(" / ") 拼接,模型名缺失时不留孤立斜杠
Claude-Session: https://claude.ai/code/session_01Q8nhYZfS4H8fsSCBJXxbSy
---
.../tasks/detail/_tabs/sessions-tab.tsx | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx b/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx
index 3368364..0346d98 100644
--- a/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx
+++ b/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx
@@ -59,6 +59,13 @@ import type {
} from "@/lib/types";
import { cn } from "@/lib/utils";
+// resolutionLabel names the LLM a session runs on. The badge shows this alone and
+// keeps the model id in its tooltip. Env-backed configs can arrive without a name,
+// so fall back to the model id rather than rendering an empty badge.
+function resolutionLabel(r: TaskLLMResolution): string {
+ return r.name || r.model || "未命名配置";
+}
+
// fmtBytes renders a human file size for attachment chips (mirrors transcript.tsx).
function fmtBytes(n: number): string {
if (n >= 1 << 20) return `${(n / (1 << 20)).toFixed(1)} MB`;
@@ -1376,17 +1383,19 @@ export function SessionsTab({ taskId }: { taskId: string }) {
- {activeResolution.available ? activeResolution.model : "模型不可用"}
+ {activeResolution.available ? resolutionLabel(activeResolution) : "模型不可用"}
{activeResolution.available
- ? `${activeResolution.name} / ${activeResolution.format} / ${activeResolution.model}`
+ ? [resolutionLabel(activeResolution), activeResolution.model].filter(Boolean).join(" / ")
: activeResolution.reason || "没有可用的 LLM 配置"}