Repository navigation
Conversation
- 按环境变量、已安装服务配置和默认值解析远端 T3 目录,并让配对复用启动时的目录。 - 保留既有启动器状态和缓存路径;切换目录时保护旧托管进程,避免复用另一环境的端口。 - 补充真实 shell 脚本与服务配置回归测试;44 项针对性测试及 check:changed 通过。
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — SSH launch and pairing now automatically use the remote configured service home instead of always ~/.t3. A human must confirm this default environment-selection change, which determines the server and credential store used. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Resolve the SSH server home apps/server/src/cli/sshHelper.ts, apps/server/src/cloud/bootService.test.ts |
The helper resolves a nonblank T3CODE_HOME or the home from the platform service file. The home-dir subcommand prints the resolved path. Tests cover service-home fallback and T3CODE_HOME precedence. |
Use the resolved home during launch packages/ssh/src/tunnel.ts, packages/ssh/src/tunnel.test.ts |
The launcher derives the runtime file from the resolved home and records that home in state. It clears remembered server state when the home changes, rejects a live previously managed server at a different home, and handles zombie processes and readiness failures. Tests cover service reuse and managed launch behavior. |
Use the recorded home for pairing packages/ssh/src/tunnel.ts, packages/ssh/src/tunnel.test.ts |
Pairing uses the stored server home, or resolves it through the runner when none is stored. Tests cover a configured home and a home recorded in SSH state. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant SSHLauncher
participant InstalledRunner
participant HomeResolver
participant ServiceConfiguration
participant RuntimeFile
SSHLauncher->>InstalledRunner: invoke home-dir
InstalledRunner->>HomeResolver: resolve server home
opt T3CODE_HOME is blank
HomeResolver->>ServiceConfiguration: read configured home
ServiceConfiguration-->>HomeResolver: return configured home
end
HomeResolver-->>InstalledRunner: return resolved home
InstalledRunner-->>SSHLauncher: print resolved home
SSHLauncher->>RuntimeFile: inspect runtime state under resolved home
Possibly related issues
pingdotgg/t3code#23858— The PR resolves the SSH home from installed service configuration, which overlaps the issue’s custom-base-directory objective.
Suggested reviewers: t3dotgg
Merge Risk: 
Minimal · up to 7ec6e
-
No concrete issue remains that needs resolution before merging; proceed with normal checks.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description is complete and relevant. It explains the problem, the resolution, scope, linked issue and maintainer triage, verification results, test limitations, and tool usage. It uses “Fix” instead of the template’s “Change” heading and does not include a separate “Scope and approval” heading, but it provides the required information in other sections.
Full details: Linked Issues check
-
Explanation
Issue [
#17039] is directly linked and active.resolveSshServerHomeuses nonblankT3CODE_HOME, then the installed systemd unit or launchd plist, then the default home. SSH discovery andserve --base-diruse the selected home. Launch persistsserver-home, and pairing uses that value. The launch logic rejects a live legacy managed server in another home without stopping its process or runner. It does not reuse an old-home port when the selected service is unavailable. Tests cover home resolution, pairing persistence, service adoption, port handling, and the refusal path. The issue lists moving launcher state and runtime cache as one possible direction, but the PR explicitly keeps those paths unchanged and does not claim to migrate existing data.
Full details: Out of Scope Changes check
-
Explanation
The changes remain within issue [
#17039].sshHelper.tsprovides remote-home resolution.tunnel.tsapplies that result to discovery, launch, and pairing, and adds the required home-change and port safeguards. The test changes directly verify these behaviors and the service-file formats. No changes target client layout, provider behavior, authentication scope, wire contracts, or unrelated SSH features.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Note Written by updated to addressed two scoped recovery findings: ignore dead or zombie runtime pids before custom-home adoption, and record the selected home before marking a newly launched server managed and waiting for readiness. extended the existing shell test; it failed on the old readiness path and then on the missing home metadata before both fixes passed. no new test files. the added recovery fix is five production lines. blacksmith this pass did not repeat the prior full openssh/client/provider exercise or verify macos, windows, packaged desktop, or the release archive. prior runtime evidence follows and remains tied to its original head. previous verificationupdated the original branch, preserving verification at
unverified: macos/launchd runtime, windows ssh, and packaged desktop end-to-end. launchd resolution is covered by the existing-file tests. no client rendering changes. human approval of the home-selection and credential-store behavior is still required. |
|
Note Written by Verified in a real dev environmentverified head
command transcript and environment details Not verifiedpackaged electron ui, macos launchd, windows, native ios/android, a separate physical ssh host, and the release-archive runner. ssh used a real loopback openssh server and the source cli. two environment limitations were encountered: the standard dev backend redirects |
# Conflicts: # packages/ssh/src/tunnel.test.ts

Problem
SSH discovery, server launch, and pairing always use
~/.t3, even when the remote machine's existing T3 service uses a custom home. Adding an SSH route can therefore start a second environment and issue credentials from the wrong store.Fixes #17039. The failure and intended resolution order were established in maintainer triage.
Fix
Resolve the remote home using explicit
T3CODE_HOME, then the installed systemd unit or launchd plist, then the default. Reuse the existing service-file parser and home expansion rather than evaluating shell configuration. Discovery andserve --base-diruse that result; save it for pairing so a later non-login shell cannot silently choose another home.Keep launcher ownership and runtime cache paths where they are; this does not move existing data or installations. If a legacy managed server is still running in a different home, fail with an actionable message and leave both its process and runner intact. Do not reuse an old home's remembered external port when the selected service is unavailable. External services remain external and are not stopped.
This changes the SSH backend only; no client layout, provider behavior, authentication scope, or wire contract changes. Existing unrelated SSH alias ownership and old-server/new-runner compatibility issues are outside this fix.
Verification
/bin/shpairing-script test with isolated home and a fixture CLI failed:--base-dirwas<fixture>/.t3instead of the explicitly configured custom home.vp test run packages/ssh/src/tunnel.test.ts apps/server/src/cli/sshHelper.test.ts apps/server/src/cloud/bootService.test.ts: 44 passed on macOS arm64, Node 26.12.1.T3CODE_HOME=/tmp/t3-17039-cli-path-proof node apps/server/src/bin.ts __ssh-helper home-dirprinted exactly that path.vp run check:changed: passed formatting, lint, knip, server GraphQL validation, scoped typechecks, and both directly affected test files (11 tests).Not verified against a real remote SSH host or a packaged desktop build. No production state was modified and no UI evidence is claimed.
Model: GPT-5-based Codex. Harness: Codex desktop app.