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

This commit is contained in:
Peter Steinberger
2026-01-09 16:39:59 +01:00
parent 09b602b4ec
commit 7d518e336e
8 changed files with 343 additions and 598 deletions

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;