Skip to content

feat: let users rename environments - #7267

Open
inayayousfi wants to merge 6 commits into
pingdotgg:mainfrom
inayayousfi:feat/rename-environments
Open

feat: let users rename environments#7267
inayayousfi wants to merge 6 commits into
pingdotgg:mainfrom
inayayousfi:feat/rename-environments

Conversation

@inayayousfi

@inayayousfi inayayousfi commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Written by inayayousfi, typed by gpt-5.6-sol running in OpenCode.
Every call here is inayayousfi's, and no agent acted on its own.

Problem

Environment names come from the host machine, so multiple servers on one machine can appear under the same name. Discussion #7017 describes this with several T3 Connect environments that all inherit one hostname.

Users also had no shared rename path. A client-local name could fix one device, but other web, desktop, mobile, and T3 Connect clients would keep showing something else.

Solution

Store the custom name in server settings and use it in the environment descriptor. Clearing the value restores the detected machine name.

Web and desktop get an inline editor in Settings → Connections. Mobile gets a native rename sheet in Settings → Environments. Any connected client with the orchestration operate scope can rename an environment.

Name changes propagate through the server config stream. T3 Connect receives the same effective name through an environment-authenticated relay endpoint with bounded retries.

Duplicate names remain allowed after confirmation. Existing mobile-only names are ignored so the server stays the source of truth.

Related Work

PR #4538 stores names on one web client, so other clients do not share the override.

PR #4850 also introduces a server-owned name. This pull request extends that model to remote environment editing, native mobile controls, duplicate confirmation, an explicit live label event, and direct relay synchronization.

PR #6053 addresses the narrower WSL hostname collision by adding an automatic distro suffix.

Web Evidence

Paired environment

A dark Connections page showing a paired remote environment with the same machine name

Editing the remote name

A dark Connections page showing the inline remote environment name editor

Renamed environment

A dark Connections page showing the paired remote environment renamed to T3 Server

The Playwright pass loaded built web assets, paired a separate t3 serve environment, and renamed it to T3 Server. The browser reported no console errors.

Verification

  • packages/contracts: 36 focused tests passed; type check passed.
  • packages/client-runtime: 14 focused tests passed; type check passed.
  • apps/server: 4 focused tests passed; type check passed.
  • infra/relay: 16 focused tests passed; type check passed.
  • apps/web: type check passed.
  • apps/mobile: type check passed.
  • Targeted formatting and lint passed.
  • git diff --check passed.

Addresses discussion #7017 and the converted issue #5623.


Note

Medium Risk
Touches settings persistence, WebSocket live updates, and relay synchronization; unsupported servers surface rename errors, while relay sync failures are only logged.

Overview
Introduces server-owned environment names via a new environmentLabel setting (up to 40 characters; empty restores the machine name). The execution descriptor and connected clients pick up changes through a dedicated environmentLabelUpdated config stream event and updateEnvironmentLabel RPC.

Web adds inline rename controls in Connections (primary environment + saved backends) gated on AuthOrchestrationOperateScope, with duplicate-name confirmation. Mobile moves rename out of the expanded connection row into a dedicated EnvironmentRename sheet and only shows rename when connected with the same scope; URL-only edits no longer send a label.

Server applies settings to an in-memory label override, starts background jobs to mirror settings into the descriptor and to push labels to the relay (PUT /v1/environments/:environmentId/label) with retries and cancellation of stale syncs. Relay link rows get updateLabel for the authenticated environment credential.

Client presentation prefers serverConfig.environment.label over connection-catalog labels; bearer URL updates can omit label so stored names are preserved.

Reviewed by Cursor Bugbot for commit e7eb70e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add environment renaming across web, mobile, server, and relay

  • Adds an environmentLabel field to ServerSettings (max 40 chars, defaults to empty) and a new setEnvironmentLabel method on ServerEnvironment; getDescriptor returns the custom label when set.
  • Adds a relay API endpoint PUT /v1/environments/:environmentId/label to persist label changes to active environment links in the database.
  • Adds updateEnvironmentLabel to client-side server environment atoms, which patches settings via WebSocket and verifies the server acknowledges the rename; emits environmentLabelUpdated stream events to connected clients.
  • Adds rename UI to the web connections settings page (EnvironmentLabelControl) and a dedicated mobile screen (SettingsEnvironmentRenameRouteScreen), both with duplicate-name confirmation and error handling.
  • On startup, the server subscribes to settings changes to keep the in-memory label in sync and runs a background relay sync task (runEnvironmentLabelRelaySync) that pushes label updates to the relay with exponential retry.

Macroscope summarized e7eb70e.

Store environment names on the server so every client and T3 Connect share one label.

Add authorized rename controls for web, desktop, and mobile with live propagation.
@coderabbitai

coderabbitai Bot commented Aug 16, 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: c7aa9e06-7a90-4f3f-9c55-3347dc8d19a2

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 vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 16, 2026
@inayayousfi
inayayousfi marked this pull request as ready for review August 16, 2026 22:14
@inayayousfi
inayayousfi marked this pull request as draft August 16, 2026 22:15
Comment thread apps/server/src/serverRuntimeStartup.ts Outdated
Comment thread apps/server/src/cloud/EnvironmentLabelRelaySync.ts Outdated
Comment thread apps/server/src/cloud/EnvironmentLabelRelaySync.ts Outdated

@macroscopeapp macroscopeapp 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.

UI consistency review found 3 issues in apps/web/src/components/settings/ConnectionsSettings.tsx (new EnvironmentLabelControl): a primitive height override that breaks the Input geometry, an Escape handler that also closes the settings page, and a native window.confirm where the file already uses AlertDialog.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated

@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 2 potential issues.

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 c3f5a86. Configure here.

Comment thread apps/mobile/src/features/connection/ConnectionEnvironmentRow.tsx Outdated
Comment thread apps/server/src/cloud/EnvironmentLabelRelaySync.ts
@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces a new user-facing feature for environment renaming spanning mobile, web, server, and relay infrastructure with new API endpoints and cross-cutting changes. New features of this scope warrant human review to validate the design and implementation.

You can customize Macroscope's approvability policy. Learn more.

@macroscopeapp macroscopeapp 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.

One finding on the new environment rename control in apps/web/src/components/settings/ConnectionsSettings.tsx. The dialog/escape/compact-input issues from the previous run are resolved.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
@inayayousfi
inayayousfi marked this pull request as ready for review August 17, 2026 10:19
Preserve saved labels during mobile URL edits.

Prevent startup and relay synchronization races, and align the web rename action.

@macroscopeapp macroscopeapp 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.

One inline-rename consistency issue in apps/web/src/components/settings/ConnectionsSettings.tsx. The primitive usage itself (compact Input, icon-micro/ghost-muted pencil matching SettingResetButton, AlertDialog for the duplicate-name confirmation, Escape handled locally) now lines up with the shared component system.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx

@macroscopeapp macroscopeapp 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.

One finding on the web rename control: the saved-environment row lost its heading element when the label moved into EnvironmentLabelControl.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
@blarfoon

Copy link
Copy Markdown

I was about to open the same PR. Hope this gets merged soon. Let me know if I can help in any way

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

Labels

size:XL 500-999 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.

2 participants