Skip to content

macOS: t3 update --channel stable from nightly leaves the launchd service loaded but never started #29522

Open

Description

@skippy-magnificent

What happened

I switched from nightly (0.1.7-nightly.20261102.4080, running as the macOS background service) to stable by running t3 update --channel stable once, in a normal Terminal window (not inside T3). The service went down and never came back, so my other laptop could not connect. The update installed 0.1.6 and rewrote the LaunchAgent, but launchd never started the job: it stayed loaded, enabled and not running with runs = 0 until I ran launchctl kickstart by hand.

Diagnosis

Verified on the machine:

  • ~/Library/LaunchAgents/com.t3tools.t3code.service.plist and runtime/service-state.json (activeVersion: "0.1.6") were both rewritten at 13:20:06 local.
  • logs/boot-service.log ends with the old service's shutdown at 12:46:24 (relay stopped, tunnel released, shutdown reconciliation completed), then one line: Background setup failed while stopping the installed launch agent (exit code 3). Exit code 3 from launchctl bootout is No such process (reproduced with a nonexistent label), i.e. the job was not loaded at that point. That step is optional: true in launchdManager.stop, so the failure is logged but ignored.
  • runtime/.restart-pending was absent afterwards, which (per install() in apps/server/src/cloud/bootService.ts at v0.1.6) means manager.activate (launchctl enable + launchctl bootstrap gui/<uid> <plist>) returned success.
  • Yet launchctl print gui/<uid>/com.t3tools.t3code.service showed state = not running, runs = 0, last exit code = (never exited), pended nondemand spawn = speculative, and print-disabled showed it enabled. The plist has RunAtLoad and KeepAlive true. Nothing was listening on 3773. runtime/.service-stopping from the 12:46 shutdown was still present.
  • launchctl kickstart gui/<uid>/com.t3tools.t3code.service started it immediately; it came up on 0.1.6, migrated the DB 69 → 76, and cleared the stop marker.

Not established: why launchd left the bootstrapped job pending instead of spawning it, and why the old service stopped at 12:46 but the new unit was only written at 13:20 (about 34 minutes later; one t3 update run). The DB (statev2.sqlite) is ~1 GB, so a long pre-update backup in between is plausible but unverified. A possible hardening: after bootstrap, check launchctl print for a running pid and kickstart if none.

Separately, the t3 on PATH was still the nightly desktop app's shim (~/.t3/bin/t3 → T3 Code (Nightly).app, 0.0.46), so t3 serve afterwards ran 0.0.46 against a DB at migration 69 and only warned (Database migration history diverges from this build) before serving.

Steps to reproduce

  1. macOS 26, background service installed as the LaunchAgent and running a nightly (0.1.7-nightly.20261102.4080), with a large statev2.sqlite (~1 GB).
  2. In a normal terminal (outside T3), run t3 update --channel stable once.
  3. After it finishes, run launchctl print gui/$(id -u)/com.t3tools.t3code.service.
  4. Observe state = not running, runs = 0; the server port does not answer.
  5. launchctl kickstart gui/$(id -u)/com.t3tools.t3code.service starts it.

Version

Bug happened on: update from 0.1.7-nightly.20261102.4080 to 0.1.6 (service runtime). The triage CLI was 0.0.46-nightly.20261015.3158 (the old desktop shim; only the CLI that ran t3 triage).

Environment

macOS 26.4.1 (Darwin 25.4.0), arm64. Node v24.21.0. Background service via launchd (com.t3tools.t3code.service). Connecting from the desktop app on a second laptop.

Evidence

$ launchctl print gui/<uid>/com.t3tools.t3code.service   (before kickstart)
	state = not running
	program = ~/.t3/runtime/versions/0.1.6/t3
	runs = 0
	pended nondemand spawn = speculative
	last exit code = (never exited)

boot-service.log tail:
[12:46:22.025] INFO: Relay client stopped
[12:46:23.079] INFO: Released the managed tunnel on shutdown
[12:46:24.487] INFO: V2 orchestration shutdown reconciliation completed
2026-11-02T18:20:06.759Z Background setup failed while stopping the installed launch agent (exit code 3).

$ launchctl bootout --wait gui/<uid>/com.example.doesnotexist; echo $?
Boot-out failed: 3: No such process
3

Related issues

Fix applied or workaround

launchctl kickstart gui/$(id -u)/com.t3tools.t3code.service started the service; it has stayed up since.

Filed by

Claude Code (Claude Opus 5.5, claude-opus-5-5) via t3 triage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions