diff --git a/src/agents/auth-profiles/profiles.ts b/src/agents/auth-profiles/profiles.ts index 58c0c48e10f..9d562bafa10 100644 --- a/src/agents/auth-profiles/profiles.ts +++ b/src/agents/auth-profiles/profiles.ts @@ -61,7 +61,10 @@ export function upsertAuthProfile(params: { : params.credential; const store = ensureAuthProfileStoreForLocalUpdate(params.agentDir); store.profiles[params.profileId] = credential; - saveAuthProfileStore(store, params.agentDir, { syncExternalCli: false }); + saveAuthProfileStore(store, params.agentDir, { + filterExternalAuthProfiles: false, + syncExternalCli: false, + }); } export async function upsertAuthProfileWithLock(params: { diff --git a/src/agents/auth-profiles/store.ts b/src/agents/auth-profiles/store.ts index 6a075f7ca95..6c2b6a05b23 100644 --- a/src/agents/auth-profiles/store.ts +++ b/src/agents/auth-profiles/store.ts @@ -33,6 +33,7 @@ type LoadAuthProfileStoreOptions = { }; type SaveAuthProfileStoreOptions = { + filterExternalAuthProfiles?: boolean; syncExternalCli?: boolean; }; @@ -417,6 +418,9 @@ export function saveAuthProfileStore( if (credential.type !== "oauth") { return true; } + if (options?.filterExternalAuthProfiles === false) { + return true; + } return shouldPersistExternalAuthProfile({ store, profileId,