[PR #13159] [MERGED] app/ui: handle unspecified bind addresses and wait for server in ollama proxy #19371

Closed
opened 2026-04-16 07:05:20 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13159
Author: @hoyyeva
Created: 11/19/2025
Status: Merged
Merged: 12/15/2025
Merged by: @hoyyeva

Base: mainHead: hoyyeva/proxy-ollama-serve


📝 Commits (4)

📊 Changes

1 file changed (+54 additions, -28 deletions)

View changed files

📝 app/ui/ui.go (+54 -28)

📄 Description

This PR fixes

Issue 1: Unspecified bind addresses (#13105)
When users set OLLAMA_HOST=0.0.0.0 to bind the Ollama server on all interfaces, the UI proxy was trying to connect to 0.0.0.0, which is not a valid connection target. While 0.0.0.0 is valid for server binding, client connections must use a specific address like 127.0.0.1.
Issue 2: Race condition on startup (#12851)
The proxy was initialized immediately without waiting for the Ollama server to be ready, causing "connection refused" errors when the UI made requests before the server finished starting.

This PR

  1. Use envconfig.Host() for host resolution
    Replace manual environment variable handling with envconfig.Host()
  2. Wait for server on first request
    Use sync.Once pattern to:
  • Wait for Ollama server to be ready on first proxy request only
  • Allow webview to open immediately (no blocking at startup)

🔄 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/13159 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 12/15/2025 **Merged by:** [@hoyyeva](https://github.com/hoyyeva) **Base:** `main` ← **Head:** `hoyyeva/proxy-ollama-serve` --- ### 📝 Commits (4) - [`a0962ac`](https://github.com/ollama/ollama/commit/a0962ac79b5b5485d716024212b93c0220c2218c) app/ui: use envconfig.Host() and wait for server in proxy - [`89ce824`](https://github.com/ollama/ollama/commit/89ce824c6336ba954a82d03c6576876dbc78f0ec) address comment - [`e5fa5d2`](https://github.com/ollama/ollama/commit/e5fa5d2c0f7af02b3497293c3695288f88954f38) fix test - [`f345619`](https://github.com/ollama/ollama/commit/f3456192f52cf9f896be6d0bb5b92356a6c933b3) address comment ### 📊 Changes **1 file changed** (+54 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/ui.go` (+54 -28) </details> ### 📄 Description This PR fixes - #13105 - #12851 **Issue 1: Unspecified bind addresses (#13105)** When users set OLLAMA_HOST=0.0.0.0 to bind the Ollama server on all interfaces, the UI proxy was trying to connect to 0.0.0.0, which is not a valid connection target. While 0.0.0.0 is valid for server binding, client connections must use a specific address like 127.0.0.1. **Issue 2: Race condition on startup (#12851)** The proxy was initialized immediately without waiting for the Ollama server to be ready, causing "connection refused" errors when the UI made requests before the server finished starting. This PR 1. Use envconfig.Host() for host resolution Replace manual environment variable handling with envconfig.Host() 2. Wait for server on first request Use sync.Once pattern to: - Wait for Ollama server to be ready on first proxy request only - Allow webview to open immediately (no blocking at startup) --- <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-16 07:05:20 -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#19371