Repository navigation
fix(installer): detect and auto-start modern Lemonade in gaia init - #1940
Conversation
Add failing tests for the not-yet-implemented modern-Lemonade detection primitive ahead of the implementation.
Rewire check_installation tests onto resolve_lemonade/get_installed_version (AC1/AC2), and pin the corrected _ensure_server_running behavior where auto-start is attempted before the interactive "Please start Lemonade Server" prompt in both CI and interactive modes, with a fail-fast guarantee that a failed auto-start never hangs on input() (AC5/AC6). Also extend the #839 ctx-size regression guard to cover the modern LEMONADE_CTX_SIZE env-var path alongside the existing legacy --ctx-size argv path, so a future change can't silently drop ctx-size propagation for modern tooling while the legacy assertions keep passing. 3 pre-existing test failures unrelated to this change (already broken on main, not introduced here): TestEnsureLemonadeInstalledSkipsWhenPresent::test_older_version_below_minimum_triggers_install_in_ci, TestLegacyFallback::test_not_installed_on_linux_proceeds_to_install_via_ppa, TestLegacyFallback::test_not_installed_on_windows_proceeds_to_download_and_install
Pin that launch_server() builds its Popen argv/env from resolve_lemonade()/build_start_command() instead of the hardcoded ["lemonade-server", "serve"] literal, with a byte-identical regression guard for the legacy argv shape and a guard that kill_process_on_port is skipped when health_check() already reports the server healthy at entry.
Pin at the Popen call sites that spec.env is MERGED into the parent
environment ({**os.environ, **spec.env}) rather than replacing it — an
implementation passing env=spec.env alone would drop PATH/LOCALAPPDATA
and break LemonadeServer.exe while still passing the previous
assertions. Sentinel env var seeded before the call and asserted
retained, alongside PATH, in the three modern-path launch tests.
Also add the direct build_start_command-level Windows-legacy test
asserting --no-tray in argv, pin platform in the non-Windows legacy
test for cross-platform determinism, and replace a no-op tuple
assertion with a real assertTrue.
Modern Lemonade (10.7/10.8) removed the lemonade-server CLI; the server is LemonadeServer.exe --silent on Windows (ctx via LEMONADE_CTX_SIZE env) and the lemond systemd unit on Linux. Add the stdlib-only shared primitive (resolve_lemonade / get_installed_version / build_start_command) that the installer and runtime client will adopt instead of hard-coding lemonade-server. Precedence: LEMONADE_SERVER_PATH env override (verbatim, no PATH search) -> modern by canonical path (wins over a stale legacy binary on PATH) -> legacy which(lemonade-server|lemonade-server-dev). Legacy argv stays byte-identical (serve --ctx-size, + --no-tray on Windows). All 12 contract tests in tests/unit/test_lemonade_launcher.py pass; includes black formatting fixes to the contract test files.
check_installation() previously probed only shutil.which("lemonade-server"),
so a modern Lemonade install (10.7+, no lemonade-server CLI) reported
installed=False and gaia init tried to reinstall over a working setup.
Delegate detection to the shared resolve_lemonade()/get_installed_version()
primitive: modern installs are found at their canonical path, legacy
installs keep working unchanged, and a found install whose version probe
fails still reports installed=True with a diagnostic error (mirroring the
old failed-to-get-version branch). LemonadeInfo shape and find_product_code
are untouched — all five callers are unaffected.
…316) Interactive `gaia init` previously never auto-started the server — an indentation bug made the "Please start Lemonade Server" prompt block run unconditionally, blocking on input() even in flows that could have started the server themselves. Restructure _ensure_server_running(): auto-start is attempted first in BOTH CI (yes=True) and interactive modes, success returns before any prompt, and the manual prompt is the only remaining fall-through (interactive auto-start failure). CI mode returns False on a failed auto-start without ever touching input(). Auto-start now routes through resolve_lemonade()/build_start_command() in a new _auto_start_server() helper — the raw [path, "serve", "--no-tray", --ctx-size] literal is gone, so modern tooling (LemonadeServer.exe --silent + LEMONADE_CTX_SIZE env, merged into the parent environment) starts correctly, including under CI's LEMONADE_SERVER_PATH override which resolve_lemonade() now honors in one place instead of a parallel os.environ.get. The interactive fallback prompt renders the exact start command for the resolved tooling; _find_lemonade_server() delegates to the shared primitive.
) launch_server() hardcoded ["lemonade-server", "serve"], which no longer exists in modern Lemonade (10.7+) — auto-start was broken for every modern install. Route argv/env through resolve_lemonade()/build_start_command(): modern gets LemonadeServer.exe --silent with LEMONADE_CTX_SIZE merged into the parent environment, legacy keeps its exact argv. A missing install now raises an actionable LemonadeClientError instead of a bare FileNotFoundError from Popen. Also: skip kill_process_on_port() when health_check() already reports OK at entry (never restart a healthy tray/systemd-managed server the user didn't ask to restart); convert the "terminal" branch from a shell=True f-string to argv-only Popen with CREATE_NEW_CONSOLE so a resolved path never passes through a shell string; log_level appends --log-level only for legacy tooling (modern launcher has no such flag — logged at debug and ignored); _check_lemonade_installed() and get_lemonade_version() use the primitive; user-facing "restart with" hints render the resolved tooling's real start command instead of the removed lemonade-server CLI (test assertion widened to accept the modern LEMONADE_CTX_SIZE form).
…nned TestLaunchServerCtxSize asserted the removed hardcoded lemonade-server argv and hit the real network (unmocked health_check), so results flipped depending on whether a local server happened to be running and which tooling the host had. Pin resolve_lemonade to legacy (the argv path under test — modern env-var ctx is covered by the #316 contract tests) and stub health_check to fail so the already-healthy launch guard never short-circuits the assertion.
|
Verdict: Approve with suggestions — no blocking issues. This fixes the real #316 breakage: modern Lemonade (10.7+) dropped the The only things worth a look are minor edge-cases, none of which affect the tested path: an env-override to a modern Linux binary gets silently ignored in favor of 🔍 Technical details🟢 Minor1. 2. 3. Manual-prompt hint uses POSIX Strengths
|
An explicit LEMONADE_SERVER_PATH override classified as modern but not a Windows .exe (e.g. a Linux daemon path) was silently rerouted to 'systemctl --user start lemond', ignoring the binary the caller named. Track resolution provenance on LemonadeTooling (source: env|probe) and launch an env-override binary verbatim; probe-resolved modern Linux keeps the best-effort systemctl start. Also note _find_lemonade_server() is a compat-only surface with no in-tree callers.
|
Addressed the review's minor items in 807b3b5:
Also for the record: the earlier "Example Agents Unit Tests" red was infrastructure (a 503 from download.pytorch.org during env setup — no tests ran), and the |
📸 Real-world proof (Windows 11 and macOS · AMD Ryzen AI · Lemonade 10.7.0)Live over SSH against the current PR tip `807b3b53`. Terminal output rendered from the actual run (raw text is in the PR description as verifiable source). Top panel — detection: Bottom panel — auto-start (#316 obs. 2): with Image lives on the disposable |
CI note — the two red integration checks are a known runner-infra flake, not this changeRAG Integration Tests and Test Lemonade Embeddings API both fail in CI's own "Start Lemonade Server" setup step (before any test runs) with: This is the documented runner-side
The gates that actually exercise the change are green (Unit Tests py3.10/3.11/3.12 + macOS, Code Quality, CodeQL, Linux CLI integration, pr-review bot) plus the Windows real-world proof above. Not re-running further to avoid churn — flagging for a maintainer to clear the runner. |
kovtcharov-amd
left a comment
There was a problem hiding this comment.
Approving — this is a clean, well-scoped fix for #316 with real-world evidence on a modern (10.7) Windows box.
What makes it solid:
- Detection/launch is consolidated into one stdlib-only primitive (
resolve_lemonade/build_start_command) with clear precedence (env override → modern canonical path → legacy PATH), and the legacylemonade-server serveargv is pinned byte-identical by tests. - Fails loud, not silent:
build_start_commandand the client raise actionable errors ("Rungaia init… or set LEMONADE_SERVER_PATH") when no tooling is found; auto-start failure surfaces the error and prints the correct per-tooling start command rather than degrading quietly. - Nice safety bonus: the runtime launch drops
shell=Truein favor of argv-onlyPopenwithenv={**os.environ, **spec.env}. - Tests added for the launcher, the modern/legacy dispatch, and the installer detection path.
On the red checks (API Tests / Test Lemonade Embeddings / behavior-e2e): these are the known Lemonade cold-start infra flake — they fail in the workflow's own lemonade-server serve start step (Server health check failed after 60 seconds), before any test code runs, and reproduce on unrelated PRs. Not a regression from this change. A rebase onto current main (which now has #1946's stray-Lemonade-process cleanup) should reduce them.
Release notes had grown into long blocks of prose with a marketing-toned paragraph on top. They now generate as short bullets grouped by section, with a word cap on the narrative part. Nothing informational is lost — every PR link, contributor credit, and changelog entry is preserved; the prose around them is cut. Two generators write `docs/releases/<tag>.mdx` and they had drifted apart. The `gaia-release` skill told the model GAIA's notes "read dry" and to make them "engaging"; the `release-notes` job in `claude.yml` asked for "comprehensive" notes with an `## Overview` paragraph and emoji headings. Fixing one alone would have been overwritten by the other on the next tag, so both now share one spec. Closes amd#2961 ## What it looks like now Regenerated from the last two releases — same facts, same PR numbers, new template. Narrative words (the capped part, excluding bug-fix/contributor/changelog lists): | Release | Published | Regenerated | Cap | |---|---|---|---| | v0.22.0 (minor) | 1705 | **538** | 600 | | v0.23.0 (minor) | 1119 | **280** | 600 | <details> <summary>Example 1 — v0.23.0 regenerated</summary> ```markdown --- title: "v0.23.0" description: "Install and run agents from the terminal, add capabilities as skills, and connect a Microsoft account without a secret." --- # GAIA v0.23.0 Release Notes Agents are now installable from the terminal, and the confirmation gate that pauses an agent before a consequential action works everywhere, not just in the Agent UI. ## Breaking Changes - **`GAIA_MICROSOFT_TENANT` is gone** — the Microsoft connector split into Personal and Work/School, each with its own tenant. Drop the variable and pick the matching connector. (PR [amd#2729](amd#2729)) ## What's New - **Install and run agents from the terminal** — `gaia hub list`, `gaia hub install <agent> --trust`, `gaia hub uninstall <agent>`. `--trust` is required for an unverified agent. (PRs [amd#2484](amd#2484), [amd#2530](amd#2530), [amd#2708](amd#2708)) - **Every agent asks before it acts** — the confirmation gate for sending mail, writing files, and running commands now fires from the terminal, the local API, and MCP tool calls, not only the Agent UI. Set `GAIA_AUTO_APPROVE_TOOLS=1` to opt out. (PRs [amd#2475](amd#2475), [amd#2544](amd#2544), [amd#2846](amd#2846), [amd#2854](amd#2854)) - **Safer by default** — the MCP bridge binds to localhost and enforces `--auth-token`; the local API refuses credentialed cross-origin requests from non-allow-listed sites; MCP servers launch without a shell; agents cannot write to `~/.gaia` or pass crafted SQL to the database agent. (PRs [amd#2246](amd#2246), [amd#2238](amd#2238), [amd#2344](amd#2344), [amd#2844](amd#2844), [amd#2847](amd#2847), [amd#2860](amd#2860)) - **Add capabilities as skills** — `gaia skill create|import|list|info` gives an agent a new capability from a folder and a manifest. Skills are signed with trust tiers, audited before publish, and opt-in. (PRs [amd#2669](amd#2669), [amd#2692](amd#2692), [amd#2702](amd#2702), [amd#2693](amd#2693)) - **Connect a Microsoft account without a secret** — Personal and Work/School are separate connectors with device-code sign-in. (PRs [amd#2718](amd#2718), [amd#2364](amd#2364)) - **Lemonade Server 11.5.0.** ## Bug Fixes - **Triage paginates large inboxes and reports truncation** (PR [amd#2646](amd#2646)) — mail past a hidden limit is no longer dropped without saying so. - **Thread messages come back sorted and numbered** (PR [amd#2570](amd#2570)) — "reply to 3" hits the message shown at position 3. - **The inbox pre-scan reports uncertainty as uncertainty** (PR [amd#2587](amd#2587)). - **An email conversation survives its turns** (PR [amd#2837](amd#2837)) — a follow-up keeps session context. - **A bare reconnect keeps existing grants** (PR [amd#2733](amd#2733)). - **Restore from Trash anytime** (PR [amd#2542](amd#2542)) — no time window on undo. - **Sender priority no longer overrides content classification** (PR [amd#2774](amd#2774)). - **The agent survives an OpenMP double-init** (PR [amd#2508](amd#2508)). - **Large tool results truncate to valid JSON** (PR [amd#2645](amd#2645)). - **A missing model surfaces as a real 404** (PR [amd#2245](amd#2245)). - **GPU is detected on all platforms and `default_device` is honoured** (PR [amd#2244](amd#2244)). - **A sidecar that is alive but not serving is detected** (PR [amd#2707](amd#2707)). - **The model-slot lease is held across inference** (PR [amd#2394](amd#2394)) — a second agent can't evict the model mid-generation. - **A browser that never launched is surfaced** (PR [amd#2507](amd#2507)). - **Stop aborts in-flight streaming** (PR [amd#2166](amd#2166)). ## Known Issues - **The email agent is beta and CLI-first** — treat its output as a draft to review. - **A full inbox triage can time out on larger mailboxes.** - **Email autonomy is experimental** and not wired up in the packaged sidecar. ## Contributors - [@handle](https://github.com/handle) — <contribution> (PR [#NNN](https://github.com/amd/gaia/pull/NNN)) <!-- generated from the commit log; v0.23.0's list is unchanged from the published notes --> ## Full Changelog **N commits** since v0.22.0: - `<sha>` — <subject> Full Changelog: [v0.22.0...v0.23.0](amd/gaia@v0.22.0...v0.23.0) ``` </details> <details> <summary>Example 2 — v0.22.0 regenerated (the largest recent release)</summary> ```markdown --- title: "v0.22.0" description: "The email agent tracks follow-ups and action items, drafts in your voice, and runs as its own process. Plus a cron scheduler and Word document support in RAG." --- # GAIA v0.22.0 Release Notes A large release built around the email agent, which now tracks what you're waiting on instead of forgetting it after triage. ## Breaking Changes - **Triage returns a reply scaffold, not an empty draft** — `POST /v1/email/triage` and `/triage/batch` now return a `DraftScaffold` without `body`. Code reading `result.draft.body` gets a missing key instead of `""`; use `POST /v1/email/draft` for composed prose. (PR [amd#1984](amd#1984)) - **RoutingAgent and DocumentQAAgent moved to standalone packages** — install `gaia-agent-routing` and `gaia-agent-docqa`. The old imports fail; there is no deprecation shim. (PR [amd#1455](amd#1455)) ## What's New - **An inbox agent that keeps track** — `gaia email` scans Sent folders across every connected mailbox and flags threads still waiting on a reply past a window you set (default 3 days). Detection only; it never nudges anyone for you. (PRs [amd#1922](amd#1922), [amd#1917](amd#1917), [amd#1919](amd#1919), [amd#1918](amd#1918)) - **Drafts in your own voice** — the agent derives greeting, sign-off, length, and formality from your Sent history and composes against that. Only the derived characteristics are stored, never old mail content. (PR [amd#1925](amd#1925)) - **Attachments work end to end** — triage surfaces each attachment's name, type, and size, and drafting and sending accept real attachments as Gmail multipart MIME or Outlook Graph attachments. (PRs [amd#1921](amd#1921), [amd#1883](amd#1883)) - **Email runs as its own process in the Agent UI (beta)** — install it from the Agent Hub panel and the UI talks to it over HTTP, instead of loading the email stack into the UI process. (PRs [amd#1884](amd#1884), [amd#1910](amd#1910), [amd#2100](amd#2100), [amd#2101](amd#2101), [amd#2105](amd#2105)) - **Run prompts on a cron from the terminal** — `gaia schedule add --name digest --cron "0 9 * * *" --prompt "summarize my inbox" --sink stdout`, then `gaia schedule daemon`. Schedules live in a hand-editable `~/.gaia/schedules.toml`; sinks are `stdout`, `file:<path>`, `notification`, or `telegram`. (PR [amd#1371](amd#1371)) - **Agents learn from work they repeat** — after enough successes on the same shape of goal, an agent distills the tool sequence into a reusable procedure and recalls it next time. Runs inside the existing memory pass; nothing to install. (PR [amd#1794](amd#1794)) - **Pick your model once** — `gaia config set default_model <id>` persists across `gaia chat`, `gaia llm`, and `gaia prompt`. An explicit `--model` still wins for a one-off. (PR [amd#1863](amd#1863)) - **RAG reads Word documents** — `.docx` files index like PDF and PPTX, including table cells, nested tables, content controls, hyperlinks, and textboxes, so filled-in form values get indexed. (PR [amd#1866](amd#1866)) - **A new default embedder** — the previous default cannot be loaded by current llama.cpp builds, which broke indexing, code search, and memory embedding on an up-to-date Lemonade. The default is now EmbeddingGemma 300M at the same 768 dimensions. (PRs [amd#1952](amd#1952), [amd#1761](amd#1761), [amd#1748](amd#1748)) - **The Agent Hub shows what an agent is worth** — an agent's page now carries its eval scorecard with a score badge and a code-derived capability matrix. (PRs [amd#1985](amd#1985), [amd#2020](amd#2020), [amd#2066](amd#2066)) - **Lemonade Server 10.10.0** — adds an audio-generation endpoint, lets Windows reuse system ROCm, and inhibits suspend during inference. Two upstream breaking changes are Linux-specific. (PR [amd#1969](amd#1969)) ## Bug Fixes - **`gaia init` said a working Lemonade wasn't installed** (PR [amd#1940](amd#1940)) — modern Lemonade (10.7+) dropped the `lemonade-server` CLI that GAIA probed for. - **Installing the email agent from the Hub failed on every platform** (PR [amd#2086](amd#2086)). - **Bulk triage broke on any real inbox** (PR [amd#2088](amd#2088)) — 60 emails overflowed the 16K context window; the result envelope is now condensed. - **RAG silently indexed nothing** (PR [amd#1979](amd#1979)) — a failed `sentence-transformers` import made every indexing call a no-op. - **Email bodies were truncated at 4,000 characters with no override** (PR [amd#2036](amd#2036)) — MFA codes and precise replies lost content past the cutoff. - **Long threads overflowed the model's context** (PR [amd#2076](amd#2076)). - **A disabled device was treated as usable** (PR [amd#2081](amd#2081)) — a device reporting `available: false`, such as an unpowered NPU, was misread as ready. - **A newly connected mailbox was skipped** (PR [amd#1808](amd#1808)) — mailboxes connected mid-session were not picked up. - **JSON with a `}` inside a string was dropped** (PR [amd#1824](amd#1824)). - **Outlook users were told to reconnect Google** (PR [amd#1757](amd#1757)) — `AGENT_NOT_GRANTED` named the wrong provider. - **The Agent UI hard-crashed on a recoverable GPU crash** (PR [amd#1799](amd#1799)) — it now falls back to software rendering. - **A user-edited memory could be silently downgraded and then wiped** (PR [amd#1958](amd#1958)). - **The builder agent ignored an agent name you had already given** (PR [amd#1981](amd#1981)). - **The landing and hub pages scrolled sideways on phones** (PR [amd#1959](amd#1959)). ## Known Issues - **Inbox pre-scan needs a single mailbox for now** — with both Gmail and Outlook connected, an Agent UI pre-scan errors. Disconnect one in Settings → Connectors; triage itself still spans every mailbox. ([amd#2127](amd#2127)) - **Spam detection under-flags over the REST API** — `/v1/email/triage` uses a narrow sender check rather than the model's reading. The agent's own inbox scanning is unaffected. ([amd#2124](amd#2124)) - **The email agent is beta** — treat its output as a draft to review. It never sends without your confirmation. ## Contributors - [@alexey-tyurin](https://github.com/alexey-tyurin) — skill auto-synthesis / procedural memory (PR [amd#1794](amd#1794)) - [@TravisHaa](https://github.com/TravisHaa) — the `gaia schedule` CLI and cron-based dispatch (PR [amd#1371](amd#1371)) - [@Rohithmatham12](https://github.com/Rohithmatham12) — refresh resolved email backends before multi-mailbox triage (PR [amd#1808](amd#1808)) - [@Osamaali313](https://github.com/Osamaali313) — fix `extract_json_from_text` dropping JSON containing `}` (PR [amd#1824](amd#1824)) - [@eeee2345](https://github.com/eeee2345) — offline model-endpoint guard-proxy integration guide (PR [amd#1809](amd#1809)) - [@somo9909](https://github.com/somo9909) — prerequisites section for the memory guide (PR [amd#1665](amd#1665)) ## Full Changelog **N commits** since v0.21.2: - `<sha>` — <subject> Full Changelog: [v0.21.2...v0.22.0](amd/gaia@v0.21.2...v0.22.0) ``` </details> <details> <summary>What changed in the templates</summary> - The narrative overview paragraph and the `**Why upgrade:**` block are gone — the latter restated `What's New` verbatim. - `What's New` entries are bullets, not `###` prose blocks. - Tone guidance is no longer restated in the skill; it points at CLAUDE.md § How You Communicate. - The skill's embedded example now shows the old prose block as **bad** and the bullet form as **good**. - Emoji removed from the CI prompt (it asked for 🚀 / 🎯 / 🐛 headings against the skill's own no-emoji rule). - Both generators now emit the same sections in the same order, so the file's shape no longer depends on which one ran. - The cap excludes `Bug Fixes` / `Known Issues` / `Contributors` / `Full Changelog`. Those are reference lists sized by how many fixes shipped — capping them would hide work. This was caught by regenerating v0.22.0, which overflowed a whole-file cap purely on its 14 bug-fix bullets. **Follow-up, not in this PR:** the cap lives in prompt text, so it is advisory. Making it a hard check in `util/validate_release_notes.py` would enforce it in CI. </details> ## Test plan - [ ] `python util/validate_release_notes.py <regenerated sample> --tag v0.23.0` exits 0 — passes unmodified, no validator changes in this PR - [ ] `awk '/^## (Bug Fixes|Known Issues|Contributors|Full Changelog)/{exit} {print}' <file> | wc -w` is under 350 (patch) / 600 (minor-major) - [ ] `.github/workflows/claude.yml` parses as valid YAML and its release-notes prompt contains no emoji - [ ] `.claude/skills/gaia-release/SKILL.md` is under 500 lines (498) - [ ] Both generators list the same sections in the same order

Closes #316
Modern Lemonade (10.7+, including the 10.8.1 GAIA installs) removed the
lemonade-serverCLI — the server is nowLemonadeServer.exe --silenton Windows (ctx size via theLEMONADE_CTX_SIZEenv var) and a systemdlemondservice on Linux. GAIA still hard-codedlemonade-server serveeverywhere, so on a modern installgaia initreported a working Lemonade as not installed, and after any install it told the user to start the server by hand (#316's "never started it") — interactive mode could never auto-start because of an indentation bug that made the manual prompt unconditional. Now detection finds modern and legacy installs, andgaia initauto-starts the server in both interactive and CI modes, falling back to a prompt (showing the correct per-tooling command) only if auto-start fails. (#316's uninstall failure was previously fixed by #478; verified still working — the registry ProductCode lookup finds modern installs.)All changes route through one new stdlib-only primitive,
gaia.llm.lemonade_launcher(resolve_lemonade/get_installed_version/build_start_command), consumed by the installer andLemonadeClient— legacylemonade-serverbehavior is pinned byte-identical by tests, and CI'sLEMONADE_SERVER_PATHoverride is honored first.Evidence (real-world, Windows 11 + Ryzen AI box, Lemonade 10.7.0)
Tested by deploying this branch to the machine's editable GAIA install and running the real CLI over SSH.
Detection — before:
main's check isshutil.which("lemonade-server"), which isNOT ON PATHon this modern install → "not installed" → forced reinstall over a working setup. After:Auto-start —
LemonadeServer.exestopped, then interactivegaia init --profile minimal --skip-models(stdin-driven,yesnot set):No "Please start Lemonade Server" prompt appeared;
LemonadeServer.exealive (pid captured) and/api/v1/health= 200 afterwards. The ctx-size env path is proven end-to-end by the Step-4 32768-token model preload.Test plan
python -m pytest tests/unit/test_init_command.py tests/unit/installer/ tests/unit/test_lemonade_launcher.py tests/test_lemonade_client.py -q→ 245 passed; the 4 failures are pre-existing environment artifacts (3 tests short-circuited by a live local Lemonade on :13305 — fail identically onmain— plus 1 live-server integration test), none in changed codepython util/lint.py --all→ exit 0Reviewer notes — bundled behavior deltas & rationale
input()never called on auto-start success, Popen env must retain the parent environment (merge, not replace), legacy argv pinned byte-identical,LEMONADE_SERVER_PATHhonored before any PATH probe with modern-beats-stale-legacy precedence.launch_server()now skipskill_process_on_portwhen a healthy server is already listening (never restarts a tray/systemd-managed server the user didn't ask to restart), raises an actionable error when no tooling is found, and itsbackground="terminal"branch is argv-only (CREATE_NEW_CONSOLE) instead of ashell=Truestring.check_installation()no longer returns installed=False on a version-probe timeout (that could trigger a pointless reinstall); a found install with a failed probe stays installed=True with a diagnostic error.LemonadeInfoshape andfind_product_code()are unchanged (all five callers unaffected).launch_servernow passes--no-tray(aligning with whatgaia initalways did);--log-levelis appended for legacy only (the modern launcher has no such flag — logged and ignored, not silently dropped).lemonade-serverCLI._find_lemonade_server()retained as a compat surface (delegates to the primitive) though it has no remaining callers.systemctl --user start lemond) is best-effort and unit-tested only — the daemon is normally already running under systemd..github/actions/install-lemonade/action.ymlandinstaller/scripts/*.ps1duplicates this logic and has one stale search path; consolidating PS/Python detection is out of scope here.