diff --git a/android/core/data/src/main/java/io/picoclaw/android/core/data/repository/ChatRepositoryImpl.kt b/android/core/data/src/main/java/io/picoclaw/android/core/data/repository/ChatRepositoryImpl.kt index 4b9355a4a..f96de6c6a 100644 --- a/android/core/data/src/main/java/io/picoclaw/android/core/data/repository/ChatRepositoryImpl.kt +++ b/android/core/data/src/main/java/io/picoclaw/android/core/data/repository/ChatRepositoryImpl.kt @@ -47,6 +47,7 @@ class ChatRepositoryImpl( webSocketClient.incomingMessages.collect { dto -> when (dto.type) { "status" -> _statusLabel.value = dto.content + "status_end" -> _statusLabel.value = null else -> { _statusLabel.value = null val entity = MessageMapper.toEntity(dto) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 54bc47d8f..fbc4713d6 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -233,6 +233,13 @@ func (al *AgentLoop) Run(ctx context.Context) error { go func(m bus.InboundMessage, sk string) { defer func() { + // Clear status indicator on completion (normal, error, or cancel) + if !constants.IsInternalChannel(m.Channel) { + al.bus.PublishOutbound(bus.OutboundMessage{ + Channel: m.Channel, ChatID: m.ChatID, + Type: "status_end", + }) + } close(done) al.procsMu.Lock() if cur, ok := al.activeProcs[sk]; ok && cur.done == done {