feat(web): per-device provider settings - #4479
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Providers settings were hardwired to the primary backend. When working through T3 Connect or app.t3.codes, remote boxes could not be configured — controls were missing or ineffective.
What this does
Single local-primary setups keep the existing Providers layout with no extra device section.
No contracts, server RPC, relay, or permission-scope changes — the environment-scoped commands already carry
environmentId.Verification
pnpm --filter @t3tools/web typecheck— passedpnpm --filter @t3tools/web test— 172 files / 1,519 tests passed/settings/providers: provider rows render, add-instance dialog opens/cancels, refresh completes, no Providers-specific console errorsNew tests cover environment ordering/selection fallback, all access states, non-primary command routing, add-instance scoping, nullable snapshots, and shared-preference preservation. Interactive multi-device and disconnected-device checks were blocked by single-environment runtime state and are covered by those tests instead.
🤖 Generated with Claude Code
Note
Medium Risk
Large settings UI refactor with new session-scope gating and optimistic permission fallbacks; incorrect access classification could expose controls that RPC rejects, though writes remain server-enforced.
Overview
Providers settings are no longer tied to the primary device. The panel is extracted into
ProviderSettingsPaneland, when more than one execution environment exists, adds a Devices picker (primary, T3 Connect, SSH, etc.) with connection status on each row.All provider actions are scoped to the selected
environmentId: settings read/write, refresh, one-click updates, and the add-instance dialog. Server commands already carriedenvironmentId; the UI now passes it consistently.Access is gated before showing editable controls: connection phase, whether server config is loaded, and whether the session has
orchestration:operate(via new per-environment/api/auth/sessionatoms in client-runtime anduseEnvironmentSessionStateon web). Missing permission shows the real layout read-only (inert) with a limited-permissions notice; disconnected or loading devices get explicit unavailable/loading copy instead of broken controls.Other behavior tweaks: deleting or resetting a provider instance on one device no longer clears shared favorites/model preferences in the same settings patch; default provider slots on older remote servers can omit legacy driver blobs without breaking the panel. Single primary-only setups keep the previous layout without the Devices section.
Reviewed by Cursor Bugbot for commit 688524b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-device provider settings with environment selection to the Providers settings panel
ProviderSettingsPanelwith a multi-device aware version inProviderSettingsPanel.tsxthat lets users select an execution environment and manage providers per device.ProviderSettingsPanel.logic.tsto classify each environment as editable, read-only, loading, unavailable, or error based on connection phase, config availability, and session scopes.createEnvironmentSessionAtomsinpackages/client-runtime/src/state/session.tswithsessionStateAtomandsessionStateValueAtomthat fetch/api/auth/sessionper environment using SWR semantics (30s stale, 5m idle TTL).useEnvironmentSessionStatehook inapps/web/src/state/session.tsexposing auth session data withisPending/hasErrorflags for UI gating.durationToSeconds,normalizeIntervalSeconds,backgroundActivityOverrideSettings) fromSettingsPanels.tsxtoSettingsPanels.logic.tsand removes the oldProviderSettingsPanelimplementation fromSettingsPanels.tsx.ProviderSettingsPanelis no longer exported fromSettingsPanels.tsx; the import path is updated insettings.providers.tsxbut any other consumer importing from the old path will break at runtime.Macroscope summarized 688524b.
Summary by CodeRabbit
New Features
Bug Fixes
Tests