feat(sessions): label lookup tightening (#570) (thanks @azade-c)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user