fix(ui): floor both halves of a task duration - #862
Open
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
Open
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 30, 2026 05:43
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/task-duration-60s
branch
from
September 30, 2026 09:38
edf5625 to
7e069ef
Compare
The seconds were rounded while the minutes were floored, so a value within half a second of the next minute printed an impossible 1m 60s. The ticking counter next to it floors throughout.
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/task-duration-60s
branch
from
September 30, 2026 10:14
7e069ef to
bfa5d87
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
formatTaskDurationinfrontend/ui/src/components/research-trace.tsfloors the larger unit and rounds the smaller one:Why it matters
Whenever the remainder is within half a second of the next unit, the rounded value reaches
60— and nothing carries it, because the larger half was already floored:60is not a valid number of seconds, so a task card shows a duration that does not exist. The window is wide: within[119_500, 3_599,999]there are 29,500 values that print a60.The call site (
message-part.tsx:1397) passesmetadata.durationMsthrough with no clamp, so any finished Task landing in that window is affected.The behaviour is pinned by its own sibling —
elapsedLabel, six lines above, the counter for a still-ticking task, floors throughout and is right on the same input:Verification
New case in the existing duration test. Fails before:
The pre-existing assertions (800 / 7,800 / 125,000) are untouched and still pass, so the ordinary values are unchanged. The new test checks all three magnitude branches and asserts the same input through
elapsedLabel, which is what makes the floor behaviour a stated contract rather than a coincidence.The wider
frontend/uisuite is flaky in this checkout (231 pass / 12 fail onupstream/main; 232/12 and 233/11 with this change across runs — order and timing dependent), so this is judged on the targeted file.The change
Touched files are Prettier-clean (verified on LF-normalized copies; this Windows checkout's
core.autocrlf=truemakes Prettier flag every file repo-wide).Fixes #861