| … | … | @@ -193,6 +193,42 @@ export const resolveLauncherPath = Effect.gen(function* () { | |
| 210 | + | const platform = yield* HostProcessPlatform; | |
| 211 | + | const environment = yield* HostProcessEnvironment; | |
| 212 | + | const installBinDir = | |
| 213 | + | environment["T3CODE_INSTALL_BIN_DIR"] || | |
🟡 Medium cli/update.ts:213
A service self-update cannot find a launcher installed via T3CODE_INSTALL_BIN_DIR, so /opt/me/bin/t3 remains pinned to fromVersion. The generated systemd and launchd environments do not preserve T3CODE_INSTALL_BIN_DIR; this lookup therefore falls back to ~/.local/bin/t3 and the service PATH. Persist the configured bin directory in both service definitions or otherwise make it available to this lookup.
Also found in 1 other location(s)
apps/server/src/serverRuntimeStartup.ts:600
Custom install locations are not available to the managed server. The installer accepts
T3CODE_INSTALL_BIN_DIR, but the generated systemd unit exports onlyT3CODE_HOMEand the launchd plist exports onlyPATH,T3CODE_HOME, and the unit marker; neither persistsT3CODE_INSTALL_BIN_DIR(and systemd does not inherit the invoking shell's custom PATH). Thus after an install such asT3CODE_INSTALL_BIN_DIR=/opt/me/bin, a self-update reaches this new call without that variable and only probes~/.local/bin/t3/ the service PATH, leaving/opt/me/bin/t3on the old runtime. Persist the configured bin directory in the service environment or otherwise derive it here.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/server/src/cli/update.ts around line 213: |
| 2 | |
| 3 | A service self-update cannot find a launcher installed via `T3CODE_INSTALL_BIN_DIR`, so `/opt/me/bin/t3` remains pinned to `fromVersion`. The generated systemd and launchd environments do not preserve `T3CODE_INSTALL_BIN_DIR`; this lookup therefore falls back to `~/.local/bin/t3` and the service `PATH`. Persist the configured bin directory in both service definitions or otherwise make it available to this lookup. |
| 4 | |
| 5 | Also found in 1 other location(s): |
| 6 | - apps/server/src/serverRuntimeStartup.ts:600 -- Custom install locations are not available to the managed server. The installer accepts `T3CODE_INSTALL_BIN_DIR`, but the generated systemd unit exports only `T3CODE_HOME` and the launchd plist exports only `PATH`, `T3CODE_HOME`, and the unit marker; neither persists `T3CODE_INSTALL_BIN_DIR` (and systemd does not inherit the invoking shell's custom PATH). Thus after an install such as `T3CODE_INSTALL_BIN_DIR=/opt/me/bin`, a self-update reaches this new call without that variable and only probes `~/.local/bin/t3` / the service PATH, leaving `/opt/me/bin/t3` on the old runtime. Persist the configured bin directory in the service environment or otherwise derive it here. |
Right, that's a real gap, but it's out of scope here on purpose. The triage on #14609 says the systemd and launchd units should stay on the local t3 service install path, so this PR doesn't change what the units export. What it covers: ~/.local/bin on both platforms, and a custom bin dir on launchd, since the plist copies the installer's PATH. A custom T3CODE_INSTALL_BIN_DIR under systemd still needs t3 update, same as before this change. I've noted that in the PR description. If maintainers want the unit to carry the bin dir, I'd do that as a separate PR.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.
Fixed in 14699c5008. Local service installs now persist T3CODE_INSTALL_BIN_DIR in both systemd and launchd definitions. Status and later reinstalls/updates preserve the installed value when an ordinary CLI invocation omits it; an explicit nonempty replacement wins. Both platform behavior tests cover that lifecycle, including escaping. Existing custom units that never stored the directory need a local T3CODE_INSTALL_BIN_DIR=/custom/bin t3 service install; remote self-updates never rewrite units. All 79 focused tests, server typecheck and scoped checks pass, and the published-head real launcher IPC/filesystem proof is in the updated PR body.