fix: show activity indicator on TaskStarted event, not just TaskActive

The activity indicator was only showing when transitioning from an idle
state back to active (TaskActive event), but TaskActive was not emitted
when a task first started - it was only emitted after the user responded
to an ask after the task went idle.

This fix shows the activity indicator when TaskStarted fires, which
happens when the task loop begins. This ensures the indicator shows
immediately when the user starts a task or the agent begins processing.
This commit is contained in:
Roo Code 2026-01-12 03:24:59 +00:00
parent 21b64779e5
commit 55d8cd30e7

View file

@ -220,7 +220,10 @@ export class ClineProvider
this.emit(RooCodeEventName.TaskCreated, instance)
// Create named listener functions so we can remove them later.
const onTaskStarted = () => this.emit(RooCodeEventName.TaskStarted, instance.taskId)
const onTaskStarted = () => {
this.activityIndicator.show()
this.emit(RooCodeEventName.TaskStarted, instance.taskId)
}
const onTaskCompleted = (taskId: string, tokenUsage: TokenUsage, toolUsage: ToolUsage) => {
this.activityIndicator.hide()
this.emit(RooCodeEventName.TaskCompleted, taskId, tokenUsage, toolUsage)