From 5b3771012af70dd097c896aeb062c80f40d2b238 Mon Sep 17 00:00:00 2001 From: mysoul12138 <839465496@qq.com> Date: Fri, 29 May 2026 16:01:18 +0800 Subject: [PATCH] Fix tool card duplication: skip detail when snippet equals preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When tc.snippet === tc.preview (common for no-progress tools where both are set to the same result_snippet), the detail block would show identical content as the header. Skip the detail block in this case. This also handles the reload-path where derived entries get snippet populated but no preview, so displaySnippet falls back to the snippet content for the header — same deduplication applies. Co-Authored-By: Claude Opus 4.7 --- static/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/ui.js b/static/ui.js index 2afe41ab..25bf4a36 100644 --- a/static/ui.js +++ b/static/ui.js @@ -6954,7 +6954,7 @@ function buildToolCard(tc){ const row=document.createElement('div'); row.className='tool-card-row'; const icon=toolIcon(tc.name); - const hasDetail=tc.snippet||(tc.args&&Object.keys(tc.args).length>0); + const hasDetail=(tc.snippet&&tc.snippet!==tc.preview)||(tc.args&&Object.keys(tc.args).length>0); let displaySnippet=''; if(tc.snippet){ const s=tc.snippet;