Thanks for the careful repro and for separating this from #10179. This looks like a real bug on the desktop-managed SSH launch path, not OrbStack-specific and not a duplicate of the systemd hole.
What we think is happening
Desktop SSH remotes with remoteServerKind: managed never touch t3code.service. launchOrReuseRemoteServer in packages/ssh/src/tunnel.ts runs a one-shot sh -l -s that writes ~/.t3/ssh-launch/<stateKey>/run-t3.sh and starts the server with:
| 1 | nohup env T3CODE_NO_BROWSER=1 "$RUNNER_FILE" serve --host 127.0.0.1 --port "$REMOTE_PORT" --base-dir "$DEFAULT_SERVER_HOME" … |
That process inherits the launch session’s SSH_AUTH_SOCK. With ForwardAgent yes, sshd creates a per-session socket (~/.ssh/agent/s.*.sshd.* or /tmp/ssh-XXXX/agent.N) and deletes it when that session ends. The managed server is already detached (reparented to PID 1, after #9843’s exec), so /proc/<pid>/environ keeps the dead path. Reconnect reuses a live PID without refreshing the env; a full relaunch only picks the next short-lived socket.
The long-lived -N -L tunnel is a different SSH session (ControlMaster=no, no -A). It does not own or republish an agent socket to the server.
Your /proc + ls + SSH_AUTH_SOCK=<dead> git pull vs a live socket pins this. It also matches why the systemd instance on 3773 with the #10179 drop-in stayed healthy: that process never inherited this launch-session socket.
Same family as #10179 (systemd missing SSH_AUTH_SOCK), #5740 (WSL), #3067 (devcontainer timing), and #971 (local macOS desktop). Not a duplicate — here the socket is present at exec and dies with the launcher. #10312’s login-shell backfill would not help: your probe on #10179 was absent, and this server already has a socket (the wrong one). Open #8190 already describes this lifetime bug and sketches a dedicated ssh -A keepalive plus $STATE_DIR/agent-sock; it is unvouched and review-blocked, so treat it as a design reference, not a merge candidate.
Workaround
The zshenv export of a durable socket (OrbStack host-ssh-agent.sock) plus a managed-server relaunch is the right workaround on hosts that have one. It will not cover a remote whose only agent is a forwarded per-session socket.
What we should change
Keep a long-lived owner of the forwarded agent for the life of the desktop connection (dedicated ssh -A, or attach forwarding to the existing tunnel and share that session), point t3 serve at a stable path under ~/.t3/ssh-launch/<stateKey>/, and re-resolve that path on reconnect — including when the managed PID is reused. Do not inherit the one-shot launch session’s SSH_AUTH_SOCK without that owner. A symlink with no live owner still goes stale when the launch session exits.
Secondary: GitVcsDriver.pullCurrentBranch / fetchRemoteForStatus replace git stderr with git pull failed / Background Git fetch exited with a non-zero status, so Permission denied (publickey) never reaches the UI.
#10951 (keep the managed server after desktop close) would make a stale socket last longer; that work should not land without an agent owner.
Keeping this open as an accepted bug on packages/ssh managed launch.
GPT 6 via Cursor Cloud (triage only; no code change).