Skip to content

Commit c591f1e

Browse files
committed
refactor: extract fix command
1 parent 6f70ce1 commit c591f1e

1 file changed

Lines changed: 26 additions & 30 deletions

File tree

lib/codex-manager.ts

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,35 +2834,6 @@ function applyDoctorFixes(storage: AccountStorageV3): {
28342834
return { changed, actions };
28352835
}
28362836

2837-
async function runDoctor(args: string[]): Promise<number> {
2838-
return runDoctorCommand(args, {
2839-
setStoragePath,
2840-
getStoragePath,
2841-
getCodexCliAuthPath,
2842-
getCodexCliConfigPath,
2843-
loadCodexCliState,
2844-
parseDoctorArgs,
2845-
printDoctorUsage,
2846-
loadAccounts,
2847-
applyDoctorFixes,
2848-
saveAccounts,
2849-
resolveActiveIndex,
2850-
evaluateForecastAccounts,
2851-
recommendForecastAccount,
2852-
sanitizeEmail,
2853-
extractAccountEmail,
2854-
extractAccountId,
2855-
hasPlaceholderEmail,
2856-
hasLikelyInvalidRefreshToken,
2857-
getDoctorRefreshTokenKey,
2858-
hasUsableAccessToken,
2859-
queuedRefresh,
2860-
normalizeFailureDetail,
2861-
applyTokenAccountIdentity,
2862-
setCodexCliActiveSelection,
2863-
});
2864-
}
2865-
28662837
async function clearAccountsAndReset(): Promise<void> {
28672838
await clearAccounts();
28682839
}
@@ -3600,7 +3571,32 @@ export async function runCodexMultiAuthCli(rawArgs: string[]): Promise<number> {
36003571
return runFix(rest);
36013572
}
36023573
if (command === "doctor") {
3603-
return runDoctor(rest);
3574+
return runDoctorCommand(rest, {
3575+
setStoragePath,
3576+
getStoragePath,
3577+
getCodexCliAuthPath,
3578+
getCodexCliConfigPath,
3579+
loadCodexCliState,
3580+
parseDoctorArgs,
3581+
printDoctorUsage,
3582+
loadAccounts,
3583+
applyDoctorFixes,
3584+
saveAccounts,
3585+
resolveActiveIndex,
3586+
evaluateForecastAccounts,
3587+
recommendForecastAccount,
3588+
sanitizeEmail,
3589+
extractAccountEmail,
3590+
extractAccountId,
3591+
hasPlaceholderEmail,
3592+
hasLikelyInvalidRefreshToken,
3593+
getDoctorRefreshTokenKey,
3594+
hasUsableAccessToken,
3595+
queuedRefresh,
3596+
normalizeFailureDetail,
3597+
applyTokenAccountIdentity,
3598+
setCodexCliActiveSelection,
3599+
});
36043600
}
36053601

36063602
console.error(`Unknown command: ${command}`);

0 commit comments

Comments
 (0)