Skip to content

fix(shared): durations read 1m rather than 60s - #627

Merged
incognitojam merged 1 commit into
mainfrom
styal/duration-minute-rollover
Oct 3, 2026
Merged

incognitojam merged 1 commit into
mainfrom
styal/duration-minute-rollover

Conversation

@incognitojam

Copy link
Copy Markdown
Owner

formatDuration picked its unit before rounding, so durations just under a boundary rounded up within the smaller unit: 59.6s read "60s" instead of "1m", and 999.6ms read "1000ms" instead of "1.0s". It formats the work and step durations in the chat timeline, the composer tasks badge, worktree setup and diagnostics.

Both branches now choose the unit from the rounded value, as the minute-to-hour step already did. This is the same kind of fix as the snooze countdowns (#45) and token counts (#626). Upstream fixed the same thing in pingdotgg#13412, which was closed because it combined two fixes.

Validation: new cases in orchestrationTiming.test.ts cover 999.6ms → 1.0s, 59,499ms → 59s and 59,600ms → 1m, alongside the existing table (32 tests pass). I didn't check this in a running client: the change is limited to this pure formatter, and the tests call it directly.


Written by an agent (Claude Code, claude-opus-5-5).

formatDuration chose its unit before rounding, so 59.6s read "60s" and 999.6ms read "1000ms". Both now choose the unit from the rounded value.
@incognitojam
incognitojam enabled auto-merge (squash) October 3, 2026 09:39
@incognitojam
incognitojam merged commit 5dabdfb into main Oct 3, 2026
18 checks passed
@incognitojam
incognitojam deleted the styal/duration-minute-rollover branch October 3, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant