Skip to content

feat(web): turn the boot service on and off from the Environments map - #33

Draft
mayberuk wants to merge 1 commit into
mainfrom
rucode-boot-service
Draft

mayberuk wants to merge 1 commit into
mainfrom
rucode-boot-service

Conversation

@mayberuk

@mayberuk mayberuk commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

A RuCode server started by hand stops when the machine restarts, and so do the agents running under it. The only way to install the boot service is the t3 service install command line.

Change

  • Each machine's details on the Settings → Environments map get a "Start RuCode when this machine boots" switch ("when you log in" on a Mac), and the app offers it once when it connects to a machine without it.
  • A server service installs the existing boot service and hands the running server over to it: the unit is enabled without starting, started once the old server process has exited, and keeps the same host and port. Turning it off disables start-up without uninstalling.
  • Each server publishes its boot-service status. Changing it needs the same permission as other maintenance actions.

Do not merge yet

High, unfixed: between the old server exiting and the boot service starting, a desktop app that reconnects over SSH can start its own server and take the data folder first, so the service never takes over (apps/server/src/cloud/bootService.ts). The fix would change the SSH or service launcher, which this change deliberately leaves alone.

Before merging, run these by hand:

  • Hand-over with a desktop SSH client reconnecting at the same time. If the race shows, the recommended fix is for the service launcher to claim the data folder first and wait for the old process.
  • A desktop app attaching to a server that the service now runs.
  • Remote launch against a Mac running the launch agent.

Scope

Requested by the maintainer of this fork.

Verification

  • Focused server and browser tests were added for the switch, the offer, the hand-over commands and the RPCs.
  • The final check run (changed-file checks and the unit suite) passed on this tree, with waived findings: the contract check on names the plan declares by reference, one ownership flag on a phase, and the medium map-selection point below.
  • Whole-branch review: round 1 found four high findings and one medium security finding. Three of the high ones and the security one were fixed; the fourth high is the race above. Round 2 reported no new critical, high or security findings.
  • Checked in the running app: the row sits with the other machine details in T3 Chat light and dark and Grove light. That was a development server, where the switch is disabled, so turning it on was not exercised in a running app.
  • Screenshots are not attached: there is no command-line way to upload them to the pull request without publishing them somewhere else.

Other open points

  • The offer shows only at medium width and wider, and below that width the switch cannot be reached.
  • The reason a switch failed is shown only in a tooltip.
  • The confirm dialog joins sentences with an ASCII space, which reads oddly in Japanese and Chinese.
  • Medium: the Environments map reads the machine link parameter only when it first appears, so if the map is already open, accepting the offer does not select that machine (apps/web/src/components/settings/EnvironmentsMap.tsx).
  • Opening the offer while the list view is selected may not switch to the map.
  • systemd older than 240 now fails visibly.
  • Two RPC test gaps: authorisation and forwarding in ws.ts.
  • A background-service component imports from the CLI's service.ts.

Built with Claude Code (Claude Sonnet and Opus models); review by Codex.

🤖 Generated with Claude Code

Adds the switch and a connect-time offer, a server control service that installs the boot service and hands the running server over, and a per-machine status.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant