Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add remote server updates and standalone service management #4286

Mergedjuliusmarmingemerged 14 commits intomain fromrefs/pull/4286/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Summary

  • Keep connected T3 Code clients and servers on the same version with capability-aware update actions.
  • Add standalone host service management through t3 service install, update, status, and uninstall.
  • Make T3 Connect onboarding reuse the service lifecycle without owning it; Connect logout now leaves the host service installed.
  • Harden GitHub pull-request status discovery and Git remote matching across SSH and HTTPS URL forms.

User-facing behavior

  • Version mismatches appear in conversations and Settings → Connections.
  • Published CLI servers can offer a one-click server update and reconnect flow.
  • Desktop-managed servers direct users to update the desktop app on the host.
  • Unsupported or older servers provide an exact command to copy and run manually.
  • Linux hosts can manage the systemd user service directly, including updating it with npx t3@latest service update.
  • User guides cover server updates, background service management, remote access, expected restarts, and recovery steps.

Server update architecture

  • Advertise boot-service, respawn, or desktop-managed update capabilities in the environment descriptor.
  • Add an operate-scoped server.updateServer RPC and shared client-runtime command.
  • Install exact npm versions into a pinned runtime with serialized install and cleanup, completion sentinels, and exact-version preflight checks.
  • Atomically rewrite and reload the managed systemd unit with rollback on activation failures.
  • Hand foreground macOS and Linux CLI servers off to a verified detached replacement.
  • Keep UI attempt ownership, interruption handling, and reconnect timeouts safe across slow installs and server restarts.
  • Require the exact CLI package to be published before a client release can request it.

Host service lifecycle

  • Add t3 service install, update, status, and uninstall independently of T3 Connect configuration.
  • Reuse one reconciliation path from both the direct CLI and optional Connect onboarding.
  • Preserve the service when users unlink or log out of T3 Connect.
  • Keep the service entry point stable by pinning ephemeral npx, pnpm dlx, or bunx runtimes before systemd uses them.

Supporting VCS fixes

  • Cache GitHub PR lookups while retaining the last known result across transient failures.
  • Support older gh repository response fields.
  • Normalize equivalent SSH, SCP-style, and HTTPS Git remotes to avoid duplicate remote registration.
  • Route refreshes through full VCS status invalidation.

Verification

  • Focused server, pinned-runtime, CLI, web component, and version-skew tests cover the new behavior and failure paths.
  • Targeted lint, formatting, and server type checks pass.
  • GitHub CI Check, Test, Release Smoke, and Mobile Native Static Analysis pass.
  • Cursor Bugbot, Macroscope correctness, and Effect service convention checks pass with no unresolved review threads.

Operational notes

  • Updating restarts the server and can interrupt active agent work or terminal commands.
  • Managed background services currently require Linux with systemd.
  • Desktop-managed backends remain owned and updated by the desktop app.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: e726e751-bde8-459b-95a5-87502b791317

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `t3code/enable-remote-environment-updates`

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces a new feature for remote server self-updates, adding new CLI commands (t3 service), new RPC endpoints, process management logic (systemd unit rewriting, detached process spawning), and new UI components. New capabilities with significant runtime behavior changes warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Effect service review: one error-wrapping convention violation in the new self-update service.

      Posted via Macroscope — Effect Service Conventions
    5. apps/server/src/cloud/selfUpdate.ts line 254OutdatedResolvedby juliusmarminge
    6. apps/web/src/components/ServerUpdateAction.tsx line 139OutdatedResolvedby juliusmarminge
    7. apps/server/src/cloud/selfUpdate.ts line 420Resolvedby juliusmarminge
      apps/server/src/cloud/selfUpdate.ts line 295Resolvedby juliusmarminge
      apps/server/src/cloud/selfUpdate.ts line 419Resolvedby juliusmarminge
    8. juliusmarminge changed the title

    9. juliusmarminge merged thisab4a883

    10. juliusmarminge closed this

Sign in to join this conversation.