Skip to content

Commit cc7bab0

Browse files
hannesrudolphclaude
andcommitted
fix: prevent prompt history fallback to task list during active conversation
When an active task has only an initial prompt with no follow-up user messages, the prompt history should return empty instead of falling back to task history. This fixes the "Starting Fresh" behavior appearing inappropriately. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9f98239 commit cc7bab0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

webview-ui/src/components/chat/hooks/usePromptHistory.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ export const usePromptHistory = ({
6767
return conversationPrompts.slice(-MAX_PROMPT_HISTORY_SIZE).reverse() // newest first for conversation messages
6868
}
6969

70-
// Fall back to task history if no conversation messages
70+
// If we have clineMessages array (meaning we're in an active task), don't fall back to task history
71+
// Only use task history when starting fresh (no active conversation)
72+
if (clineMessages && clineMessages.length > 0) {
73+
return []
74+
}
75+
76+
// Fall back to task history only when starting fresh (no active conversation)
7177
if (!taskHistory || taskHistory.length === 0 || !cwd) {
7278
return []
7379
}

0 commit comments

Comments
 (0)