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
@@ -69,9 +69,11 @@ function activityDuration(
const timing: SessionProjectionMap['subagentTiming'] | undefined
= summary.projectionValues?.subagentTiming
if (timing === undefined) return undefined
if (timing.activeSince === undefined) return timing.settledMs
const end = activity === 'running' ? now : summary.updatedAt
return timing.settledMs + Math.max(0, end - timing.activeSince)
if (timing.active === undefined) return timing.settledMs
const end = activity === 'running'
? now
: timing.active.through
return timing.settledMs + Math.max(0, end - timing.active.since)
}
/** Format a non-negative duration to seconds without dropping larger units. */