Skip to content

feat(connect): deregister T3 connect registrered hosts - #4844

Open
StiensWout wants to merge 4 commits into
pingdotgg:mainfrom
StiensWout:feat/deregister-t3-connect-hosts
Open

feat(connect): deregister T3 connect registrered hosts#4844
StiensWout wants to merge 4 commits into
pingdotgg:mainfrom
StiensWout:feat/deregister-t3-connect-hosts

Conversation

@StiensWout

@StiensWout StiensWout commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

  • add a destructive Deregister action beside the existing reversible Connect/Disconnect controls for T3 Connect environments
  • make the action available both for locally saved relay environments and account-discovered hosts
  • confirm that deregistration revokes T3 Connect access, removes the managed tunnel, and frees one of the account’s three host spaces
  • call the existing authenticated relay unlink endpoint directly, so the flow does not depend on reaching the missing host
  • remove a matching local saved connection after a successful account deregistration and refresh relay discovery
  • surface success, failure, and trace-ID feedback through the existing toast patterns
  • cover direct relay deregistration with a focused client test

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.

image

Validation

  • vp run --filter @t3tools/web typecheck
  • focused lint for the five changed web files
  • vp 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

  • Adds deregisterRelayEnvironment in linkEnvironment.ts that issues a DELETE to /v1/client/environment-links/{environmentId} using the current CloudSession clerk token.
  • Exposes a new deregisterEnvironment atom command in linkEnvironmentAtoms.ts that serializes deregistration per environment ID.
  • Adds a confirmation-gated Deregister button to the environment discovery list in CloudEnvironmentConnectList.tsx and to saved connections in ConnectionsSettings.tsx.
  • On success, the local saved connection is removed, relay environments are refreshed, and a success toast is shown; errors surface with optional trace ID copying.
  • Connect/Disconnect and Remove buttons are disabled while deregistration is in progress.

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 deregisterRelayEnvironment calls ManagedRelayClient.unlinkEnvironment with the CloudSession clerk token only (no primary-environment HTTP). A serial per-environmentId web:cloud:deregister-environment command 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.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

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: d3d78b0d-4e74-4821-be8d-0e55dad341de

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.

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Jul 29, 2026
@StiensWout StiensWout changed the title feat(connect): deregister unreachable hosts feat(connect): deregister T3 connect registrered hosts Jul 29, 2026
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Jul 29, 2026
@StiensWout
StiensWout marked this pull request as ready for review July 29, 2026 14:34
Comment thread apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx Outdated
Comment thread apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx
Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@StiensWout
StiensWout marked this pull request as draft July 29, 2026 14:47
@StiensWout
StiensWout marked this pull request as ready for review July 29, 2026 14:48

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Reviewed by Cursor Bugbot for commit 3248ce7. Configure here.

Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant