refactor(sessions): move session summary generation to startup (#14691)

This commit is contained in:
Jack Wotherspoon
2025-12-09 22:25:22 -05:00
committed by GitHub
parent d2a6b30398
commit ee6556cbd2
6 changed files with 313 additions and 352 deletions
+14
View File
@@ -498,6 +498,20 @@ export async function main() {
// Handle --list-sessions flag
if (config.getListSessions()) {
// Attempt auth for summary generation (gracefully skips if not configured)
const authType = settings.merged.security?.auth?.selectedType;
if (authType) {
try {
await config.refreshAuth(authType);
} catch (e) {
// Auth failed - continue without summary generation capability
debugLogger.debug(
'Auth failed for --list-sessions, summaries may not be generated:',
e,
);
}
}
await listSessions(config);
await runExitCleanup();
process.exit(ExitCodes.SUCCESS);