fix: report deduped subagent totals

This commit is contained in:
Tak Hoffman
2026-03-24 16:12:28 -05:00
parent cf96fa67af
commit 51e59983a1
2 changed files with 3 additions and 1 deletions

View File

@@ -1036,12 +1036,14 @@ describe("sessions tools", () => {
const result = await tool.execute("call-subagents-list-dedupe", { action: "list" });
const details = result.details as {
status?: string;
total?: number;
active?: Array<{ runId?: string }>;
recent?: Array<{ runId?: string }>;
text?: string;
};
expect(details.status).toBe("ok");
expect(details.total).toBe(1);
expect(details.active).toEqual([
expect.objectContaining({
runId: "run-list-current",

View File

@@ -339,7 +339,7 @@ export function buildSubagentList(params: {
buildListEntry(entry, getSubagentSessionRuntimeMs(entry, entry.endedAt ?? now) ?? 0),
);
return {
total: params.runs.length,
total: dedupedRuns.length,
active,
recent,
text: buildListText({ active, recent, recentMinutes: params.recentMinutes }),