diff --git a/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz b/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz index 99577e2..ab7609d 100644 Binary files a/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz and b/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz differ diff --git a/public/app.js b/public/app.js index 55b7f1e..f02b849 100644 --- a/public/app.js +++ b/public/app.js @@ -7432,14 +7432,14 @@ stateEntries.forEach((entry, index) => { const tone = collabStateTone(entry.status); const displayTitle = pickCollabAgentTitle(entry, entry.id, index); - const fallbackDescription = `子代理任务:${displayTitle}`; - const descriptionText = summarizePrompt(entry.taskDescription) || fallbackDescription; - const descriptionTitle = cleanCollabAgentText(entry.taskDescription) || fallbackDescription; + const descriptionTitle = cleanCollabAgentText(entry.taskDescription); + const descriptionText = summarizePrompt(descriptionTitle); + const showDescription = !!descriptionText && descriptionText !== displayTitle; const item = document.createElement('div'); item.className = 'collab-agent-item'; item.title = [ displayTitle, - descriptionTitle, + showDescription ? descriptionTitle : '', entry.role ? `角色: ${entry.role}` : '', entry.agentPath ? `路径: ${entry.agentPath}` : '', entry.detail ? `结果: ${entry.detail}` : '', @@ -7492,11 +7492,13 @@ } item.appendChild(row); - const description = document.createElement('div'); - description.className = 'collab-agent-item-description'; - description.textContent = descriptionText; - description.title = descriptionTitle; - item.appendChild(description); + if (showDescription) { + const description = document.createElement('div'); + description.className = 'collab-agent-item-description'; + description.textContent = descriptionText; + description.title = descriptionTitle; + item.appendChild(description); + } const planProgress = normalizePlanProgress(entry.planProgress); if (planProgress) { diff --git a/scripts/regression.js b/scripts/regression.js index ca1908d..09231cd 100644 --- a/scripts/regression.js +++ b/scripts/regression.js @@ -1591,9 +1591,7 @@ function assertFrontendSubagentCardMetadataContract() { 'Prompt-derived automatic-looking titles should stay raw through collabAgentStateEntries and card rendering' ); const promptDerivedAutoNameDescriptions = findNodesByClass(promptDerivedAutoNameElement, 'collab-agent-item-description'); - assert(promptDerivedAutoNameDescriptions.length === 1, 'Prompt-derived automatic-looking titles should still render a real task description'); - assert(promptDerivedAutoNameDescriptions[0].textContent === 'frontend_state_review', 'Prompt-derived real task descriptions should stay raw in the card'); - assert(promptDerivedAutoNameDescriptions[0].title === 'frontend_state_review', 'Prompt-derived real task descriptions should stay raw in the DOM title'); + assert(promptDerivedAutoNameDescriptions.length === 0, 'Task descriptions identical to the resolved card title should not render twice'); const firstSpawn = metadataApi.mergeCollabAgentTaskState( {}, @@ -1956,14 +1954,12 @@ function assertFrontendSubagentCardMetadataContract() { assert(!noPromptActivityMerge.input.agentsStates[noPromptThreadId].taskDescription, 'Raw subAgentActivity without prompt should not fabricate taskDescription'); const noPromptElement = collabApi.renderCollabAgentToolElement(noPromptActivityMerge); const noPromptDescriptions = findNodesByClass(noPromptElement, 'collab-agent-item-description'); - assert(noPromptDescriptions.length === 1, 'Raw subAgentActivity without prompt should still render one visible fallback description'); - assert(noPromptDescriptions[0].textContent === '子代理任务:计划审查', 'Missing child-agent prompts should render an explicit fallback task description'); - assert(noPromptDescriptions[0].title === '子代理任务:计划审查', 'Missing child-agent prompts should use the fallback task description as the DOM title'); + assert(noPromptDescriptions.length === 0, 'Raw subAgentActivity without prompt should not repeat the card title as a fallback description'); const noPromptItems = findNodesByClass(noPromptElement, 'collab-agent-item'); assert(noPromptItems.length === 1, 'Raw subAgentActivity without prompt should still render one rich child-agent card'); assert( - String(noPromptItems[0].title || '').includes('子代理任务:计划审查'), - 'Missing child-agent prompts should include the fallback description in the card DOM title' + !String(noPromptItems[0].title || '').includes('子代理任务:'), + 'Missing child-agent prompts should not add a duplicate fallback description to the card tooltip' ); const renderCandidates = collabApi.renderToolCallsForMessage([