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

Open
opened 2026-04-23 01:51:18 -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: 🔄 Open

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


📝 Commits (4)

  • 8c7f95d app/server: fix desktop app startup killing active ollama launch sessions
  • e899ea7 address comment
  • f0efe7d address comments
  • 0ae8af1 fix test

📊 Changes

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

View changed files

📝 app/server/server.go (+20 -0)
📝 app/server/server_test.go (+42 -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:** 🔄 Open **Base:** `main` ← **Head:** `hoyyeva/fix-launch-app-process-reap` --- ### 📝 Commits (4) - [`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 ### 📊 Changes **4 files changed** (+102 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app/server/server.go` (+20 -0) 📝 `app/server/server_test.go` (+42 -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-04-23 01:51:18 -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#41124