fix(infra): roll session warning durations across unit boundaries#100096
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (5 earlier review cycles)
|
@clawsweeper re-review
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Verbose test run showing all 6 formatter cases from the actual session-maintenance-warning.ts module: Rollover: 59500ms → "1 minute", 3570000ms → "1 hour", 86370000ms → "1 day"
@clawsweeper re-review |
@clawsweeper re-review
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
…t unit The raw float was checked against the boundary before rounding, so values like 59.5s, 59m30s, and 23h59m30s rounded up to "60 seconds", "60 minutes", and "24 hours" in session maintenance warning messages instead of "1 minute", "1 hour", and "1 day". Round first, then check the unit boundary. Closes openclaw#99978
…nance warning Round seconds first, then promote to the next unit only when the rounded lower unit reaches its overflow threshold (60s->min, 60m->hr, 24h->day). The previous approach compared raw milliseconds against the unit boundary before rounding, causing half-unit values like 30s, 30m, and 12h to promote one unit too early. Closes openclaw#99978
7fe0680 to
30667de
Compare
|
Reviewed and repaired for landing. The formatter now promotes rounded duration boundaries without prematurely promoting ordinary values. I removed the unused test-only export, corrected the stale issue reference, and rebased the branch onto current Proof on exact head
No remaining proof gaps. |
|
Merged via squash.
|
…enclaw#100096) * fix(infra): formatDuration rolls over near-boundary values to the next unit The raw float was checked against the boundary before rounding, so values like 59.5s, 59m30s, and 23h59m30s rounded up to "60 seconds", "60 minutes", and "24 hours" in session maintenance warning messages instead of "1 minute", "1 hour", and "1 day". Round first, then check the unit boundary. Closes openclaw#99978 * fix(infra): fix formatDuration progressive rollover in session maintenance warning Round seconds first, then promote to the next unit only when the rounded lower unit reaches its overflow threshold (60s->min, 60m->hr, 24h->day). The previous approach compared raw milliseconds against the unit boundary before rounding, causing half-unit values like 30s, 30m, and 12h to promote one unit too early. Closes openclaw#99978 * test(infra): expose formatDuration via testing export for direct verification * ci: retrigger checks * ci: retrigger checks * test(infra): keep duration formatter private --------- Co-authored-by: Vincent Koc <[email protected]>



What Problem This Solves
Session maintenance warnings could display rounded durations as
60 seconds,60 minutes, or24 hoursinstead of promoting them to1 minute,1 hour, or1 day.Why This Change Was Made
The warning formatter selected a unit from the raw millisecond value and rounded only afterward. It now rounds progressively from seconds through days, matching the rollover semantics used by the shared duration formatter while preserving the warning text's spelled-out unit labels.
User Impact
Warn-only session maintenance messages now use natural duration boundaries without changing cleanup behavior or configuration.
Evidence