fix(agent): Handle optional OAuth fields in usage.ts credential reader
Updated checkAccountHealth to handle setup tokens with null expiresAt: - Changed currentExpiresAt type from number to number | null - Use conditional for tokenExpiresAt ISO string conversion This completes the OAuth setup token support across all credential reading and validation functions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -327,6 +327,11 @@ export async function ensureAccountCredentials(configDir: string): Promise<boole
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!credentials.refreshToken) {
|
||||
log.error({ configDir }, 'setup token expired, no refresh token available');
|
||||
return false;
|
||||
}
|
||||
|
||||
log.info({ configDir }, 'credentials expired, refreshing before spawn');
|
||||
const refreshed = await refreshToken(credentials.refreshToken);
|
||||
if (!refreshed) {
|
||||
|
||||
Reference in New Issue
Block a user