Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

I2131

A server in use through the Cockpit or HTTP is not stopped as idle, and a checkout keeps one address

Where it stands

devtask.issue
Readiness
complete completion is recorded and every required evidence token is present
Status
DONE
Can start
not now
Milestone
Milestone status
ACTIVE
Wave
0
Waiting on
none
Holds back
Behind it in all
1
Evidence
1 of 1
A move writes the repository: it stamps one field of this issue's record and appends one event to the ledger, and a commit will carry both.
The same moves from a terminal

majordomus plan start I2131

majordomus plan verify I2131

majordomus plan done I2131

What it is

Objective
Count every surface's use toward the idle timeout, and bind a port derived from the checkout's identity before falling back to a random one.
Why
'Attached' means MCP HTTP sessions only (apps/majordomus-cli/src/shared.rs:250-253), and the serve --idle loop stops after 900 s without one (apps/majordomus-cli/src/commands/serve.rs:128-146). A person using only the Cockpit, REST or the /events WebSocket is not counted, so a UI-first server stops 15 minutes into being viewed. The default port 8741 (apps/majordomus-cli/src/cli.rs:3301) goes to one checkout and every other one falls back to a random port (apps/majordomus-cli/src/http/server.rs:77-86): on 2026-10-09 the live server asked for 8741 and serves 61068, an address that changes on every restart, so a Streamable HTTP client configuration or a bookmarked Cockpit has nothing stable to name. docs/MCP.md:29 shows :8741 as if it were the norm. There is no majordomus ui command; serve ensure and env enter are the UI-first entries (apps/majordomus-cli/src/commands/serve.rs:481-576, apps/majordomus-cli/src/commands/env.rs:701-760) and work without stdio (case 190_entry_is_automatic.sh). Baseline audit of 2026-10-09 at master 1fb8d6be44, lifecycle gap 9 and drift 10.
Now
A server with no MCP session stops at its idle timeout whatever else uses it. Every checkout but one serves on a random port.
Wanted
The idle timer counts as use an MCP session attached, an HTTP request answered within the last second (http::server::used_within) and an open /events channel, so the Cockpit, the REST API and a watched execution keep their server. The deferred part, a port derived from the repository and worktree identity, is I2702; whether an entry beyond serve ensure is needed is decided by ADR 0135 and planned as I2484.
Done when
unknown: the record declares no `completion`
Risk
unknown: the record declares no `risk`

Acceptance

  • A server with an open /events WebSocket and no MCP session is still running after its idle timeout, and stops within one timeout of the socket closing
Validation
bin/majordomus plan validatecargo test --test serve_lifecycleMJ_TEST_JOBS=4 bash test/run.sh 190_entry_is_automatic
Evidence required
ui_use_keeps_server_alive_test
Evidence present
ui_use_keeps_server_alive_test

Scope

Touches
apps/majordomus-cli/src/shared.rsapps/majordomus-cli/src/commands/serve.rsapps/majordomus-cli/src/http/server.rsapps/majordomus-cli/src/http/events.rsapps/majordomus-cli/src/cli.rsapps/majordomus-cli/tests/serve_lifecycle.rsdocs/MCP.mddocs/COCKPIT.md
Not
Adding a majordomus ui command before this issue's record decides one is needed.
Depends on
none
Priority
p1
Profile
implementation
Parallel safe
false
Owner
unknown: the record declares no `owner`

The work so far

Branches
none
Merged
none
Commits
0
Trunk
master
Sessions
none
Created
2026-10-09
Updated
2026-10-14T12:16:31Z
Started
2026-10-14T12:15:51Z
Verified
unknown: the record declares no `verified_at`
Completed
2026-10-14T12:16:31Z

Synchronisation

Adapter
scripts/github-sync
Repository
unknown: the derived plan's header carries no repository
External issue
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it
State there
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it

Findings

Nothing is wrong with these records.