Problem
When the configured provider (e.g., llamacpp) is unreachable, the extension hangs during loadProvider() initialization, leaving the webview showing "loading..." forever with no error feedback.
Users see an infinite loading bar with no way to know:
- Which provider failed
- Why it failed (network timeout, connection refused, etc.)
- How to fix it
Root Cause
- Provider initialization is synchronous and blocking
- No timeout on provider connection attempts
- Webview doesn't render until provider is ready
- No error messaging path to webview
Solution
-
Async, non-blocking initialization
- Render webview immediately with "provider initializing..." state
- Spawn provider connection in background with 5-second timeout
-
Clear error messaging
- Capture specific error (timeout, connection refused, auth failed, etc.)
- Send detailed error to webview: "Provider llamacpp at http://192.168.1.24:21434 timed out after 5s"
-
Recovery UI in webview
- Show error with provider name and URL
- Add "Retry", "Configure Provider", "Test Connection" buttons
- Link to settings panel to change provider
-
Graceful fallback
- Try fallback providers if primary fails
- Suggest using local ollama if available
Acceptance Criteria
Tests Required
Problem
When the configured provider (e.g., llamacpp) is unreachable, the extension hangs during
loadProvider()initialization, leaving the webview showing "loading..." forever with no error feedback.Users see an infinite loading bar with no way to know:
Root Cause
Solution
Async, non-blocking initialization
Clear error messaging
Recovery UI in webview
Graceful fallback
Acceptance Criteria
Tests Required