fix: roll rounded durations into seconds#100006
Conversation
|
Codex review: passed. Reviewed July 4, 2026, 4:33 PM ET / 20:33 UTC. Summary PR surface: Source +3, Tests +2. Total +5 across 2 files. Reproducibility: yes. Current main source branches on raw Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land this narrow shared formatter and regression-test change through the exact-head automerge and CI gates so the linked issue closes cleanly. Do we have a high-confidence way to reproduce the issue? Yes. Current main source branches on raw Is this the best way to solve the issue? Yes. Branching on the rounded millisecond value in the shared formatter is the narrowest maintainable fix and avoids caller-specific display patches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7a0188cbd20d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +3, Tests +2. Total +5 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper automerge |
|
🦞✅ Source: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
Summary: - The branch updates the shared duration helpers to branch on rounded millisecond values and adds 999.6ms expectations for compact, human, and precise duration output. - PR surface: Source +3, Tests +2. Total +5 across 2 files. - Reproducibility: yes. Current main source branches on raw `ms < 1000` before rounding in all three helpers, and the linked issue plus prior review include direct module proof that 999.6ms returned `1000ms`. Automerge notes: - No ClawSweeper repair was needed after automerge opt-in. Validation: - ClawSweeper review passed for head 9e06973. - Required merge gates passed before the squash merge. Prepared head SHA: 9e06973 Review: openclaw#100006 (comment) Co-authored-by: qingminlong <[email protected]> Approved-by: takhoffman
Closes #99978
What Problem This Solves
Fixes an issue where users reading duration output could see
1000mswhen a sub-second value such as 999.6ms rounded up to the next unit boundary.Why This Change Was Made
The duration helpers now decide whether to stay in milliseconds after calculating the rounded millisecond value, so values that round to 1000ms flow through the existing seconds formatting path. This keeps the fix limited to the shared formatter behavior and adds regression coverage for all three affected duration displays.
User Impact
Timing text now stays in the expected unit scheme: rounded sub-second durations display as
1sinstead of the confusing1000msedge case.Evidence
formatDurationPrecise,formatDurationCompact, andformatDurationHumanreturn1sfor 999.6ms.git diff --checkpassed.node scripts/run-vitest.mjs src/infra/format-time/format-time.test.ts --reporter=verbosepassed: 1 file, 60 tests.node --import tsx -e "const m=await import('./src/infra/format-time/format-duration.ts'); console.log(JSON.stringify({precise:m.formatDurationPrecise(999.6),compact:m.formatDurationCompact(999.6),human:m.formatDurationHuman(999.6)}))"printed{"precise":"1s","compact":"1s","human":"1s"}.python .agents\skills\autoreview\scripts\autoreview --mode localpassed with no accepted/actionable findings.node_modules(OPENCLAW_MISSING_VITEST);corepack pnpm install --frozen-lockfilecompleted successfully and the same focused test passed afterward.AI-assisted with Codex.