Repository navigation
Conversation
gaia kill --lemonade ran the removed `lemonade-server stop`, then killed whatever held port 13305, so it never reached GAIA's own server on its own port or one set with LEMONADE_BASE_URL. It now stops GAIA's own server the way `gaia lemonade embedded stop` does, stops a chosen server on this machine by its port, and refuses one on another machine. The removed-CLI guard drops its stale exemptions, skips docstrings as well as comments, and catches every removed subcommand, including the argv form. Closes amd#4437
|
Verdict: Approve
Real-world evidenceN/A here: no evidence bundle was produced for this run. The PR description has before/after 🔍 Technical detailsIssues found 🟢 Unclear message when GAIA's own server isn't running ( Checks done
Strengths
|
|
Thanks for this — stopping GAIA's own server through
One question we'll come back to you on: when GAIA's own Lemonade isn't running and no server was chosen, 🔍 Technical details
|
The lemonade-server stop path is gone, so its test now fails; the exit-code cases it covered live in test_kill_lemonade.py. cli.py makes one fewer untimed subprocess call, so its ratchet count drops from 3 to 2.
|
Thanks @ityashag. I merged main into the branch and made the two test fixes from the review: the old |
…onade The port comes from LEMONADE_BASE_URL or the setup choice, so a Python, Node or Electron listener there is the user's own program. It is now left running and named, and only lemond, LemonadeServer or llama-server is killed. 0.0.0.0, :: and this machine's own hostname count as this machine instead of being reported as another one.
|
Thanks @ityashag, this is a real fix and the widened removed-CLI guard is a nice catch. I merged main and closed one gap: with 🔍 Technical details
|
Summary
gaia kill --lemonadenow stops the Lemonade Server GAIA actually uses. Before, it ran the removedlemonade-server stop, then killed whatever held port 13305, so it never reached GAIA's own server, which picks its own port, or a server set withLEMONADE_BASE_URL. With a remoteLEMONADE_BASE_URLit even went after port 13305 on this machine.Why
The issue asks to route the kill through what starts the server and to fail loudly when it can't stop it. A silent fallback to a fixed port is what
CLAUDE.mdrules out.Linked issue
Closes #4437
Two of the issue's four parts were already fixed on
main: the "start lemonade-server" log text and thelemonade-server pulldocs. This PR does the other two.Changes
LEMONADE_BASE_URLor setup choice)gaia lemonade embedded stopdoes, child processes includedlocalhost, a loopback address,0.0.0.0or this machine's hostname)lemond,LemonadeServer,llama-server). Anything else there, including a Python, Node or Electron dev server, is left running and named with its PIDNothing running still exits 0, so the documented
gaia kill --lemonade && …keeps working.The removed-CLI guard test:
stop,list,statusand the rest, not onlyserveandpull), including the argv form["lemonade-server", "stop"]that hid this bug from it.Test plan
Run in a
python:3.12-slimcontainer with.[ui]and the test tools installed:pytest tests/unit/test_kill_lemonade.py tests/unit/test_no_removed_lemonade_cli.py: 9 passed.pytest tests/unit/test_cli_refusal_exit_codes.py: passes excepttest_kill_lemonade_stays_chainable_when_nothing_is_running, which runsgaia kill --port 1and fails in my container because it has nolsof. It fails the same way onmain, and this PR doesn't touch that path.python util/lint.py --all: Black, isort, Flake8, Bandit and the MyPy ratchet pass. Pylint crashed in a parallel worker on my machine; run alone with the same flags, it reports nothing.pytest tests/unit -n 3: 25,993 passed and 31 failed under load. Rerun on their own, 15 still fail the same way onmainin my container. Two failures were caused by this change and are now fixed:test_kill_process_by_port.py::test_lemonade_port_stop_propagates_exit_statustested the removedlemonade-serverpath (deleted;test_kill_lemonade.pycovers the same exit codes), and the process-safety ratchet neededcli.py's untimed-subprocess count lowered from 3 to 2.With
main'scli.py, all eight kill tests fail (the old code ranlemonade-serverin every case), and the widened guard reports what the old one missed:Evidence
gaia kill --lemonaderun frommainand from this branch, with a stand-in HTTP server on port 8123 andlsofinstalled:The stand-in is a Python HTTP server, so it is refused. (Since this capture,
--lemonaderefuses any listener not identified as Lemonade, not just non-interpreter ones, and the message says it may be your own program.) The point is that it now looks at port 8123 at all. GAIA's own server isn't installed in my container, so that path is covered by the unit tests, not a live run.gaia kill --lemonade, above.Checklist
Closes #N/Fixes #N/Refs #N).python util/lint.py --all,pytest tests/unit/).gaia killtable in the CLI reference.