Skip to content

Commit cf805f7

Browse files
mcintyre94claude
andcommitted
Transition from .reconnecting to .streaming when data arrives
Previously processServiceStream only upgraded status from .connecting to .streaming, so a reconnect that was actively receiving data stayed stuck on .reconnecting the whole time. Extend the same transition to also fire from .reconnecting so the UI reflects that streaming is live. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 87a41c3 commit cf805f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Wisp/ViewModels/ChatViewModel.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ final class ChatViewModel {
933933
receivedData = true
934934
timeoutTask.cancel()
935935
if case .connecting = status { status = .streaming }
936+
else if case .reconnecting = status { status = .streaming }
936937

937938
// Two-level NDJSON: ServiceLogEvent.data contains Claude NDJSON.
938939
// The logs endpoint prefixes each line with a timestamp
@@ -961,6 +962,7 @@ final class ChatViewModel {
961962
receivedData = true
962963
timeoutTask.cancel()
963964
if case .connecting = status { status = .streaming }
965+
else if case .reconnecting = status { status = .streaming }
964966
if let text = event.data {
965967
logger.warning("Service stderr: \(text.prefix(500), privacy: .public)")
966968
}
@@ -994,6 +996,7 @@ final class ChatViewModel {
994996

995997
case .started:
996998
if case .connecting = status { status = .streaming }
999+
else if case .reconnecting = status { status = .streaming }
9971000

9981001
case .stopping, .stopped:
9991002
break

0 commit comments

Comments
 (0)