bound inactive subagent timing to projection cut

This commit is contained in:
kingwl
2026-08-03 11:40:33 +08:00
parent c831c99981
commit 0b0de64769
11 changed files with 66 additions and 38 deletions

View File

@@ -245,9 +245,9 @@ describe('SubagentCatalogAction', () => {
vi.useFakeTimers()
vi.setSystemTime(now)
const rows = [
['running', 'running', 65_000, now - 5_000, now],
['finished', 'inactive', 3_723_000, undefined, now - 60_000],
['interrupted', 'inactive', 2_000, now - 7_000, now - 3_000],
['running', 'running', 65_000, now - 5_000, now - 1_000, now],
['finished', 'inactive', 3_723_000, undefined, undefined, now - 60_000],
['interrupted', 'inactive', 2_000, now - 7_000, now - 3_000, now + 60_000],
] as const
const entries = rows.map(([id, activity]) => ({
kind: 'child' as const,
@@ -257,7 +257,9 @@ describe('SubagentCatalogAction', () => {
activity,
hasChildren: false,
}))
const summaries = Object.fromEntries(rows.map(([id, activity, settledMs, activeSince, updatedAt]) => {
const summaries = Object.fromEntries(rows.map(([
id, activity, settledMs, activeSince, activeThrough, updatedAt,
]) => {
const childId = id as SessionId
return [id, {
...summary(childId, updatedAt),
@@ -267,7 +269,9 @@ describe('SubagentCatalogAction', () => {
projectionValues: {
subagentTiming: {
settledMs,
...(activeSince === undefined ? {} : { activeSince }),
...(activeSince === undefined || activeThrough === undefined
? {}
: { active: { since: activeSince, through: activeThrough } }),
},
},
}]