mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
fix(session): preserve alias identity when its store is unreadable
This commit is contained in:
2 files changed
+59
-37
No files matched your search
@@ -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}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user