Skip to content

Commit d9b10fb

Browse files
zmanianclaude
andcommitted
Make question tool install non-blocking for chat
If the question tool fails to install (e.g. sprite still waking), proceed with chat without the WispAsk MCP tool instead of showing a fatal error that blocks all messages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8c6f467 commit d9b10fb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Wisp/ViewModels/ChatViewModel.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,12 @@ final class ChatViewModel {
574574
) async {
575575
status = .connecting
576576

577-
// Wait for MCP setup to finish (no-op if setup task not running or already done)
577+
// Wait for MCP setup to finish (best-effort — don't block chat if it fails)
578+
var questionToolInstalled = false
578579
if UserDefaults.standard.bool(forKey: "claudeQuestionTool") {
579-
let toolReady = await mcpSetupTask?.value ?? false
580-
if !toolReady {
581-
status = .error("Claude question tool failed to install — disable it in Settings or try again")
582-
return
580+
questionToolInstalled = await mcpSetupTask?.value ?? false
581+
if !questionToolInstalled {
582+
logger.warning("Question tool install failed — proceeding without it")
583583
}
584584
}
585585

@@ -628,7 +628,7 @@ final class ChatViewModel {
628628
}
629629

630630
var claudeCmd = "claude -p --verbose --output-format stream-json --dangerously-skip-permissions"
631-
if UserDefaults.standard.bool(forKey: "claudeQuestionTool") {
631+
if questionToolInstalled {
632632
let sessionId = chatId.uuidString.lowercased()
633633
let configPath = ClaudeQuestionTool.mcpConfigFilePath(for: sessionId)
634634
// Write per-session MCP config (inlined in the command chain so no extra round-trip)

0 commit comments

Comments
 (0)