fix(subagents): correct duration display showing 5-6x inflated runtime#45700
fix(subagents): correct duration display showing 5-6x inflated runtime#45700jackjin1997 wants to merge 3 commits into
Conversation
Greptile SummaryThis PR fixes a long-standing bug in subagent duration display where runtimes were shown as ~5–6× inflated (e.g., The fix replaces the buggy local duplicate with a re-export of the canonical Key changes:
Confidence Score: 5/5
Last reviewed commit: 1bee70d |
fixes openclaw#45009) The duplicate formatDurationCompact in subagents-format.ts divided milliseconds by 60000 (treating input as minutes) instead of 1000. Replace with a re-export of the canonical implementation from infra/format-time which correctly converts ms to seconds first, and now also shows seconds-level granularity.
1bee70d to
aacfbe1
Compare
|
Closing to free up PR queue — will resubmit if needed. |
Problem
Fixes #45009.
Subagent interim status display shows runtime inflated ~6x (e.g. a 10-minute run displays as ~58 minutes). Final completion stats are correct — the bug is isolated to the polling/list display path.
Root cause
A duplicate
formatDurationCompactinsrc/shared/subagents-format.tsdivides milliseconds by 60,000 (jumping straight to minutes) instead of by 1,000 (converting to seconds first). The canonical implementation insrc/infra/format-time/format-duration.tshandles the conversion correctly and already has full test coverage.Fix
formatDurationCompact?? "n/a"fallback at two call sites where the old function returned"n/a"but the canonical version returnsundefined45s) instead of always rounding up to1mTest plan
pnpm test—subagents-format.test.tspasses (4 cases: seconds granularity, minutes, hours, invalid input)formatDurationCompact(5000)→"5s"(previously"1m")formatDurationCompact(600_000)→"10m"(previously showed inflated value)pnpm buildandpnpm checkpass locally