Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): t3 update no longer says a service awaiting restart runs the new version #29901

Mergedsaphid(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/29901/headmerged by maria-rcks View on GitHub

Problem

When t3 update points the background service at a new version without restarting it (no terminal and no --yes, or the restart prompt was declined), the service is left "restart pending": its state already names the new version, but the process still runs the old one. Running t3 update again in that state, and again not restarting, ended with a line that contradicts itself:

Background service still running 0.1.6. Run `t3 service restart` when you are ready to switch it to 0.1.6.

The service is not running 0.1.6; it runs the version before it. The same applies when moving on to a newer release: the line names the version the service is set up to start, not the one it runs. The heading of the same command already says "The background service is still running the version before 0.1.6" for this state.

Change

runUpdate already computes restartPending. The final summary now uses it: with a pending restart it says "still running the version before X", matching the heading. An unknown version still prints "an unknown version", and every other case is unchanged.

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: one message in apps/server/src/cli/update.ts (7 non-test lines) contradicted the state the same command reports a few lines earlier. No behavior other than the printed text changes.

Overlap search: local PR index and GitHub search for "still running", restart-pending and t3 update messages. Closest open PRs that touch update or the service (#28565, #19652, #14875, #17586, #22773, #25439, #23173, #25633) do not change this line. #29684 (t3 pair hint and --base-dir) and the home-mismatch guards (#29848, #29872, #23878) are separate problems.

Verification

  • Red on main, through runUpdate with a stubbed service in the restart-pending state and no terminal: expected '…Background service still running 0.1.6. Run \t3 service restart` when you are ready to switch it to 0.1.6.' to include 'Background service still running the version before …'`
  • Green: cd apps/server && vp test run src/cli/update.test.ts: 17 passed.
  • vp run check:changed: format, lint, knip, graphql, typecheck (3 packages), tests (2 files) all pass.
  • Not checked: a real systemd or launchd service. The test stubs BootService, as the existing service CLI 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 c3dbe49

      Macroscope's review found this PR approvable — Updates the CLI message to distinguish a service awaiting restart from one already running the configured version. Service installation and restart behavior remain unchanged.

      Notes:

      • No code objects were reviewed. Approvability was decided on eligibility alone.
      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
      Review in Change Stack →

      No actionable comments were generated in the recent review.

      Walkthrough

      The update completion message now reports the version still running when a background service has a restart pending. A test checks the reported version and restart instruction.

      Changes: Service update messaging

      Layer / File(s)Summary
      Report the running version
      apps/server/src/cli/update.ts, apps/server/src/cli/update.test.ts
      When a restart is pending, the update message reports the version before serviceVersion. Otherwise, it reports serviceVersion or “an unknown version.” The test checks the running version and restart instruction.

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

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: Minimal · up to c3dbe

      The CLI message now accurately describes services awaiting restart, and the related test setup issue has been resolved.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the primary fix: correcting the t3 update message when a service is awaiting restart.
      Description checkPassedThe description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the reproduction, fix, scope rationale, test results, limitations, and tool usage.
      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.
      Finishing Touches
      Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Warning

      Some tools did not complete. Review the errors below.

      ast-grep (0.51.1)

      ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/typescript/security/regexp-non-literal-typescript.yml

      CodeRabbit Verify

      • Run CodeRabbit Verify to test the changes in this pull request.
      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 22eb7fa4002a3736aec436364b0813bdc77dc606 and c3dbe49b7640404842dd1894953638e39613284c.

      Files selected for processing: 1
      • apps/server/src/cli/update.test.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 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

      verified unchanged head 22eb7fa4002a3736aec436364b0813bdc77dc606 on linux with a real systemd user service and published runtimes, without mocks or service-state edits.

      • reproduced on github/main (61c3794c32b0): installed the 0.1.5 service, updated to 0.1.6 without restarting, then repeated the update. the summary incorrectly said Background service still running 0.1.6, while the live runtime reported 0.1.5.
      • ran the same cli flow from the exact pr head. it correctly said Background service still running the version before 0.1.6. the launcher pid (23555) and server pid (23618) stayed unchanged.
      • declined the interactive restart prompt: corrected summary, no restart. then used --yes: the service restarted, its live runtime reported 0.1.6, and a subsequent update said both were already current.
      • started main and pr dev servers separately with isolated homes. used the web app in google chrome through playwright to add the real repo as a project and complete real codex gpt-6.1-sol turns. the server's thread show confirms the pr thread completed with codex/gpt-6.1-sol.
      • remote blacksmith checks passed: all 17 update tests and vp run check:changed 61c3794c32b0eeebfac09add43e403618c65d2d7 (format, lint, knip, graphql, affected typechecks, 18 tests). the explicit base restores comparison history in the shallow worker.

      main/pr command transcript

      completed real codex gpt-6.1-sol turn on the pr

      real codex turn through the pr web client

      Not verified

      native desktop, ios/android, macos launchd, and windows service behavior were not exercised on this linux vm. the unknown-version fallback was not created artificially. the recording proves the web/provider path; the command transcript proves the changed cli message. no source changes were needed.

    5. maria-rcks merged this2b37449

    6. maria-rcks closed this

Sign in to join this conversation.