Skip to content

[Bug]: Remote updates leave the service launcher pinned for good, and a macOS service install from inside the service leaves it unloaded #37705

Open

Description

@Nipsuli

On behalf of user by Claude Opus 5.5 (Claude Code)

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Install the background service with t3 service install (ours was on 0.1.4-nightly.20261028.3824, Oct 28).
  2. Update the server remotely from the app over the next few weeks ("Update everything"), up to 0.1.10-nightly.20261116.4787.
  3. Run t3 service status on the host, and look at the launcher process.

Expected behavior

A host that is only ever updated remotely ends up on a current launcher eventually, or at least the app says the launcher needs a repair.

Actual behavior

On all three of our hosts (two macOS launchd, one Linux systemd user unit), the unit still ran the Oct 28 launcher (0.1.4-nightly.20261028.3824/t3 __service-launcher) as the parent of a 0.1.10 t3 serve. In process monitors this looks like two T3 versions running, with an old one that "refuses to die": killing it does nothing because KeepAlive starts it again. The only sign was Status: needs an update or repair from t3 service status on the host. Nothing in the app showed it.

This is the remaining part of #34502. #34603 fixed the update failure, and its description says a protocol-3 launcher stays protocol 3 until a local t3 update or t3 service install. So far, then, the launcher never updates on a host that nobody opens a shell on.

A launchd handoff is possible. A comment on #34502 suggested that the server could run the staged runtime's service install itself, and noted that launchd has no handoff like systemd-run. We tested that on macOS 26.7.2 with a throwaway launch agent set up like T3's plist (KeepAlive, AbandonProcessGroup=false, ProcessType=Interactive, ExitTimeOut). A process inside the job tried to do what service install does: launchctl bootout --wait the job, point its plist at a new program, launchctl bootstrap it again.

How the install runs from inside the job Result
As a direct child (what bootService.ts does on launchd today) Killed by bootout. The job is left unloaded: the service stays down until the next login.
Double-fork + setsid Survives. The job comes back on the new program.
Separate one-shot job: launchctl bootstrap gui/$UID oneshot.plist (RunAtLoad, LaunchOnlyOnce) Survives. The job comes back on the new program.
Rewrite the plist on disk, then exit and let KeepAlive respawn Respawns the old program: launchd keeps using the definition it loaded.

What follows from this:

  1. A one-shot job bootstrapped into gui/$UID is the launchd equivalent of the systemd-run --user --collect handoff at bootService.ts:1305, which handles only systemd today. It needs a unique label and a bootout of that label afterwards, because LaunchOnlyOnce jobs stay loaded after they exit.
  2. Today, on launchd, runningInsideService doesn't change anything. service install runs manager.stop (L1332–1335), and going by our test, that kills the installer between bootout and bootstrap. That leaves the service unloaded, and on a host reached over SSH, nobody can see that. An agent running in a T3 thread on that host that runs t3 service install would cause this. We reproduced it with a stand-in job, not with T3 itself.
  3. Repointing the plist only takes effect after a real bootout and bootstrap, so "rewrite the unit and let it respawn" isn't enough on macOS.

We did not test the alternative of the launcher execing into the staged launcher in place.

Impact

Major degradation or frequent failure

Version or commit

Server 0.1.10-nightly.20261116.4787, launcher 0.1.4-nightly.20261028.3824, source references at c8c51af

Environment

macOS 26.7.2 and macOS 27.2 (arm64, launchd); Arch Linux / Omarchy, kernel 7.2 (systemd user unit). Updated remotely from the T3 Code app.

Workaround

On each host, run ~/.t3/runtime/versions/<current>/t3 service install. That rewrote the unit and restarted onto the current launcher. On the Linux host it also ended the agent sessions running there, as other commenters on #34502 saw.

Related issues

#34502, #34603, #17225 (each new versioned launcher path on macOS also needs new privacy approvals).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions