Remove the lager-mcp console script and clean up the links it left on boxes - #254
Merged
Conversation
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.
Closes #242.
What was wrong
cli/setup.pydeclaredlager-mcp=lager.mcp.server:main.lagerlives underbox/and thewheel's top level is
cliand nothing else, so pip created the script and it died on first use.Demonstrated against a wheel built from current
main:pip does not validate entry-point targets at install time, which is why this shipped in every
release carrying the script and never failed a build. Installing the extra does not help either:
lager-cli[mcp]supplies the PyPImcpSDK, not thelagerpackage.Why removal rather than a wrapper
The issue offered three options; the deciding fact is that the console script was never how this
server runs. The box starts it in-container as
python3 -m lager.mcp(
box/lager/docker/start-services.sh:59) and serves it on port 8100, which is whatdocs/source/reference/mcp/overview.mdxdocuments and what clients connect to. Shippingbox/lager/mcp/into the wheel was the other option and is worse than it looks:main()needsuvicornandstarlette, neither declared anywhere, and the control tools pull in the entireNetstack.So there is no working behavior to preserve — only a script that has never done anything but
raise.
The part that affects deployed boxes
lager install/lager updatesymlinked the script into~/.local/bin(
cli/commands/utility/_host_cli.py). Boxes deployed from any ref carrying the entry point havea
~/.local/bin/lager-mcppointing at a script that cannot run, and simply not creating it goingforward would leave those boxes broken indefinitely. The install command now removes the link,
so they self-heal on the next deploy. Still best-effort (
|| true) — a missing link must not failan install.
Regression guard
#242 asks that the smoke be added once resolved so it cannot regress. Since the resolution is
removal, the guard asserts absence: the wheel smoke fails if
bin/lager-mcpreappears. Thatis the honest form of the check here — re-adding a console script whose target the wheel does not
ship would otherwise sail through again.
Verified in both directions by running the guard's condition against two real wheels: it fires on
a wheel built from current
main(script present) and passes on this branch's wheel.Verified
['lager'].bin/lager-mcpis absent;
lager --versionand--helpwork.mainproducesbin/lager-mcpand theModuleNotFoundErrorabove — thebefore/after is a real observation, not an inference.
cli/tests/test_host_cli.py: 41 passed. The oldtest_lager_mcp_symlink_is_guarded_and_best_effortis rewritten to assert the removal line(
rm -f, noln -sfn, still|| true) rather than the guarded symlink.unit (cli): 1224 passed, 2 xfailed — unchanged, sotest/COVERAGE.mdneeds no edit (a testwas rewritten, not added).
packaging.ymlparses as YAML and every embeddedrunblock passesbash -n.Left in place
The
mcpextra incli/setup.pystays —.github/workflows/unit-tests.ymlinstalls andexercises it, and it is independently useful.
docs/source/release-notes/v0.3.27.mdxstillmentions running
lager-mcp; historical release notes are a record of what was announced at thetime, and the CHANGELOG entry here supersedes it.
Note for whoever merges second
This adds a
## [Unreleased]CHANGELOG section, as do #249, #251 and #253. Whichever lands secondwants a trivial merge into one section. No other overlap — this touches
setup.py,_host_cli.py, its test, andpackaging.yml, none of which the others change.