Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(connect): deregister account environments from any client #4844

MergedStiensWout(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/4844/headmerged by juliusmarminge View on GitHub

A destroyed or reinstalled T3 Connect host can remain registered to its account indefinitely, consuming a host space with no reachable server to unlink itself.

This moves account lifecycle management into an account-level T3 Connect page. Web and desktop expose it as a custom Clerk profile page beside Mobile clients, while mobile exposes the same environment list from its Account settings. Both clients can deregister any account environment directly through the Clerk-authenticated relay endpoint without contacting the host. Device-local connect and disconnect controls remain in Connections or Environments.

Validation:

  • vp run --filter @t3tools/client-runtime typecheck
  • vp run --filter @t3tools/web typecheck
  • vp run --filter @t3tools/mobile typecheck
  • targeted lint and formatting for changed files
  • mobile native static checks
  • focused coverage for Clerk-session deregistration and stale-account rejection

Closes #5070 Closes #5135

Implemented with GPT-5.6 Codex in the T3 Code Codex harness.

Web and desktop

Authentic desktop capture of T3 Connect inside the full Clerk account panel. Environment names are redacted.

T3 Connect inside the full Clerk account panel

Mobile layout

Approved native account-route layout. A simulator capture was unavailable on this Linux host.

T3 Connect mobile account route layout


Note

Medium Risk Deregistration revokes tunnels and account binding via relay; session/account checks limit misuse, but mistakes are destructive and worth careful review.

Overview Adds account-level deregistration for T3 Connect environments so unreachable or wiped hosts can be removed without contacting the server.

Runtime & web: deregisterManagedRelayEnvironment in client-runtime calls the relay unlinkEnvironment API with the current Clerk session and rejects stale account IDs. Web wires this through a serial deregisterManagedRelayEnvironmentCommand and a new Clerk profile tab T3 Connect that lists registered environments, inline confirm-to-deregister UI, optimistic list filtering, toasts (with trace ID on failure), and refresh.

UI polish: Shared ClerkUserProfilePage / row / refresh primitives; Mobile clients profile page restyled to match. AlertDialogPopup gains optional portalContainer for correct layering in Clerk modals.

Docs: remote-access.md documents the deregistration flow and that device connect/disconnect stays in Settings.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c3b2844ba904893cb5cf4d8a97f63db4348104b1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add T3 Connect environment deregistration UI to user profile

  • Adds a new T3ConnectUserProfilePage component that lists linked environments per account and allows deregistering them via an inline confirmation flow, with success/error toasts and stale-entry filtering after removal.
  • Adds deregisterManagedRelayEnvironment in packages/client-runtime/src/relay/managedRelayState.ts, an Effect that validates the current session matches the given accountId, fetches a Clerk token, and calls unlinkEnvironment on the ManagedRelay client.
  • Exposes deregisterManagedRelayEnvironmentCommand in apps/web/src/cloud/managedRelayState.ts as a serialized-per-account runtime command to prevent concurrent deregistration mutations.
  • Registers the new page as a T3 Connect entry in the Clerk user menu alongside the existing Mobile Clients page.
  • Extracts shared layout primitives (ClerkUserProfilePage, ClerkUserProfileRefreshButton, ClerkUserProfileRow) and refactors MobileClientsUserProfilePage to use them.
Macroscope summarized c3b2844.
    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 Plus

      Run ID: 5ee20843-a7f5-4622-8c81-661bd2ec64c8

      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

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

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

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

      Approvability

      Verdict: Needs human review

      This PR introduces a new feature enabling users to deregister T3 Connect environments from the web UI, including new profile pages, account-level mutations, and workflow changes. New user-facing capabilities of this scope warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. github-actions[bot](GitHub profile, opens in a new tab) removed labelsvouch:unvouched

    5. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    6. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6c1a14ba0e7afa24e7531d4b8c5ceae9d96d03a6. Configure [here](https://www.cursor.com/dashboard/bugbot).
    7. juliusmarminge merged thisd0b8d63

    8. juliusmarminge closed this

Sign in to join this conversation.