chore(server): keep the legacy service entry point to the npm package only #11770
main fromrefs/pull/11770/head·merged by juliusmarminge View on GitHubWhat 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.mjsin thet3npm 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 newt3, 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:
ensureLegacyEntryinpinnedRuntime.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 fakenode_modules/t3/distin 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, andbuild-npm-platform-packages.test.ts(which exercisesdist/bin.mjsfrom the built tarball): 10 pass.- Typecheck clean for
apps/server,packages/shared, andscripts; knip clean.
Claude Fable 5 via Claude Code.
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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 13.6 KiB 13.5 KiB −5 B (−0.0%) 15.1 KiB ✅ Codex Thread snapshot wire 7.0 KiB 7.0 KiB +2 B (+0.0%) 7.3 KiB ✅ Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB −7 B (−0.1%) 7.8 KiB ✅ Codex Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅ Codex Live turn messages 8 8 0 (0.0%) 21 ✅ Claude Total thread wire 13.6 KiB 13.6 KiB −6 B (−0.0%) 15.1 KiB ✅ Claude Thread snapshot wire 7.0 KiB 7.1 KiB +6 B (+0.1%) 7.3 KiB ✅ Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB −12 B (−0.2%) 7.8 KiB ✅ Claude Live turn WebSocket decoded 57.8 KiB 57.8 KiB 0 B (0.0%) 66.4 KiB ✅ Claude Live turn messages 9 9 0 (0.0%) 21 ✅ Baseline:
9130d93· PR result:7ac4061· Source CI: successScenario 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.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved at
7ac4061Macroscope'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).juliusmarminge merged thisf328db3
juliusmarminge closed this
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.mjschecks fornode_modules/t3/dist/bin.mjsplus.install-complete. The active0.0.41-nightly.20260914.1722runtime had that compatibility entry point. The prepared0.0.41-nightly.20260915.1752runtime had a workingt3executable 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:
- Keep an npm-era background service launcher installed.
- Update remotely through a version that preserves the archive compatibility entry point. This machine successfully reached
0.0.41-nightly.20260914.1722. - From Desktop, update that server to
0.0.41-nightly.20260915.1752. - 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 commit50ff4c371eab927a9650c114975241999f4cd7b1).Environment#
Linux x64, kernel
6.12.107+deb13-amd64, systemd user service. Old launcher used Node24.21.0; triage CLI was invoked using Node26.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 -> presentRelated issues#
#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 installThe command succeeded. Verified that systemd now runs the target executable with
__service-launcher, the service is active,service-state.jsonselects0.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.
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.tsapps/server/src/cloud/pinnedRuntime.tspackages/shared/src/legacyCliLauncher.test.tspackages/shared/src/legacyCliLauncher.tsscripts/build-npm-platform-packages.ts💤 Files with no reviewable changes (1)
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
packages/shared/src/legacyCliLauncher.ts,packages/shared/src/legacyCliLauncher.test.ts,scripts/build-npm-platform-packages.tslegacyCliLauncherScript()no longer accepts a distribution. It always resolves the platform executable from the sibling npm package. Tests and package generation use the updated call.apps/server/src/cloud/pinnedRuntime.ts,apps/server/src/cloud/pinnedRuntime.test.tsPriority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Suggested reviewers:
t3dotggMerge Risk: ⚪ Minimal · up to
7ac40The compatibility launcher and pinned-runtime validation changes are ready to merge.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.