fix(ci): stabilize windows paths

This commit is contained in:
Peter Steinberger
2026-01-08 03:02:46 +00:00
parent 7bddaa41ea
commit 6e4174b5dc
11 changed files with 126 additions and 41 deletions

View File

@@ -202,12 +202,14 @@ export function resolveStorePath(store?: string, opts?: { agentId?: string }) {
const agentId = normalizeAgentId(opts?.agentId ?? DEFAULT_AGENT_ID);
if (!store) return resolveDefaultSessionStorePath(agentId);
if (store.includes("{agentId}")) {
return path.resolve(
store.replaceAll("{agentId}", agentId).replace("~", os.homedir()),
);
const expanded = store.replaceAll("{agentId}", agentId);
if (expanded.startsWith("~")) {
return path.resolve(expanded.replace(/^~(?=$|[\\/])/, os.homedir()));
}
return path.resolve(expanded);
}
if (store.startsWith("~"))
return path.resolve(store.replace("~", os.homedir()));
return path.resolve(store.replace(/^~(?=$|[\\/])/, os.homedir()));
return path.resolve(store);
}