Skip to content

Commit d6b0baf

Browse files
kody-wclaude
andcommitted
fix(macos): clear chatState on auto-reauth so input banner stays hidden
The previous fix routed the chat-bubble path to the reauth trigger but still set chatState = .error, which ChatInputView renders as a separate red ErrorBanner above the composer. On the auth path we now set chatState = .idle so neither the bubble nor the banner shows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7ae30a5 commit d6b0baf

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

macos/Sources/OpenRappterBar/ViewModels/ChatViewModel.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,13 @@ public final class ChatViewModel {
139139

140140
case .error:
141141
let errorMsg = payload.errorMessage ?? "Unknown error"
142-
chatState = .error(errorMsg)
143142
streamingText = ""
144143

145144
if isCopilotAuthError(errorMsg), let trigger = onAuthRequired {
146-
// Inline auth flow: skip the raw error bubble, show a friendly
147-
// status line, and kick off the device-code flow ourselves.
145+
// Inline auth flow: skip the raw error bubble *and* the input
146+
// banner, show a friendly status line, and kick off the
147+
// device-code flow ourselves.
148+
chatState = .idle
148149
if !isAutoReauthing {
149150
isAutoReauthing = true
150151
addSystemMessage("🔑 GitHub Copilot needs re-authentication — starting sign-in…")
@@ -153,6 +154,7 @@ public final class ChatViewModel {
153154
return
154155
}
155156

157+
chatState = .error(errorMsg)
156158
let msg = ChatMessage(
157159
role: .error,
158160
content: "Agent error: \(errorMsg)",

0 commit comments

Comments
 (0)