chore: rebuild release package

This commit is contained in:
shiyue
2026-07-24 18:21:16 +08:00
parent 4ab02ae33b
commit 85f2f2d420
3 changed files with 15 additions and 17 deletions

View File

@@ -7432,14 +7432,14 @@
stateEntries.forEach((entry, index) => { stateEntries.forEach((entry, index) => {
const tone = collabStateTone(entry.status); const tone = collabStateTone(entry.status);
const displayTitle = pickCollabAgentTitle(entry, entry.id, index); const displayTitle = pickCollabAgentTitle(entry, entry.id, index);
const fallbackDescription = `子代理任务:${displayTitle}`; const descriptionTitle = cleanCollabAgentText(entry.taskDescription);
const descriptionText = summarizePrompt(entry.taskDescription) || fallbackDescription; const descriptionText = summarizePrompt(descriptionTitle);
const descriptionTitle = cleanCollabAgentText(entry.taskDescription) || fallbackDescription; const showDescription = !!descriptionText && descriptionText !== displayTitle;
const item = document.createElement('div'); const item = document.createElement('div');
item.className = 'collab-agent-item'; item.className = 'collab-agent-item';
item.title = [ item.title = [
displayTitle, displayTitle,
descriptionTitle, showDescription ? descriptionTitle : '',
entry.role ? `角色: ${entry.role}` : '', entry.role ? `角色: ${entry.role}` : '',
entry.agentPath ? `路径: ${entry.agentPath}` : '', entry.agentPath ? `路径: ${entry.agentPath}` : '',
entry.detail ? `结果: ${entry.detail}` : '', entry.detail ? `结果: ${entry.detail}` : '',
@@ -7492,11 +7492,13 @@
} }
item.appendChild(row); item.appendChild(row);
const description = document.createElement('div'); if (showDescription) {
description.className = 'collab-agent-item-description'; const description = document.createElement('div');
description.textContent = descriptionText; description.className = 'collab-agent-item-description';
description.title = descriptionTitle; description.textContent = descriptionText;
item.appendChild(description); description.title = descriptionTitle;
item.appendChild(description);
}
const planProgress = normalizePlanProgress(entry.planProgress); const planProgress = normalizePlanProgress(entry.planProgress);
if (planProgress) { if (planProgress) {

View File

@@ -1591,9 +1591,7 @@ function assertFrontendSubagentCardMetadataContract() {
'Prompt-derived automatic-looking titles should stay raw through collabAgentStateEntries and card rendering' 'Prompt-derived automatic-looking titles should stay raw through collabAgentStateEntries and card rendering'
); );
const promptDerivedAutoNameDescriptions = findNodesByClass(promptDerivedAutoNameElement, 'collab-agent-item-description'); 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.length === 0, 'Task descriptions identical to the resolved card title should not render twice');
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');
const firstSpawn = metadataApi.mergeCollabAgentTaskState( const firstSpawn = metadataApi.mergeCollabAgentTaskState(
{}, {},
@@ -1956,14 +1954,12 @@ function assertFrontendSubagentCardMetadataContract() {
assert(!noPromptActivityMerge.input.agentsStates[noPromptThreadId].taskDescription, 'Raw subAgentActivity without prompt should not fabricate taskDescription'); assert(!noPromptActivityMerge.input.agentsStates[noPromptThreadId].taskDescription, 'Raw subAgentActivity without prompt should not fabricate taskDescription');
const noPromptElement = collabApi.renderCollabAgentToolElement(noPromptActivityMerge); const noPromptElement = collabApi.renderCollabAgentToolElement(noPromptActivityMerge);
const noPromptDescriptions = findNodesByClass(noPromptElement, 'collab-agent-item-description'); 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.length === 0, 'Raw subAgentActivity without prompt should not repeat the card title as a 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');
const noPromptItems = findNodesByClass(noPromptElement, 'collab-agent-item'); const noPromptItems = findNodesByClass(noPromptElement, 'collab-agent-item');
assert(noPromptItems.length === 1, 'Raw subAgentActivity without prompt should still render one rich child-agent card'); assert(noPromptItems.length === 1, 'Raw subAgentActivity without prompt should still render one rich child-agent card');
assert( assert(
String(noPromptItems[0].title || '').includes('子代理任务:计划审查'), !String(noPromptItems[0].title || '').includes('子代理任务:'),
'Missing child-agent prompts should include the fallback description in the card DOM title' 'Missing child-agent prompts should not add a duplicate fallback description to the card tooltip'
); );
const renderCandidates = collabApi.renderToolCallsForMessage([ const renderCandidates = collabApi.renderToolCallsForMessage([