[PR #15657] [MERGED] app/server: fix desktop app startup killing active ollama launch sessions #77545

Closed
opened 2026-05-05 10:13:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15657
Author: @hoyyeva
Created: 4/17/2026
Status: Merged
Merged: 4/28/2026
Merged by: @hoyyeva

Base: mainHead: hoyyeva/fix-launch-app-process-reap


📝 Commits (5)

📊 Changes

4 files changed (+120 additions, -2 deletions)

View changed files

📝 app/server/server.go (+23 -0)
📝 app/server/server_test.go (+57 -0)
📝 app/server/server_unix.go (+14 -1)
📝 app/server/server_windows.go (+26 -1)

📄 Description

Fix desktop app startup terminating active ollama launch workflows.

When the desktop app starts, it launches its own managed ollama serve. If another Ollama server is already running, the managed server can exit on startup due to a port conflict. Previously, the app fallback cleanup path reaped all ollama processes, which could kill foreground CLI workflows like ollama launch opencode.

This change narrows the cleanup logic on macOS and Windows so that it only targets ollama serve processes. That allows the app to replace the conflicting server process without terminating the launcher process.

What changed
macOS: reapServers() now inspects process arguments and only stops processes that look like ollama serve
Windows: reapServers() now does the same via process command line inspection
foreground CLI commands like ollama launch, ollama run & ollama pull are no longer matched by the fallback reaper


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15657 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@hoyyeva](https://github.com/hoyyeva) **Base:** `main` ← **Head:** `hoyyeva/fix-launch-app-process-reap` --- ### 📝 Commits (5) - [`8c7f95d`](https://github.com/ollama/ollama/commit/8c7f95d82f7a1882f1922f9442c19b2242f38dd8) app/server: fix desktop app startup killing active ollama launch sessions - [`e899ea7`](https://github.com/ollama/ollama/commit/e899ea7ccf1fb04ca95fbab72401fe074025c511) address comment - [`f0efe7d`](https://github.com/ollama/ollama/commit/f0efe7d9071e78b3a8dae7185d2ea2fa20375fad) address comments - [`0ae8af1`](https://github.com/ollama/ollama/commit/0ae8af129a3d3dd1280fd048a5b3c59807c02996) fix test - [`3c7d165`](https://github.com/ollama/ollama/commit/3c7d1653f9c08e02a44766f40a2f927dcd88735a) address comments ### 📊 Changes **4 files changed** (+120 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app/server/server.go` (+23 -0) 📝 `app/server/server_test.go` (+57 -0) 📝 `app/server/server_unix.go` (+14 -1) 📝 `app/server/server_windows.go` (+26 -1) </details> ### 📄 Description Fix desktop app startup terminating active ollama launch workflows. When the desktop app starts, it launches its own managed ollama serve. If another Ollama server is already running, the managed server can exit on startup due to a port conflict. Previously, the app fallback cleanup path reaped all ollama processes, which could kill foreground CLI workflows like ollama launch opencode. This change narrows the cleanup logic on macOS and Windows so that it only targets ollama serve processes. That allows the app to replace the conflicting server process without terminating the launcher process. **What changed** macOS: reapServers() now inspects process arguments and only stops processes that look like ollama serve Windows: reapServers() now does the same via process command line inspection foreground CLI commands like `ollama launch, ollama run & ollama pull` are no longer matched by the fallback reaper --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 10:13:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#77545