fix(launcher): auto-start the server so launching the app actually serves - #11687
Open
localai-bot wants to merge 1 commit into
Open
fix(launcher): auto-start the server so launching the app actually serves#11687localai-bot wants to merge 1 commit into
localai-bot wants to merge 1 commit into
Conversation
…rves Fixes #11673: on macOS the DMG launcher appeared to launch nothing. After installing, the app sat in the menu bar with no window, nothing listening on localhost:8080, and empty log files, because nothing ever started the server unless the unrelated 'start on system boot' option was enabled. - Start the LocalAI server automatically when the launcher opens and right after a fresh install. The new auto_start_server config key defaults to enabled and gets a settings checkbox; the legacy auto_start key was never honored nor exposed, so every existing launcher.json carries an unintentional false and is deliberately left behind. - Fix the welcome window suppressing itself: its 'don't show this again' checkbox was initialized with the inverted value, and SetChecked fired the change callback which persisted ShowWelcome=false on the very first showing. - Surface auto-start failures through the systray startup-error dialog, since there is no visible window during auto-start. - Pass --app-version to fyne package so the app stops reporting itself as version 0.0.0 in the About box. - Document the first-launch flow (menu bar app, auto-start, WebUI URL) in the macOS getting-started page. - Repair two launcher specs that never ran in CI: a *bool matched against BeTrue and a /tmp assertion that trips on Linux where the test tempdir itself lives under /tmp. Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11673
What was happening
On macOS, launching the DMG app after the first-run install appeared to do nothing: no window, nothing listening on
localhost:8080, and empty log files under~/.localai/logs/, while running~/.localai/bin/local-aiby hand worked fine.Three launcher defects stacked up to produce this:
Initialize()only calledStartLocalAI()whenStartOnBootwas enabled, which defaults to false and whose checkbox is labeled "Start LocalAI on system boot", so nobody enables it expecting "start when the app opens". TheAutoStartconfig field existed but was never read anywhere. The empty log files are the fingerprint: one is created on every launch, but only server output is ever written to it, and the server never spawned.SetChecked(*config.ShowWelcome)), andSetCheckedfires the change callback, which immediately persistedShowWelcome=false. So on relaunch the one window that could orient the user never appeared again.What this PR changes
auto_start_serverconfig key, default enabled, with a "Start LocalAI when the launcher opens" checkbox in Settings. The key is deliberately not the legacyauto_start: that field was never honored nor exposed in any UI, so every existinglauncher.jsoncarries an unintentionalfalsethat would keep auto-start permanently off for exactly the users hit by this bug.StartOnBootkeeps its historical force-start behavior.0.0.0in the About box (also noted in the issue):fyne packagenow receives--app-version, sanitized fromgit describeoutput (v4.9.0,v4.9.0-14-gabc1234, or a bare sha) down to the numeric core fyne accepts, falling back to0.0.0only when there is no tag.Testing
The launcher package is excluded from lint and not exercised by CI, and fyne needs X11/GL headers to compile, so the suite was run in a
golang:1.26container withxorg-dev/libgl1-mesa-dev:ShouldAutoStartServer(default-on, explicit opt-out,StartOnBootoverride, legacyauto_start:falseignored) and for the welcome checkbox initial state. They were written first and failed against the old behavior.go vet ./cmd/launcher/...is clean.Expect(config.ShowWelcome).To(BeTrue())on a*bool, and a BuildRunArgs assertion rejecting every/tmp/-prefixed arg, which trips on Linux where the test's own tempdir lives under/tmp(it now rejects only the shared/tmp/generatedand/tmp/uploadserver defaults it was written to guard against).make -s -fharness for tagged, untagged, and sha-onlyVERSIONvalues.🤖 Generated with Claude Code
https://claude.ai/code/session_01PZ5qWPRJK4JF77NCWUsgf8