You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several T3 servers can run on the same machine, each with a different account, data directory, or purpose. They currently derive their display label from the same host, making otherwise distinct environments difficult to tell apart. Container hostnames can also be opaque or change when a container is recreated even though its persisted T3 identity remains the same.
A server-side label is useful for headless services, containers, and declaratively managed hosts: the operator can name each environment alongside its existing process configuration, without changing the machine's hostname or relying on a manual client-side rename.
Change
Honor optional T3CODE_ENVIRONMENT_LABEL in the existing server label resolver:
Trim surrounding whitespace and use a nonblank value before host probes.
Preserve the existing friendly-host, hostname, directory, and default fallbacks when unset or blank.
Keep the persistent environment ID, network configuration, other descriptor fields, and saved client aliases unchanged.
The background-service guide includes service.env and manual-launch examples. No new CLI flag, wire contract, persistence mechanism, or UI control is introduced.
Scope and approval
This is focused configuration of the established environment-label capability, submitted under the configuration-option route in CONTRIBUTING.md. It does not change product defaults or introduce a new connection or authorization workflow. No separate maintainer feature approval is claimed.
Earlier proposals established the same need. This independently implemented change includes executed tests and the tooling disclosure requested in their closure feedback:
vp test run apps/server/src/environment/ServerEnvironmentLabel.test.ts apps/server/src/environment/ServerEnvironment.test.ts
vp run check:changed origin/main --concurrency 1
Focused resolver/environment suite: 42 passed. Covers absent, empty, ASCII/Unicode-whitespace values, all fallback tiers, Unicode labels, distinct accounts sharing one host, and overrides avoiding host probes.
The restart test changes the label and verifies that every other descriptor field, including the persistent environment ID, stays equal.
Before implementation and with the override deliberately removed: 7 failed / 35 passed. Restoring it returns the suite to green.
Final branch-specific changed-file check: 44 tests across three files passed, plus formatting, lint, both knip phases, generated GraphQL validation, and affected-package typechecks. Duration: 41.362 seconds. Valid repository task-cache results were reused for typechecking.
Verified on Linux with Node 26.13.0, pnpm 12.14.0, and project-pinned Vite+ 1.4.0. The exact Node 26.12.1 runtime and live client/server activation were not exercised. Fork CI remains queued for unassigned inherited Blacksmith runners and is not presented as passing CI. No live T3 instance or credentials were changed.
Macroscope's review found this PR approvable — Adds an optional environment display label while preserving automatic naming when unset or blank. The change affects display metadata, not environment identity or network configuration.
You can add or adjust custom eligibility rules. Learn more.
The server now accepts T3CODE_ENVIRONMENT_LABEL as a display-label override. It trims the value and uses the existing fallback sequence when the value is unset or blank. Tests and background-service documentation cover the behavior.
Changes: Environment label resolution
Layer / File(s)
Summary
Override resolution and verification apps/server/src/environment/ServerEnvironmentLabel.ts, apps/server/src/environment/ServerEnvironmentLabel.test.ts, apps/server/src/environment/ServerEnvironment.test.ts, docs/user/background-service.md
The resolver returns a trimmed, nonblank T3CODE_ENVIRONMENT_LABEL before running host probes. Tests cover override and fallback behavior and confirm that changing the label does not change other descriptor fields. The documentation explains how to configure the label and how it differs from other environment identifiers.
pingdotgg/t3code#25505 proposes a custom environment label that overrides the macOS ComputerName. This change adds an environment-variable override, but does not address the issue’s separate proposal to add the OS username to the default label.
Possibly related PRs
pingdotgg/t3code#27950: This PR also changes resolveServerEnvironmentLabel and adds label-related tests. Both changes add a label source before host probes.
The documented restart instruction is clear in context, and no merge-blocking issue is established.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(server): allow explicit environment display labels" matches the main change. The PR adds optional T3CODE_ENVIRONMENT_LABEL support to the server label resolver, so an operator can set …
Description check
The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem and Change sections clearly describe the feature, the fallback behav…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat(server): allow explicit environment display labels" matches the main change. The PR adds optional T3CODE_ENVIRONMENT_LABEL support to the server label resolver, so an operator can set a display label for each server environment. The title is short, follows conventional commit style, and names the primary change.
Full details: Description check
Explanation
The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem and Change sections clearly describe the feature, the fallback behavior, and what stays unchanged. The Scope section explains why the change is focused configuration under the CONTRIBUTING.md configuration-option route, and it links earlier proposals. The Verification section lists focused test commands, results (42 passed, 7 failed before the fix, 44 tests across three files), environments tested, and what was not checked. The model and harness are named at the end, as the template asks. The template's optional comment about the Conventional Commit title is not repeated, but the title itself meets that requirement.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
docs/user/background-service.md-93-94: 1
93-94: Minor · Maintainability & Code Quality · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Fix the broken sentence in the restart instruction.
The sentence "restart the service after running agent work has finished" is ambiguous. It can be read as "after running agent work". Rewrite it so the restart timing is clear. Restarting interrupts running agent turns, as the earlier text in this file states.
📝 Proposed fix
-service, put the variable in `service.env` and restart the service after running-agent work has finished. For a server in a terminal:+service, put the variable in `service.env`, then restart the service after any+running agent work has finished. For a server in a terminal:
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:unvouchedPR author is not yet trusted in the VOUCHED list.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Several T3 servers can run on the same machine, each with a different account, data directory, or purpose. They currently derive their display label from the same host, making otherwise distinct environments difficult to tell apart. Container hostnames can also be opaque or change when a container is recreated even though its persisted T3 identity remains the same.
A server-side label is useful for headless services, containers, and declaratively managed hosts: the operator can name each environment alongside its existing process configuration, without changing the machine's hostname or relying on a manual client-side rename.
Change
Honor optional
T3CODE_ENVIRONMENT_LABELin the existing server label resolver:The background-service guide includes
service.envand manual-launch examples. No new CLI flag, wire contract, persistence mechanism, or UI control is introduced.Scope and approval
This is focused configuration of the established environment-label capability, submitted under the configuration-option route in CONTRIBUTING.md. It does not change product defaults or introduce a new connection or authorization workflow. No separate maintainer feature approval is claimed.
Earlier proposals established the same need. This independently implemented change includes executed tests and the tooling disclosure requested in their closure feedback:
#13985
#12559
Verification
vp test run apps/server/src/environment/ServerEnvironmentLabel.test.ts apps/server/src/environment/ServerEnvironment.test.ts vp run check:changed origin/main --concurrency 1Verified on Linux with Node 26.13.0, pnpm 12.14.0, and project-pinned Vite+ 1.4.0. The exact Node 26.12.1 runtime and live client/server activation were not exercised. Fork CI remains queued for unassigned inherited Blacksmith runners and is not presented as passing CI. No live T3 instance or credentials were changed.
Model: GPT-6.1 Sol. Harness: Claude Code.