Skip to content

Add configurable LAN access port - #10082

Merged
Etherll merged 3 commits into
unslothai:mainfrom
wasimysaid:studio-server-port-setting-20260831
Sep 1, 2026
Merged

Etherll merged 3 commits into
unslothai:mainfrom
wasimysaid:studio-server-port-setting-20260831

Conversation

@wasimysaid

Copy link
Copy Markdown
Collaborator

Summary

  • add an Automatic/custom port setting to Settings → Remote & LAN → LAN access
  • keep Automatic as the default: try 8888, then the first available port through 8908
  • persist an exact custom port and show a clear error instead of falling back when it is unavailable
  • use the same saved policy for manual Start and Start automatically; require LAN access to be stopped before editing

This configures only the secondary LAN listener. It does not change the desktop loopback backend or the CLI -p/--port behavior.

Verification

  • 116 focused backend LAN-access tests pass
  • 25 frontend LAN state tests pass
  • frontend typecheck passes
  • frontend production build passes
  • Ruff and git diff --check pass

Live Remote & LAN before/after evidence will be added in a follow-up.

Etherll pushed a commit to Etherll/unsloth that referenced this pull request Aug 31, 2026
@Etherll

Etherll commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

I pushed d207bb61f5e49c523bd36da4091f3aad201bd4f2 (fix(studio): harden LAN port configuration).

Backend status reads remain tolerant, but starting LAN access now rejects unavailable or invalid persisted ports instead of silently falling back. Tests confirm that the listener is never called after rejection. The frontend distinguishes an older backend that omits configured_port from a supported backend returning configured_port: null, so port controls are read only for the older backend. The Port row now uses stable label and description IDs with a persistent live validation region.

The backend LAN suite passed 118 tests, the frontend state suite passed 27 tests, and the diff check, 60 obligation review, and exact range post fix audit all reported zero findings. The evidence gate passed with verdict SAFE WITHIN TESTED SCOPE. Native browser checks passed on Chrome 152.0.7977.65, Edge 152.0.4191.53, and Firefox 132.0. Each showed Custom port 70000, the validation message, and matching aria-describedby. The LAN backend suite also passed 118 tests on both Ubuntu and Windows.

LAN port configuration before and after

The Chromium 1500x950 evidence shows no Port row before. After the change it shows the Port row, Custom, invalid 70000, and Enter a port from 1 to 65535.

Upstream final head CI has 43 passing checks, including the full macOS UI, API, update, and inference job. Two Backend CI jobs remain red for failures outside the PR owned LAN files. Python 3.13 hits a FastMCP private API assumption plus two existing torchao_select failures, while Repo tests CPU fails in test_install_manifest_damage. Three Core matrix jobs were canceled during unsloth_zoo full pytest after the preceding hard gates passed. The PR remains open and mergeable, with review required and no unresolved threads.

@danielhanchen

Copy link
Copy Markdown
Member

One thing I want to be sure of before reviewing: today the LAN listener serves on the port the server actually published (app.state.lan_access_port), and with Automatic this now starts from 8888 regardless, so someone who launched with -p 9000 gets a different LAN URL port than before. Could you confirm that is intended and that _launch_urls still lines up?

@Etherll Etherll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@Etherll
Etherll merged commit f569eea into unslothai:main Sep 1, 2026
60 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants