Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): t3 service restart no longer calls an installed service not installed #45014

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/45014/headmerged by juliusmarminge View on GitHub

Problem

When the installed service unit names a T3 home that T3 Code can't read, t3 service restart skips the restart and prints "T3 Code service is not installed." A service is installed. The message sends people to t3 service install, which rewrites the unit.

One real way to get there: edit the unit with systemctl --user edit --full and quote the whole assignment, Environment="T3CODE_HOME=/path". That's systemd's documented form, and systemd still runs the service with the right home, but T3 Code's unit parser doesn't read it.

Change

When restart skips and the status read says a unit is installed but names no home, it now says so and points at the unit file:

A T3 Code service definition was found, but its T3 home could not be determined, so it was not restarted. Check ~/.config/systemd/user/t3code.service.

It still says "not installed" when there's no unit. The other-home case from #29848 is already on main (status.otherBaseDir), so this carries the remaining piece from that PR.

Scope

Supersedes #29848 by @saphid (rebased onto current main, which already has the other-home message), keeping the unknown-home fix from its second commit. Both are credited as co-authors.

Verification

On a fresh Ubuntu 24.04 VM with a real per-user systemd service, commit 3b20b6b2000:

  1. t3 service install --base-dir ~/t3-proof-home, service active.
  2. systemctl --user edit --full t3code.service, quoting the assignment to Environment="T3CODE_HOME=/home/user/t3-proof-home". After a restart, systemctl --user show -p Environment still shows T3CODE_HOME=/home/user/t3-proof-home.
  3. t3 service restart --base-dir ~/t3-proof-home:
# origin/main 29886e21597
T3 Code service is not installed.

# this branch
A T3 Code service definition was found, but its T3 home could not be determined, so it was not restarted. Check /home/user/.config/systemd/user/t3code.service.

In both runs, the service's MainPID and start time were unchanged, so the service was not restarted, as before.

  • vp test run apps/server/src/cli/service.test.ts: the new case fails on main (restart says a service whose home it cannot determine was not restarted) and 19/19 pass on this branch.
  • vp run check:changed passes.

Not shown: launchd on macOS. The message change is platform-neutral, but I only installed a real systemd unit.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

    1. Pushed4bd0055

    2. Evidence

      Ran both built CLIs against a real, isolated Linux systemd user service. Installed t3@0.1.13, confirmed baseline restart, quoted the entire T3CODE_HOME assignment, reloaded/restarted through systemd, then ran CLI restart and status. Systemd accepted the assignment and reported the service active. The restart timestamp remained unchanged on both sides.

      BeforeAfter
      8844a69bc84bd0055244
      Before: active service incorrectly reported as not installedAfter: found definition, unknown home, skipped restart, and unit path
      Before recordingAfter recording
      Before transcriptAfter transcript

      Images and videos render actual timestamped subprocess output; private paths are anonymized. Reproduction driver · Capture renderer

    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged thised54785

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.