Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): t3 service restart no longer says another home's service is not installed #29848

Closedsaphid(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/29848/headopened View on GitHub

Problem

The background service unit is per user, but each unit serves one T3 home. When t3 service restart runs with a different home than the one the service was installed for (another --base-dir, or a different T3CODE_HOME), BootService.restart correctly skips the restart. The command then prints "T3 Code service is not installed." That's wrong: a service is installed, it just belongs to another home.

The message also points the user the wrong way. Someone told "not installed" will usually run t3 service install next, and on current main that rewrites the per-user unit onto the wrong home (the empty-home problem in #23858).

Change

When restart returns "skipped" and the status read just before it says a unit is installed, t3 service restart now prints the message t3 up already uses for the same outcome: "The installed service runs another T3 home, so it was not restarted. Pass its --base-dir." It still prints "not installed" when no unit exists. The exit code is unchanged, the same as the t3 up sibling.

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: one command printed a false state for an outcome its sibling (t3 up) already reports correctly. The fix changes 3 lines in service.ts and adds one table test.

Overlap search: the local PR index plus REST searches for "service restart", "runs another T3 home", and "service is not installed". The closest match is open #23878, which handles another home's service in t3 service status and t3 service install. It doesn't touch t3 service restart (I checked its service.ts patch). #14361, #25924, #28565, and #25237 change how restart works, not this message.

Verification

  • Red on main: vp test run src/cli/service.test.ts → restart explains why it skipped another home's service: Expected: "runs another T3 home", Received: "T3 Code service is not installed."
  • Green: vp test run src/cli/service.test.ts → 10 passed (10), rerun after rebasing onto the latest main.
  • CI=true vp run check:changed: format, lint, knip, typecheck, and tests all pass.
  • Not checked: a real systemd or launchd unit installed for a second home. The test stubs BootService the same way the existing service command tests do.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.

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

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 6add279

      Macroscope's review found this PR approvable — The CLI now explains when an installed service's T3 home cannot be determined instead of saying no service is installed. Only the diagnostic text changes; restart behavior and service protections remain unchanged.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The service restart command now distinguishes an installed service with an unknown T3 home from a service that is not installed. Tests check the reported messages for these cases and for a service associated with another T3 home.

      Changes: Restart messaging

      Layer / File(s)Summary
      Handle skipped restart outcomes
      apps/server/src/cli/service.ts, apps/server/src/cli/service.test.ts
      The command reports a distinct message when an installed service has an unknown T3 home. The not-installed message remains for a service that is not installed. Tests cover these cases and a service associated with another T3 home.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Possibly related issues

      • Issue 23858 describes the foreign---base-dir restart condition. This change updates the restart message for that condition; the issue’s separate service install and service status problems are not addressed.

      Suggested reviewers: rookmate, juliusmarminge

      Merge Risk: Minimal · up to 6add2

      The restart message now distinguishes an unknown installed home from no installed service. No actionable merge-blocking risk is established; normal checks remain appropriate.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the fix and its scope: the t3 service restart command no longer reports that another home's service is not installed. The raw summary and objectives confirm that the service.ts change …
      Description checkPassedThe description follows the template sections: Problem, Change, Scope and approval, and Verification. The Problem section gives the expected and actual behavior. The Change section explains the new "s…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the fix and its scope: the t3 service restart command no longer reports that another home's service is not installed. The raw summary and objectives confirm that the service.ts change and the test change both target this message when restart is skipped for an installed unit that belongs to another home. The title is specific and matches the main change, so it passes.

      Full details: Description check

      Explanation

      The description follows the template sections: Problem, Change, Scope and approval, and Verification. The Problem section gives the expected and actual behavior. The Change section explains the new "skipped" branch and the message, and it says that the exit code is unchanged. The Scope and approval section explains why no prior issue exists, which the template allows for a very small, focused fix of an obvious bug. It also lists overlap searches. The Verification section gives a red-then-green test run, a check run, and what was not checked. The template's optional agent-attribution line is present. The description is complete and specific, so it passes.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Tip

      🎯 Customize your risk assessments

      Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

      ✅ Automatic approvals, with your rules

      Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between a9c8ec835ff2460841ae83e46b07f668490a38bc and 6add279002ded5971ee31d33ae5bd8df30351ffe.

      Files selected for processing: 2

      • apps/server/src/cli/service.test.ts
      • apps/server/src/cli/service.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      • Fix comments: Fix CodeRabbit comments on this PR
    4. maria-rckscommented

      Note

      Written by gpt-6.1-sol on behalf of Maria

      Verified in a real dev environment

      reproduced on github/main 61c3794c32 in a separate installed worktree. installed a real Linux systemd user service through t3 service install --base-dir /home/user/service-home. restarting from another home printed "T3 Code service is not installed." while the unit remained active.

      on the original pr head, both --base-dir and T3CODE_HOME correctly reported another home. the unit hash, pid, and start timestamp stayed unchanged. a neighboring case exposed the existing review finding: a unit without readable T3CODE_HOME incorrectly recommended passing --base-dir. fixed in a9c8ec835f, with a failing-then-passing row in the existing test table.

      re-verified the repaired cli against the real unit:

      • foreign home: correct message, exit 0, no service restart or unit rewrite.
      • unknown installed home: identifies the unreadable home and unit path, exit 0, no restart.
      • correct home: restart succeeds; systemd pid changes from 21223 to 30451.
      • no installed unit: still reports "not installed", exit 0.

      started one dev server at a time, using isolated data. used repo Playwright with system Chrome to add a real git project and create threads through the web client. real Codex gpt-6.1-sol turns completed on main and the repaired head. on the repaired head, the provider ran the actual restart cli, read README.md, and returned the expected output. reloading the client retained the conversation.

      vp run check:changed e0f69e9ea4cb550cb8a395ccc8096d387783b577 passed through blacksmith: formatting, lint, knip, graphql, affected typechecks, and 12 tests. new-head GitHub CI was pending when this evidence was recorded.

      command transcript

      real Codex turn returns the foreign-home restart message

      real web client and Codex execute the restart command

      Not verified

      macOS launchd, Windows, native desktop and iOS/Android clients, relay/tunnel connections, and a restart queued from inside the installed service were not exercised on this Linux VM. the installed service runtime is the released t3@0.1.6; the restart commands and dev web/server came from the checked-out source. other providers were not exercised because this change is in the provider-independent cli message.

    5. Wladefant(GitHub profile, opens in a new tab) approved these changes

      Independent bounded source review — APPROVED for this CLI diagnostic-only delta, exact head 6add279002ded5971ee31d33ae5bd8df30351ffe into base 33f85846be8bc4bc592f0e621d6f0313e5abd4a4 (not an approval of any running service action). The apps/server/src/cli/service.ts three-line change distinguishes a real missing service from the BootService.restart() === "skipped" case where an installed per-user unit has an unknown home, and retains the distinct known-foreign-home branch without invoking install/restart to reconcile it. The original-author test table in apps/server/src/cli/service.test.ts asserts known-other-home, installed-unknown-home and absent-unit messages under a skipped restart. The previous CodeRabbit unknown-home finding was answered by existing author delta and corroborated in thread; no additional P1/P2 established by this source pass.

      Observed normal CI evidence: CI #42342141738 SUCCESS. Actual Test Server 3 job #128311945864 checked out generated merge 6d0a608 = this head merged into recorded base, and executed the directly changed src/cli/service.test.ts suite 16/16 passed. Other eight server test jobs, Lint, Build/Typecheck and aggregate Check succeeded; Test Web, Rust, Mobile Native Static Analysis and Release Smoke were SKIPPED (not passes). This source review does not establish the requested Windows/macOS native service-unit outcomes, host selection, production service restart, installer pin/version, deployment or Fleet #1798 acceptance. The author also reports isolated Linux systemd proof; I did not run that host or touch any service. Original author retains branch; do not merge solely on this review without project protections/landing custody.

    6. tanstack-source added labelsbug

    7. juliusmarminge added labelstakeover:in-progress

    8. The automated pipeline stopped on this pull request and will not merge it:

      someone else pushed to fix/service-restart-other-home (head is now 6add279002); the pipeline does not build on commits it did not review

      It stays open for a person to finish or close.

    9. juliusmarminge added labelstakeover:blocked

    10. juliusmarminge removed labelstakeover:in-progress

    11. juliusmarminge added labelstakeover:in-progress

    12. juliusmarminge removed labelstakeover:blocked

    13. juliusmarminge added labelstakeover:blocked

    14. juliusmarminge removed labelstakeover:in-progress

    15. juliusmarminge added labelstakeover:in-progress

    16. juliusmarminge removed labelstakeover:blocked

    17. juliusmarminge added labelstakeover:blocked

    18. juliusmarminge removed labelstakeover:in-progress

    19. Thanks for this. Main has the change since #45014.

      Compared the full two-file diff with main: restart already explains when the service belongs to another T3 home, and this merge adds the remaining installed-but-unknown-home message with the unit file path while preserving the no-service message. Main now covers all three skipped-restart outcomes addressed by this PR.

      Closing as superseded.

    20. juliusmarminge closed this

Sign in to join this conversation.