Description
formatDuration (lib/format-duration.ts:17) rounds the seconds component after it has
already committed to a minute/hour bucket, so when the rounded value lands on 60 it is never
carried up. This produces strings that are never supposed to exist.
This function is reused for tool-call durations across lib/codex-sessions.ts,
lib/cursor-sessions.ts, lib/goose-sessions.ts, and session duration in lib/log-stats.ts,
so these malformed strings surface on real transcripts in the dashboard/CLI.
Steps to Reproduce
import { formatDuration } from "./lib/format-duration";
formatDuration(59999); // => "60.0s" (expected "1m 0s")
formatDuration(119600); // => "1m 60s" (expected "2m 0s")
formatDuration(3599600); // => "59m 60s" (expected "1h 0m")
Expected Behavior
Durations should always be normalised: 60.0s → 1m 0s, 1m 60s → 2m 0s, 59m 60s → 1h 0m.
Failproof AI Version
0.0.14-beta.1
Node.js / Bun Version
Bun 1.3+
Operating System
macOS
Additional Context
Durations should always be normalised: 60.0s → 1m 0s, 1m 60s → 2m 0s, 59m 60s → 1h 0m.
Description
formatDuration(lib/format-duration.ts:17) rounds the seconds component after it hasalready committed to a minute/hour bucket, so when the rounded value lands on
60it is nevercarried up. This produces strings that are never supposed to exist.
This function is reused for tool-call durations across
lib/codex-sessions.ts,lib/cursor-sessions.ts,lib/goose-sessions.ts, and session duration inlib/log-stats.ts,so these malformed strings surface on real transcripts in the dashboard/CLI.
Steps to Reproduce
Expected Behavior
Durations should always be normalised:
60.0s→1m 0s,1m 60s→2m 0s,59m 60s→1h 0m.Failproof AI Version
0.0.14-beta.1
Node.js / Bun Version
Bun 1.3+
Operating System
macOS
Additional Context
Durations should always be normalised:
60.0s→1m 0s,1m 60s→2m 0s,59m 60s→1h 0m.