[GH-ISSUE #3402] [GUI] Let user pin the desktop app's port so localhost API clients survive updates #1376

Closed
opened 2026-11-04 01:50:48 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @couleurs256 on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3402

Description

First: thank you for the "stable window origin" work (fixed preferred port 47831) — it already solved most of my issues. This is a small follow-up on the edge case that remains.

Problem.
I run the Windows desktop app as the OpenAI-compatible endpoint for a local agent; the host port IS the API base URL (http://127.0.0.1:<port>/v1). When 47831 is still held by the previous instance during an update, pick_stable_port() silently falls back to a random port. Two things break at once: every client config (base URL + key) must be redone by hand, and the window origin changes, so the app's own chat list/settings start empty — which the code comments in apps/desktop/src-tauri/src/main.rs already note.

What I'd like (goal, not implementation):

  1. a supported way to pin the host port — a setting, or an env var honored on Windows (STRATA_WINDOW_PORT seems to be internal to the Linux window process, and STRATA_PORT is overwritten by the launcher);
  2. failing that, don't fall back silently: warn and name the process holding 47831, so an API user knows why their URL changed;
  3. document port 47831 and the fallback rule (the docs only mention 8080, the Terminal path).

What I do today: after each update I find the listening port in Strata's serving section. Observed on my Windows 11 machine updating v0.2.0-beta -> v0.2.1: the app stored most sessions on 47831 and one launch on a random port — the update where the old instance still held 47831. Not a deterministic reproduction, just what a normal update did.

Trigger detail: this happened through the in-app updater (GUI -> update). Since the updater relaunches the app while the previous host may still be draining its engines (and holding 47831), the fresh instance picks a random fallback port on that restart. Closing the app first isn't an option in that flow — the updater drives the quit/relaunch itself.

Thanks in advance, the app is awesome!

Originally created by @couleurs256 on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3402 ## Description First: thank you for the "stable window origin" work (fixed preferred port 47831) — it already solved most of my issues. This is a small follow-up on the edge case that remains. **Problem.** I run the Windows desktop app as the OpenAI-compatible endpoint for a local agent; the host port IS the API base URL (`http://127.0.0.1:<port>/v1`). When 47831 is still held by the previous instance during an update, `pick_stable_port()` silently falls back to a random port. Two things break at once: every client config (base URL + key) must be redone by hand, and the window origin changes, so the app's own chat list/settings start empty — which the code comments in `apps/desktop/src-tauri/src/main.rs` already note. **What I'd like** (goal, not implementation): 1. a supported way to pin the host port — a setting, or an env var honored on Windows (`STRATA_WINDOW_PORT` seems to be internal to the Linux window process, and `STRATA_PORT` is overwritten by the launcher); 2. failing that, don't fall back silently: warn and name the process holding 47831, so an API user knows why their URL changed; 3. document port 47831 and the fallback rule (the docs only mention 8080, the Terminal path). **What I do today:** after each update I find the listening port in Strata's serving section. Observed on my Windows 11 machine updating v0.2.0-beta -> v0.2.1: the app stored most sessions on 47831 and one launch on a random port — the update where the old instance still held 47831. Not a deterministic reproduction, just what a normal update did. **Trigger detail:** this happened through the in-app updater (GUI -> update). Since the updater relaunches the app while the previous host may still be draining its engines (and holding 47831), the fresh instance picks a random fallback port on that restart. Closing the app first isn't an option in that flow — the updater drives the quit/relaunch itself. Thanks in advance, the app is awesome!
Author
Owner

@hys17 commented on GitHub (Oct 20, 2026):

Following this as well. Couldn't figure out a way to customize the port number or host address either. Would love to have this feature so my previous configs on different machines would survive this update. The app looks great though!

<!-- gh-comment-id:6296504472 --> @hys17 commented on GitHub (Oct 20, 2026): Following this as well. Couldn't figure out a way to customize the port number or host address either. Would love to have this feature so my previous configs on different machines would survive this update. The app looks great though!
Author
Owner

@sadluck commented on GitHub (Oct 23, 2026):

Seconded, we need to be able to change the port. All my other engines (including older Strata versions) use 8000 and I really don't want to rewrite my harness jsons whenever I swicth between them.

<!-- gh-comment-id:6368529219 --> @sadluck commented on GitHub (Oct 23, 2026): Seconded, we need to be able to change the port. All my other engines (including older Strata versions) use 8000 and I really don't want to rewrite my harness jsons whenever I swicth between them.
Author
Owner

@Soleone commented on GitHub (Oct 27, 2026):

For me it always seems to randomize the port, I can't get it stable so that I can configure my agent (pi). Seems somewhat urgent. Or am I missing something and there is a workaround for a stable port? I also always seem to have to check share on local network again, it doesn't stick.

Optimally I just want to launch the desktop app and load the model, maybe even some shortcut to load the last model quickly, and then move to my agent.

<!-- gh-comment-id:6435506565 --> @Soleone commented on GitHub (Oct 27, 2026): For me it always seems to randomize the port, I can't get it stable so that I can configure my agent (pi). Seems somewhat urgent. Or am I missing something and there is a workaround for a stable port? I also always seem to have to check share on local network again, it doesn't stick. Optimally I just want to launch the desktop app and load the model, maybe even some shortcut to load the last model quickly, and then move to my agent.
Author
Owner

@couleurs256 commented on GitHub (Oct 27, 2026):

The desktop app. French is the ninth language. Settings now has: a sound when a task finishes (on request), a desktop notification when Manual mode needs your approval, minimise to the system tray, a fixed port so API clients keep working across updates (with a warning when the port is busy), and an interface size up to 200%.

Thank you very much for this and so much more ! Updating to 0.2.7 right now.

<!-- gh-comment-id:6445534490 --> @couleurs256 commented on GitHub (Oct 27, 2026): > The desktop app. French is the ninth language. Settings now has: a sound when a task finishes (on request), a desktop notification when Manual mode needs your approval, minimise to the system tray, **a fixed port so API clients keep working across updates (with a warning when the port is busy)**, and an interface size up to 200%. Thank you very much for this and so much more ! Updating to 0.2.7 right now.
Author
Owner

@Niko1221 commented on GitHub (Oct 27, 2026):

Done in 0.2.7: Settings has an 'App port' setting (empty = automatic, 47831 when free). If the port is busy when Strata starts, it now says so in plain words instead of silently using another one.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7

<!-- gh-comment-id:6445805235 --> @Niko1221 commented on GitHub (Oct 27, 2026): Done in 0.2.7: Settings has an 'App port' setting (empty = automatic, 47831 when free). If the port is busy when Strata starts, it now says so in plain words instead of silently using another one. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7
Author
Owner

@hys17 commented on GitHub (Oct 27, 2026):

7. Done in 0.2.7: Settings has an 'App port' setting (empty = automatic, 47831 when free). If the port is busy when Strata starts, it now says so in plain words instead of silently using another one.
Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7

@Niko1221
THIS IS FANTASTIC! Thank you so much!

Noticed a little strange behaviour though.
By default, the local sharing is off, so every time I open the app, I'd need to turn on sharing again, which is fine.
However, since I've set the port number (e.g. 8085), when I turn on local sharing, the active port gets bumped by 1 (e.g. 8086).
Tested for a few restarts.

Was this intended?

Thanks again.

<!-- gh-comment-id:6455833741 --> @hys17 commented on GitHub (Oct 27, 2026): > 7\. Done in 0.2.7: Settings has an 'App port' setting (empty = automatic, 47831 when free). If the port is busy when Strata starts, it now says so in plain words instead of silently using another one. > Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7 @Niko1221 THIS IS FANTASTIC! Thank you so much! Noticed a little strange behaviour though. By default, the local sharing is off, so every time I open the app, I'd need to turn on sharing again, which is fine. However, since I've set the port number (e.g. 8085), when I turn on local sharing, the active port gets bumped by 1 (e.g. 8086). Tested for a few restarts. Was this intended? Thanks again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1376
No description provided.