Skip to content
Source
Sign inSign up
pingdotgg/t3code

Configure providers per environment #4548

Closedcolonelpanic8(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/4548/headopened View on GitHub

What Changed

  • Added an environment selector to Provider settings.
  • Routed provider configuration, status refreshes, updates, and new instances to the selected environment.
  • Defaulted managed deployments to the primary environment and client-only deployments to the active/first available environment.
  • Added safe loading and no-environment states plus focused environment-selection tests.

Why

Provider settings were implicitly tied to the primary server. In client-only mode, or when multiple T3 environments are connected, that made it impossible to see which machine owned an account configuration and could route updates to the wrong target.

UI Changes

BeforeAfter
Provider settings beforeEnvironment-scoped provider settings
Mobile-width verification

Environment-scoped provider settings at 390px

The real add-instance flow was exercised against the selected environment. The resulting provider instance was persisted to that environment and the confirmation toast named the target environment.

Checklist

  • vp check
  • vp test run src/components/settings/SettingsPanels.logic.test.ts src/hooks/useSettings.test.ts --project unit (13 tests)
  • Type-aware lint and type checking for the five changed files
  • Integrated desktop and 390px web verification with zero browser errors or warnings
  • vp run typecheck — blocked by pre-existing @effect/vitest export errors in oxlint-plugin-t3code; clean origin/main fails with the same errors

Note

Medium Risk Changes where provider accounts are read and written across environments, which could mis-route updates if selection logic is wrong; the reduced cleanup on delete/reset may leave orphaned model prefs or favorites for removed instances.

Overview Provider settings are no longer tied to the primary server only. The Providers panel adds an environment selector so reads, edits, refreshes, and one-click provider updates target the chosen connected environment, with loading and “no environments” empty states.

resolveProviderSettingsEnvironmentId picks the effective environment: explicit selection, then primary (managed), then active/first available (client-only), with fallback when a stale selection disappears. AddProviderInstanceDialog now requires environmentId / environmentLabel and persists new instances via per-environment settings; success copy names the environment.

Deleting a custom instance or resetting a default provider only updates providerInstances (and legacy providers on reset)—it no longer strips providerModelPreferences or favorites in the same patch.

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

Note

Scope provider settings and instance management to a selected environment

  • Provider settings are now resolved and displayed per environment using a new ProviderSettingsEnvironmentPanel component in SettingsPanels.tsx, replacing the previous primary-settings-only approach.
  • A new ProviderEnvironmentSelector component in ProviderEnvironmentSelector.tsx lets users switch the active environment for provider configuration.
  • Environment resolution logic is extracted into resolveProviderSettingsEnvironmentId in SettingsPanels.logic.ts, which handles fallback to primary or active environment when no explicit selection exists.
  • AddProviderInstanceDialog now accepts environmentId and environmentLabel props and stores new instances against the selected environment.
  • Behavioral Change: Deleting provider instances or reverting default providers no longer automatically removes favorites.
Macroscope summarized be176c3.
    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: 64fd4ada-dacc-48b6-a99c-4751ef04fa54

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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 that changes how provider settings work - from primary-environment-only to per-environment configuration. It includes a new UI component, new state management, and a behavioral change to instance deletion. New user-facing features warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      Closing this PR after an automated pass over open pull requests. Environment-specific provider settings already shipped in #4479.

Sign in to join this conversation.