-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKnownStoreLocator.cs
More file actions
29 lines (25 loc) · 1.07 KB
/
Copy pathKnownStoreLocator.cs
File metadata and controls
29 lines (25 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using CodexSessionManager.Core.Sessions;
namespace CodexSessionManager.Storage.Discovery;
public static class KnownStoreLocator
{
public static IReadOnlyList<KnownSessionStore> GetKnownStores(string codexHome)
{
// Preserve the previous fail-fast contract: Path.Combine threw on a null
// root, whereas Path.Join does not. Keep the explicit guard so behavior
// is unchanged after the Path.Combine -> Path.Join migration.
ArgumentNullException.ThrowIfNull(codexHome);
return // nosemgrep: codacy.csharp.security.null-dereference -- false positive after constructor/guard validation.
[
new KnownSessionStore(
codexHome,
SessionStoreKind.Live,
Path.Join(codexHome, "sessions"),
Path.Join(codexHome, "session_index.jsonl")),
new KnownSessionStore(
codexHome,
SessionStoreKind.Backup,
Path.Join(codexHome, "sessions_backup"),
Path.Join(codexHome, "session_index.jsonl"))
];
}
}