fix: Ollama click handler and stream completion

- Fixed sidebar Ollama Cloud section to always open modal on click
- Improved stream handling with proper buffer flush on end
- Added 120s timeout for Ollama requests
- Added better logging for debugging
- Fixed activeRequest cleanup on errors
This commit is contained in:
Gemini AI
2025-12-20 13:29:30 +04:00
Unverified
parent 94ae6fa8c5
commit 20aef0fd89
2 changed files with 40 additions and 13 deletions

View File

@@ -740,16 +740,9 @@ export const Sidebar = () => {
<div
className={`flex items-center gap-2 text-xs cursor-pointer transition-colors p-2 hover:bg-white/5 rounded-lg mx-2 group ${state.chatSettings.ollamaEnabled ? '' : 'opacity-60'
}`}
onClick={async () => {
// Check Ollama status and open settings if not configured
const electron = (window as any).electron;
if (electron?.ollama) {
const status = await electron.ollama.getKeyStatus();
if (!status.hasKey) {
// Open AI Settings modal - dispatch a custom event
window.dispatchEvent(new CustomEvent('open-ai-settings'));
}
}
onClick={() => {
// Always open AI Settings modal when clicked
window.dispatchEvent(new CustomEvent('open-ai-settings'));
}}
title={state.chatSettings.ollamaEnabled ? "Ollama Cloud connected" : "Click to configure Ollama Cloud"}
>