fix(session): preserve alias identity when its store is unreadable

This commit is contained in:
haelyra committed 2026-10-10 20:38:40 -04:00
1 parent a87957ea5e
commit f614e82ae5
2 files changed
+59 -37

No files matched your search

+1 -10
View File
@@ -73,15 +73,7 @@ function resolveSessionRecord(target, cwd) {
};
}
let alias;
let aliasReadError;
try {
alias = sessionAliases.resolveAlias(explicitTarget);
} catch (error) {
// Alias lookup is optional when the supplied identifier independently
// resolves to recorded history. Preserve the error otherwise.
aliasReadError = error;
}
const alias = sessionAliases.resolveAlias(explicitTarget);
if (alias) {
return {
session: hydrateSessionFromPath(alias.sessionPath),
@@ -94,7 +86,6 @@ function resolveSessionRecord(target, cwd) {
const session = sessionManager.getSessionById(explicitTarget, true);
if (!session) {
if (aliasReadError) throw aliasReadError;
throw new Error(`Claude session not found: ${explicitTarget}`);
}