Skip to content

The agent that grows with you

fix(desktop): honor Settings profile selector on Providers page

By JTT0eabb58e903c
diff --git a/apps/desktop/src/app/settings/providers-settings.tsx b/apps/desktop/src/app/settings/providers-settings.tsx
index a061330fc36..b492ffce195 100644
--- a/apps/desktop/src/app/settings/providers-settings.tsx
+++ b/apps/desktop/src/app/settings/providers-settings.tsx
@@ -25,6 +25,7 @@ import { confirm } from '@/store/confirm'
import { $localModelsEnabled } from '@/store/local-models-flag'
import { notify, notifyError } from '@/store/notifications'
import { $desktopOnboarding, startManualLocalEndpoint, startManualProviderOAuth } from '@/store/onboarding'
+import { $settingsRequestProfile } from '@/store/settings-scope'
import type { EnvVarInfo, OAuthProvider } from '@/types/hermes'
import { isKeyVar, ProviderKeyRows } from './credential-key-ui'
@@ -33,6 +34,7 @@ import { SettingsCategoryHeading, useEnvCredentials } from './env-credentials'
import { providerGroup, providerMeta, providerPriority } from './helpers'
import { LocalModelsSettings } from './local-models-settings'
import { SettingsContent, SettingsSkeleton } from './primitives'
+import { SettingsProfileScope } from './profile-scope'
// The embedded terminal (and thus the "run disconnect command" path) only
// exists in the Electron desktop shell, not the web dashboard.
@@ -347,7 +349,11 @@ export function ProvidersSettings({
view
}: ProvidersSettingsProps) {
const { t } = useI18n()
- const { rowProps, vars } = useEnvCredentials()
+ // Shared settings "Applies to" scope: read + edit the selected profile's
+ // env store instead of the active one. Undefined → active profile.
+ // See https://github.com/NousResearch/hermes-agent/issues/103993
+ const scopeProfile = useStore($settingsRequestProfile)
+ const { rowProps, vars } = useEnvCredentials(scopeProfile)
const [oauthProviders, setOauthProviders] = useState<OAuthProvider[]>([])
const [openProvider, setOpenProvider] = useState<null | string>(null)
const [disconnecting, setDisconnecting] = useState<null | string>(null)
@@ -474,6 +480,7 @@ export function ProvidersSettings({
return (
<SettingsContent>
+ <SettingsProfileScope className="mb-5" />
<LocalEndpointRow onOpen={startManualLocalEndpoint} />
{keyGroups.length > 0 ? (
<div className="grid gap-3">
@@ -523,6 +530,7 @@ export function ProvidersSettings({
return (
<SettingsContent>
+ <SettingsProfileScope className="mb-5" />
<OAuthPicker
disconnecting={disconnecting}
onDisconnect={provider => void handleDisconnect(provider)}