Repository navigation
feat(api): Marlin machine-control surface on the sidecar (#190, #199) - #260
Merged
Merged
Conversation
The sidecar now owns the serial port via marlin-host. New /machine routes:
ports, connection (connect/disconnect), commands (manual), jobs (start +
polled GET /jobs/{id}?since= cursor + pause/resume/cancel), and estop.
A MachineService singleton holds a MarlinHost and runs a background job
worker; a lock serializes manual commands against the streaming job, and
emergency_stop() writes M112 out-of-band bypassing the lock (#196).
Depends on marlin-host[serial]>=0.2.1 (its io lock makes send/stream
mutually thread-safe; py.typed lets mypy check the integration). OpenAPI
spec + generated TS client regenerated. Backend gate green (ruff/mypy/
129 tests); /machine validated end-to-end against a real RAMPS board.
Does not yet wire the GUI (still on the stdio subprocess) or remove the
old execution/marlin.py — those are later cutover slices. Part of #195.
The sidecar now owns the serial port, so the frozen binary needs the machine route, marlin_host, and pyserial's dynamically-imported platform backend (serialposix/serialwin32 + list_ports) — mirroring the existing serial collection in freeze_cli.py.
This was referenced Jun 28, 2026
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.
First backend slice of the machine cutover (epic #195): the API sidecar now owns the serial port via the published
marlin-hostlibrary, replacing the bespoke streamer for the API path.New
/machineroutesGET /ports,POST|DELETE /connection,POST /commands,POST /jobs,GET /jobs/{id}?since=(polled cursor),POST /jobs/{id}/pause|resume|cancel,POST /estop.A
MachineServicesingleton holds aMarlinHostand runs a background job worker; a lock serializes manual/commandsagainst the streaming job;/estopwrites M112 out-of-band bypassing the lock (#196).Dependency
marlin-host[serial]>=0.2.1— its io lock makessend/query/streammutually thread-safe (closes a paused-manual-send race), andpy.typedlets mypy type-check the integration (the override is gone).Validation
/machinetests, hardware-free viaFakeTransport).Scope
Additive — does not yet wire the GUI (still on the stdio subprocess) or delete
execution/marlin.py(still used byinteractive.py). Those are the later cutover slices (#193/#194 GUI, then the deletes). Implements the backend of #190/#199.