Repository navigation
fix(lemonade): stop sending the dead LEMONADE_CTX_SIZE start variable - #6326
kovtcharov-amd wants to merge 4 commits into
Conversation
GAIA started modern Lemonade with LEMONADE_CTX_SIZE in its environment and told users to set it, but no Lemonade release since 10.x reads it: the server's env table has no such entry, and upstream only names it in a test asserting it is absent from the CLI help. Every hint and auto-start that carried it looked like it pinned the window and changed nothing. The window already reaches Lemonade the way that works: every GAIA /load sends ctx_size. So the dead channel is removed rather than replaced. - build_start_command returns an empty env for every modern launch form; the legacy CLI keeps its --ctx-size flag. - The Go TUI drops the same env prefix, the child-env injection, the LEMONADE_CTX_SIZE target override, and the remedy sentence telling users to set it in their service config. - Tests that mocked build_start_command and then asserted their own fixture now call it for real; the env-merge and PATH-retention checks stay, against a neutral variable. Fixes #3320
|
Verdict: Approve with suggestions GAIA used to start Lemonade with a context-size variable, and told users to set it, but current Lemonade never reads that variable. This PR stops sending it from the Python launcher and the Go TUI, so the start command and the hint shown to users are now just the bare command. The legacy One spot outside the diff still gives the old advice. When the C++ client gets a "context too small" error, it tells the user to set the dead variable before restarting. Point it at the helper script or a reload instead, in this PR or a quick follow-up. Real-world evidenceThe evidence stage ran on
🔍 Technical detailsIssues found 🟡 The C++ client still tells users to set the dead variable ( (Remove the 🟢 Stale test fixtures still show the old command shape
Strengths
|
|
Both suggestions are applied in the latest push.
I left |
|
This branch conflicts with Next step: merge 🔍 Technical details
|
Resolves the overlap with #6317. The shared C++ error decoder it added now gives this PR's context-overflow advice (reload via start-lemonade.ps1, no LEMONADE_CTX_SIZE), and its test checks for that remedy and for the dead variable's absence. profileCtxSize keeps main's NPU min-ctx lookup and drops only the environment override.
|
This branch now merges cleanly with 🔍 Technical details
|
GAIA started Lemonade with
LEMONADE_CTX_SIZEset and told users to set it too, but current Lemonade never reads that variable. So every auto-start and every "run this" hint that carried it appeared to set the context window and did nothing. This PR stops sending it. The window already reaches Lemonade through a channel that works: every GAIA model load sendsctx_size. The legacy CLI keeps its--ctx-sizeflag.The issue suggested switching to
lemonade config set ctx_size=N. I removed the variable instead, because that command persistently rewrites the user's own Lemonade config for every app on the machine. GAIA's per-loadctx_sizealready sets the window GAIA needs. The Go TUI had a copy of the same variable, so it is removed there too. Without that, the two front-ends would give different start commands.Fixes #3320
🔍 Technical details
lemonade-sdk/lemonadenames it only intest/server_cli2.py, which asserts that it is absent from the CLI help.config_file.cppdoes not read it at v10.10.0, v11.0.0, or v2026.44.1 (the version GAIA pins). Context size is thectx_sizekey inconfig.json, or/load ctx_size.build_start_commandreturns an emptyenvfor every modern form.describe_start_hint/render_commandno longer print aLEMONADE_CTX_SIZE=prefix or aset "..." &&form.ctxPrefix,startEnv,ctxNoteand theLEMONADE_CTX_SIZEoverride inprofileCtxSize. The PowerShell variant is now emitted only when it differs from the cmd.exe line. The profile window is still used for the legacy flag and the loaded-window shortfall row.start-lemonade.ps1 -CtxSize, which sendsctx_sizeon/load.build_start_commandand then asserted its own return value now call the real function. The env-merge and PATH-retention checks are kept, using a neutral variable.require_lemonadelaunch-ctx test was added. With nothing sent at launch, there is no launch-time claim left to verify. The/load ctx_sizeround trip is test(lemonade): the live /pull and /health tests cannot fail #3323's scope.Test plan
python -m pytest tests/unit/test_lemonade_launcher.py tests/unit/test_lemonade_supervisor.py tests/unit/test_child_env_launch_sites.py tests/unit/test_lemonade_client_http.py tests/unit/test_llamacpp_backend.py tests/unit/test_ui_gpu_detection.py tests/unit/installer/test_init_ctx_size.py -q→ 272 passedcd tui && go vet ./internal/ui/preflight/ && go test ./...→ all packages okblack --check/isort --check-onlyclean on touched Pythonnpx vitest run src/components/__tests__/ConnectionBanner.test.tsx→ 9 passedbuild_tui.ymlgolangci-lint (not installed locally)cpp/(no C++ compiler on this machine; the change only edits two error-message string literals)