Skip to content

feat(console): start, stop and restart the local server from Connections - #317

Draft
Lyellr88 wants to merge 1 commit into
MARM-mainfrom
feat/console-server-controls
Draft

Lyellr88 wants to merge 1 commit into
MARM-mainfrom
feat/console-server-controls

Conversation

@Lyellr88

Copy link
Copy Markdown
Owner

Console Server Controls

The Connections tab can start, stop and restart the local managed MARM server, and shows bounded server logs inline. Opened as a draft: the backend is complete and tested, the UI layout is still being refined.

  • Start and Stop run as background jobs behind POST /api/connections/runtime/start and /stop, polled on the existing job route. Restart on a stopped server with a free port now starts it, so Save and apply works while the server is stopped.
  • Start is offered only when the intended port is free. A listener MARM did not launch is never stopped, and a port that cannot be checked disables Start instead of guessing.
  • Only one runtime job runs at a time. A different action while one is running returns 409.
  • GET /api/connections/runtime/logs tails runtime.log with a cursor that survives rotation, cuts on line boundaries and bounds line length. The same viewer replaces the Docker tab's log panel, capped at 2,000 lines and 256 KB.
  • Console-launched starts terminate their own child process and clear runtime.json if the server never becomes ready. marm-memory start keeps its existing timeout behavior.
  • Validation: 106 backend tests and 118 frontend tests in the touched areas pass, plus ruff, mypy and tsc. A real-socket test covers a free port, a stale state file, a non-MARM HTTP listener and a non-HTTP listener. The full server suite and a manual Start and Stop in a browser are still to run.

Reviewer note: no version bump. The changelog entry is marked unreleased, planned for v2.61.0.

🤖 Generated with Claude Code

Adds Start, Stop and Restart for the local managed server to the Connections status strip and Runtime card, plus a bounded inline log viewer shared with the Docker tab.

- POST /api/connections/runtime/start and /stop run as background jobs on the shared job route. Restart on a stopped server with a free port now starts it, so Save and apply works while stopped.
- port_owner() reports none, marm, other or unknown for the address the next start will use. Only a successful bind means free, and a listener MARM does not own is never stopped.
- JobRegistry rejects a different kind of runtime job while one runs, and the worker repeats the ownership guard before acting.
- GET /api/connections/runtime/logs tails runtime.log with an opaque cursor that detects rotation, cuts reads on line boundaries and bounds line length.
- Console-launched starts terminate their own child and clear state if readiness fails. CLI starts keep their existing timeout behavior.

Work in progress: the UI layout is still being reworked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Lyellr88 Lyellr88 added the enhancement New feature or request label Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

}
if isinstance(exc, runtime_control.NotManaged):
body["command"] = exc.command
return JSONResponse(status_code=409, content=body)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants