Skip to content

Commit 033eccc

Browse files
authored
🤖 feat: Hide completed TODOs while streaming (#469)
## Problem When agents are actively working and updating their TODO list, completed items clutter the display and make it harder to see what's currently being worked on. ## Solution Only show completed TODOs in the pinned TODO list when the chat is **not** streaming: - **While streaming:** Hide completed todos, only show pending/in_progress - **After streaming:** Show all todos including completed for context ## Implementation Modified `PinnedTodoList` component to: 1. Check `canInterrupt` from workspace state (indicates active streaming) 2. Filter out `completed` todos when streaming 3. Pass filtered list to `TodoList` component ## Benefits - **Cleaner UI during active work** - Focus on what's happening now - **Context when idle** - See full history of what was accomplished - **No data loss** - Completed todos still exist, just hidden temporarily --- _Generated with `cmux`_
1 parent 54d8b9d commit 033eccc

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

src/components/PinnedTodoList.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ export const PinnedTodoList: React.FC<PinnedTodoListProps> = ({ workspaceId }) =
2727
() => workspaceStore.getWorkspaceState(workspaceId).todos
2828
);
2929

30-
if (todos.length === 0) {
30+
// Get streaming state
31+
const canInterrupt = useSyncExternalStore(
32+
(callback) => workspaceStore.subscribeKey(workspaceId, callback),
33+
() => workspaceStore.getWorkspaceState(workspaceId).canInterrupt
34+
);
35+
36+
// When idle (not streaming), only show completed todos for clean summary
37+
// When streaming, show all todos so user can see active work
38+
const displayTodos = canInterrupt ? todos : todos.filter((todo) => todo.status === "completed");
39+
40+
if (displayTodos.length === 0) {
3141
return null;
3242
}
3343

@@ -47,7 +57,7 @@ export const PinnedTodoList: React.FC<PinnedTodoListProps> = ({ workspaceId }) =
4757
</span>
4858
TODO{expanded ? ":" : ""}
4959
</div>
50-
{expanded && <TodoList todos={todos} />}
60+
{expanded && <TodoList todos={displayTodos} />}
5161
</div>
5262
);
5363
};

src/utils/tools/toolDefinitions.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,17 @@ export const TOOL_DEFINITIONS = {
183183
},
184184
status_set: {
185185
description:
186-
"Set a status indicator to show what the agent is currently doing. " +
187-
"The emoji appears left of the streaming indicator, and the message shows on hover. " +
188-
"The status is set IMMEDIATELY when this tool is called, even before other tool calls complete. " +
189-
"IMPORTANT: Always set a status at the start of each response and update it as your work progresses. " +
190-
"The status is cleared when a new user message comes in, so you must set it again for each response. " +
191-
"Use this to communicate ongoing activities and set a final status before completing that reflects the outcome.",
186+
"Set a status indicator to show what Assistant is currently doing. The status is set IMMEDIATELY \n" +
187+
"when this tool is called, even before other tool calls complete.\n" +
188+
"\n" +
189+
"WHEN TO SET STATUS:\n" +
190+
"- Set status when beginning concrete work (file edits, running tests, executing commands)\n" +
191+
"- Update status as work progresses through distinct phases\n" +
192+
"- Set a final status before completing that reflects the outcome\n" +
193+
"- DO NOT set status during initial exploration, file reading, or planning phases\n" +
194+
"\n" +
195+
"The status is cleared when a new user message comes in. Validate your approach is feasible \n" +
196+
"before setting status - failed tool calls after setting status indicate premature commitment.",
192197
schema: z
193198
.object({
194199
emoji: z.string().describe("A single emoji character representing the current activity"),

0 commit comments

Comments
 (0)