it("defaults to current time when now is omitted", () => {
vi.useFakeTimers();
vi.setSystemTime(now); try {
expect(
isStaleUnendedSubagentRun({
createdAt: now - STALE_UNENDED_SUBAGENT_RUN_MS - 1,
}),
).toBe(true);
} finally {
vi.useRealTimers();
}
});
it("keeps child links only while live, recently ended, or waiting on descendants", () => {
expect(shouldKeepSubagentRunChildLink({ createdAt: now - 60_000 }, { now })).toBe(true);
expect(
shouldKeepSubagentRunChildLink(
{
createdAt: now - RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS - 60_000,
endedAt: now - RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS + 1,
},
{ now },
),
).toBe(true);
expect(
shouldKeepSubagentRunChildLink(
{
createdAt: now - RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS - 60_000,
endedAt: now - RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS - 1,
},
{ now },
),
).toBe(false);
expect(
shouldKeepSubagentRunChildLink(
{
createdAt: now - RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS - 60_000,
endedAt: now - RECENT_ENDED_SUBAGENT_CHILD_SESSION_MS - 1,
},
{ activeDescendants: 1, now },
),
).toBe(true);
expect(
shouldKeepSubagentRunChildLink(
{
createdAt: now - STALE_UNENDED_SUBAGENT_RUN_MS - 1,
},
{ now },
),
).toBe(false);
});
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-05-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.