diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte
index e826f1c68f..853bd9824f 100644
--- a/src/lib/components/chat/MessageInput.svelte
+++ b/src/lib/components/chat/MessageInput.svelte
@@ -1242,7 +1242,7 @@
{#if chatTasks.length > 0}
-
+
{/if}
diff --git a/src/lib/components/chat/Messages/ResponseMessage/TaskList.svelte b/src/lib/components/chat/Messages/ResponseMessage/TaskList.svelte
index 79a9f42d5d..a295380eb3 100644
--- a/src/lib/components/chat/Messages/ResponseMessage/TaskList.svelte
+++ b/src/lib/components/chat/Messages/ResponseMessage/TaskList.svelte
@@ -8,12 +8,21 @@
const i18n = getContext('i18n');
export let tasks: Array<{ id: string; content: string; status: string }> = [];
+ export let done = false;
let collapsed = false;
$: completedCount = tasks.filter((t) => t.status === 'completed').length;
$: totalCount = tasks.length;
- $: hasActive = tasks.some((t) => t.status === 'pending' || t.status === 'in_progress');
+ $: inProgressCount = tasks.filter((t) => t.status === 'in_progress').length;
+ $: pendingCount = tasks.filter((t) => t.status === 'pending').length;
+
+ // Hide once all work is effectively done:
+ // - no active tasks at all, OR
+ // - message is done and the only remaining active tasks are in_progress (no pending)
+ $: hasActive =
+ tasks.some((t) => t.status === 'pending' || t.status === 'in_progress') &&
+ !(done && pendingCount === 0 && inProgressCount > 0);
{#if tasks.length > 0 && hasActive}