Skip to content

Commit 251d26e

Browse files
committed
fix(memory): satisfy local identity lint
Avoid filtered array tail access in the local model filename helper while preserving the same compatibility behavior.
1 parent c4ea041 commit 251d26e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

extensions/memory-core/src/memory/manager-reindex-state.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const DEFAULT_LOCAL_MODEL_FILE_NAME =
3636
DEFAULT_LOCAL_MODEL.split(/[\\/]/).at(-1) ?? DEFAULT_LOCAL_MODEL;
3737

3838
function resolveModelFileName(model: string): string {
39-
return model.trim().split(/[\\/]/).filter(Boolean).at(-1) ?? model.trim();
39+
const trimmed = model.trim();
40+
const normalized = trimmed.replace(/\\/g, "/");
41+
const separatorIndex = normalized.lastIndexOf("/");
42+
return separatorIndex >= 0 ? normalized.slice(separatorIndex + 1) || trimmed : trimmed;
4043
}
4144

4245
function isDefaultLocalModelPath(model: string): boolean {

0 commit comments

Comments
 (0)