feat(connect): deregister T3 connect registrered hosts - #4844
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature allowing users to deregister T3 Connect hosts, including new UI buttons, confirmation dialogs, and API workflows. New features with user-facing behavior changes warrant human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3248ce7. Configure here.

Problem
T3 Connect accounts have a limited number of managed host spaces. Today, a user can disconnect a remote environment locally, but cannot deregister its account-backed relay link from the web app. This is especially painful when the server or host device was wiped or is otherwise no longer accessible: the stale registration can continue occupying capacity with no recovery path in the client.
What changed
User impact
Users can recover a T3 Connect host space from Settings → Connections even when they no longer have access to the registered server. The existing Disconnect action remains the reversible, client-local choice; Deregister is the explicit account-level destructive action.
Validation
vp run --filter @t3tools/web typecheckvp test run apps/web/src/cloud/linkEnvironment.test.ts(10 tests)Implemented with GPT-5.6 Codex in the T3 Code Codex harness.
Note
Add deregister action for T3 Connect relay-managed environments
deregisterRelayEnvironmentin linkEnvironment.ts that issues a DELETE to/v1/client/environment-links/{environmentId}using the current CloudSession clerk token.deregisterEnvironmentatom command in linkEnvironmentAtoms.ts that serializes deregistration per environment ID.Macroscope summarized 7a4d75e.
Note
Medium Risk
Destructive account-level relay unlink affects managed tunnels and host capacity, but reuses the existing authenticated unlink API and UI confirmation patterns rather than new auth or payment logic.
Overview
Adds an account-level Deregister flow so users can revoke T3 Connect relay registration and free a managed host slot without contacting the server—unlike local disconnect/unlink.
Backend: New
deregisterRelayEnvironmentcallsManagedRelayClient.unlinkEnvironmentwith theCloudSessionclerk token only (no primary-environment HTTP). A serial per-environmentIdweb:cloud:deregister-environmentcommand wires it into the connection runtime.UI: Destructive Deregister with confirmation appears next to Connect for relay-managed rows in Settings → Connections (saved backends) and in the cloud environment connect list (account-discovered hosts). Settings also removes the saved connection after a successful deregister and refreshes relay discovery; both surfaces use existing toast/trace-ID patterns.
Tests: Direct relay DELETE deregistration is covered in
linkEnvironment.test.ts.Reviewed by Cursor Bugbot for commit 7a4d75e. Bugbot is set up for automated code reviews on this repo. Configure here.