feat(sessions): label lookup tightening (#570) (thanks @azade-c)

This commit is contained in:
Peter Steinberger committed 2026-01-09 16:42:09 +01:00
1 parent 09b602b4ec
commit 7d518e336e
8 files changed
+343 -598

No files matched your search

+5
View File
@@ -435,6 +435,7 @@ export function listSessionsFromStore(params: {
const includeGlobal = opts.includeGlobal === true;
const includeUnknown = opts.includeUnknown === true;
const spawnedBy = typeof opts.spawnedBy === "string" ? opts.spawnedBy : "";
const label = typeof opts.label === "string" ? opts.label.trim() : "";
const agentId =
typeof opts.agentId === "string" ? normalizeAgentId(opts.agentId) : "";
const activeMinutes =
@@ -460,6 +461,10 @@ export function listSessionsFromStore(params: {
if (key === "unknown" || key === "global") return false;
return entry?.spawnedBy === spawnedBy;
})
.filter(([, entry]) => {
if (!label) return true;
return entry?.label === label;
})
.map(([key, entry]) => {
const updatedAt = entry?.updatedAt ?? null;
const input = entry?.inputTokens ?? 0;