From eeef8a3d4afb609096bea27d6015700b2ad3d099 Mon Sep 17 00:00:00 2001 From: Michael Ludlow Date: Sun, 4 Jan 2026 14:35:38 -0500 Subject: [PATCH] fix: check .claude.json for OAuth auth in profile scorer (#652) * fix: check .claude.json for OAuth auth in profile scorer The isProfileAuthenticated() function only checked legacy credential files (credentials, credentials.json, .credentials, settings.json) when determining if a profile is eligible for auto-switch. Claude Code CLI (v1.0+) stores OAuth authentication in .claude.json with an oauthAccount field containing accountUuid and emailAddress. This meant profiles authenticated via OAuth were silently rejected by the profile scorer, causing auto-switch to fail even when 'Reactive Recovery' was enabled. This fix adds a check for .claude.json containing oauthAccount info before falling through to legacy credential file checks. Fixes incomplete resolution of #365 and #43 * fix: add type validation and error logging per review feedback - Add typeof check before accessing oauthAccount properties - Log parse errors with console.warn for debugging malformed .claude.json Co-authored-by: gemini-code-assist[bot] <176abortvfax+gemini-code-assist[bot]@Fusers.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176abortvfax+gemini-code-assist[bot]@Fusers.noreply.github.com> Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com> --- .../src/main/claude-profile/profile-utils.ts | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/main/claude-profile/profile-utils.ts b/apps/frontend/src/main/claude-profile/profile-utils.ts index 557d8fae..80a3c048 100644 --- a/apps/frontend/src/main/claude-profile/profile-utils.ts +++ b/apps/frontend/src/main/claude-profile/profile-utils.ts @@ -56,7 +56,7 @@ export async function createProfileDirectory(profileName: string): Promise