Skip to content
Source
Sign inSign up
pingdotgg/t3code

chore(server): keep the legacy service entry point to the npm package only #11770

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/11770/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

What changes

Follow-up to #11732, which fixed a real regression: a boot-service launcher installed before the executable runs node <versions>/<v>/node_modules/t3/dist/bin.mjs, and #11607 had removed that file from the t3 npm package, so every fleet update from a pre-1700 nightly failed after a successful install.

That PR fixed it in two places. This keeps one and removes the other:

  • Kept: dist/bin.mjs in the t3 npm package, a forwarder to the platform executable that preserves arguments, stdio, the launcher's IPC channel, signals, and exit status. This is the transition an old launcher actually goes through: it npm-installs the new t3, runs the old path, the executable starts, and the first server started this way rewrites the service unit to run the executable directly. After that nothing touches the file. The doc comment now says when to delete it (after the first stable release with the executable).
  • Removed: ensureLegacyEntry in pinnedRuntime.ts, which wrote the same shim into every archive install, including cached ones on every status check, so an old launcher could start an archive-layout version through the old path. An old launcher never installs an archive (it predates archive installs), so that case does not occur, and it left a permanent fake node_modules/t3/dist in the runtime layout plus a write to cached installs on read. The "archive" variant of the script and its two tests go with it.

Net: 25 insertions, 92 deletions; legacyCliLauncherScript has no parameter now.

Verification

  • legacyCliLauncher.test.ts (IPC, args, termination through the npm shim), pinnedRuntime.test.ts, and build-npm-platform-packages.test.ts (which exercises dist/bin.mjs from the built tarball): 10 pass.
  • Typecheck clean for apps/server, packages/shared, and scripts; knip clean.

Claude Fable 5 via Claude Code.


Devin Review

Summary by CodeRabbit

  • Changes
    • Simplified runtime installation and validation for greater consistency across published runtimes.
    • Updated the command-line launcher to use platform-specific packages directly.
    • Removed support for launching legacy archive-based runtimes and related compatibility behavior.
    • Updated launcher documentation to clarify its compatibility role and planned future removal.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Team

      Run ID: 77be07d1-ed93-4b53-9275-b8f8409c4145

      📥 Commits

      Reviewing files that changed from the base of the PR and between 9130d932f4ddb8abab595b7d12553b46a11c7b22 and 7ac4061dc86ac502c3616271de19e0d640cafd36.

      📒 Files selected for processing (5)
      • apps/server/src/cloud/pinnedRuntime.test.ts
      • apps/server/src/cloud/pinnedRuntime.ts
      • packages/shared/src/legacyCliLauncher.test.ts
      • packages/shared/src/legacyCliLauncher.ts
      • scripts/build-npm-platform-packages.ts
      💤 Files with no reviewable changes (1)
      • apps/server/src/cloud/pinnedRuntime.test.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


      📝 Walkthrough

      Walkthrough

      The compatibility launcher now resolves executables from platform npm packages only. Pinned runtime installation and publication no longer create legacy entry points before validation. Tests were updated to remove archive-launch and cached-archive coverage.

      Changes

      Launcher and pinned runtime changes

      Layer / File(s)Summary
      Platform launcher contract
      packages/shared/src/legacyCliLauncher.ts, packages/shared/src/legacyCliLauncher.test.ts, scripts/build-npm-platform-packages.ts
      legacyCliLauncherScript() no longer accepts a distribution. It always resolves the platform executable from the sibling npm package. Tests and package generation use the updated call.
      Pinned runtime validation
      apps/server/src/cloud/pinnedRuntime.ts, apps/server/src/cloud/pinnedRuntime.test.ts
      Pinned runtime installation and concurrent publication validate runtimes without generating legacy npm service entry points. Tests for archive launching and cached-archive reuse were removed.

      Priority: ⬇️ Low

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Refactor

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to 7ac40

      The compatibility launcher and pinned-runtime validation changes are ready to merge.

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly describes the main change: retaining the legacy service entry point only in the npm package.
      Description check✅ PassedThe description explains what changed, why the archive shim was removed, the compatibility behavior that remains, and the verification performed. It does not use the exact template headings for Why or…
      Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files.
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `chore/trim-legacy-entry`

      Comment `@coderabbitai help` to get the list of available commands.
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.6 KiB13.5 KiB−5 B (−0.0%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB+2 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.5 KiB−7 B (−0.1%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages880 (0.0%)21✅
      ClaudeTotal thread wire13.6 KiB13.6 KiB−6 B (−0.0%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.1 KiB+6 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB−12 B (−0.2%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages990 (0.0%)21✅

      Baseline: 9130d93 · PR result: 7ac4061 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.9 KiB
      • Claude decoded thread snapshot: 114.6 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. Approvability

      Verdict: Approved at 7ac4061

      Macroscope's review found this PR approvable — This is a focused compatibility cleanup that retains and tests the legacy npm launcher while removing unused archive-layout shim generation and cached-runtime writes. Existing service startup remains on the pinned executable path, with no schema, security, billing, or deployment changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge merged thisf328db3

    6. juliusmarminge closed this

    7. What happened

      A server update initiated from T3 Desktop on a MacBook failed twice with:

      Server update failed: The requested target runtime is missing or incomplete.

      Desktop was connected to both its local server and a remote Linux server. The matching failures were recorded by the Linux background service.

      Diagnosis

      This machine demonstrates the archive compatibility case removed in #11770. At the time of failure, its old service launcher was still running, while its server child had already moved to an archive runtime.

      The old runtime/service-launcher.mjs checks for node_modules/t3/dist/bin.mjs plus .install-complete. The active 0.0.41-nightly.20260914.1722 runtime had that compatibility entry point. The prepared 0.0.41-nightly.20260915.1752 runtime had a working t3 executable and the correct completion marker, but lacked the old entry point. The launcher therefore rejected it before activation.

      The launcher was the same Node process started September 11. The archive download is performed by the newer server child, so an old launcher can encounter an archive installed by a subsequent server version. Both use launcher protocol 2; the target's preflight does not detect this layout incompatibility.

      Steps to reproduce

      Observed upgrade sequence, inferred from the installed files and service logs; the remote failure was not deliberately reproduced during triage:

      1. Keep an npm-era background service launcher installed.
      2. Update remotely through a version that preserves the archive compatibility entry point. This machine successfully reached 0.0.41-nightly.20260914.1722.
      3. From Desktop, update that server to 0.0.41-nightly.20260915.1752.
      4. The new server updater stages the archive without the compatibility entry point; the old launcher rejects it. Retrying produces the same error.

      Version

      Server at failure: 0.0.41-nightly.20260914.1722. Failed target and triage CLI: 0.0.41-nightly.20260915.1752 (source commit 50ff4c371eab927a9650c114975241999f4cd7b1).

      Environment

      Linux x64, kernel 6.12.107+deb13-amd64, systemd user service. Old launcher used Node 24.21.0; triage CLI was invoked using Node 26.8.2. Client: T3 Desktop on a MacBook; macOS and Desktop versions were not collected.

      Evidence

      2026-09-15 10:51:57 UTC: server.updateServerWithProgress -> ServiceLauncherRejectedError
      2026-09-15 10:52:17 UTC: server.updateServerWithProgress -> ServiceLauncherRejectedError
      Reason: The requested target runtime is missing or incomplete.
      
      Target runtime 0.0.41-nightly.20260915.1752:
        t3 --version                         -> t3 v0.0.41-nightly.20260915.1752
        .install-complete                     -> matches target version
        node_modules/t3/dist/bin.mjs          -> absent
      
      Active runtime 0.0.41-nightly.20260914.1722:
        node_modules/t3/dist/bin.mjs          -> present

      #11732 originally covered subsequent archive updates under an older launcher. #11770 removed that coverage and archive entry point. Posting here to provide the concrete installed state that contradicts the removal's assumption. No separate matching bug report or newer fix was found in the searches performed.

      Fix applied or workaround

      With the user's approval, repaired the Linux service using:

      npx t3@0.0.41-nightly.20260915.1752 service install

      The command succeeded. Verified that systemd now runs the target executable with __service-launcher, the service is active, service-state.json selects 0.0.41-nightly.20260915.1752, and the local HTTP endpoint returns 200. Desktop reconnection and a subsequent remote upgrade were not tested.

      Filed by

      Prepared by Codex (GPT-6) via t3 triage.

Sign in to join this conversation.