You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(clients): show whole seconds in live duration labels - #29495
Live chat timers can display 7.6s → 8.6s → 9.6s while refreshing once per second. They subtract a start timestamp with milliseconds, then use the same fractional formatter as completed actions. The main working timers already display whole seconds.
Change
Add a shared formatLiveDuration that floors elapsed time to whole seconds, including 0s below one second. Apply it to mobile working/setup, subagent and workflow labels, plus web/desktop setup, background-work and stopping labels. Live labels also show 0s during the first second, including when the shared clock is earlier than a fractional start timestamp. Completed durations retain their existing precision.
This is client formatting only. The existing shared second clock, visibility gating, server timestamps, contracts and provider adapters are unchanged, so local, remote and tunnel connections follow the same path.
Scope and approval
A small fix for the same precision mismatch across existing live labels, submitted under the obvious-bug exception. No prior issue or product-direction change. Searched existing issues and PRs; the related #27316 intentionally preserves fractional completed durations.
Verification
Regression first: the existing mobile subagent presentation case failed with 7.6s, 8.6s, 9.6s instead of 7s, 8s, 9s. It passes after the fix and checks that completed work still shows 7.6s.
The mobile regression also covers clock ticks before and exactly at the start timestamp, and keeps completed zero/negative durations hidden. A browser check of the production stopping/background timer callbacks showed 0s at 500 ms and 1s at 1.5 seconds for both.
Shared formatter tests cover subsecond, invalid/negative inputs and second/minute/hour boundaries. The focused shared/mobile run passed 23 tests.
Existing web setup browser tests passed 2/2. vp run check:changed passed formatting, lint, both knip passes, affected-package typechecks, 26 focused tests and 9 selected React Compiler checks. Commit hooks also passed.
Integrated Windows web pass against isolated, seeded development state: a free Replay turn showed Working for 0s → 1s → 2s, completed, and displayed Worked for 2.4s.
Captures below render the production web setup component with controlled timestamps and the app CSS, in Chromium on Windows at 1280×800. The live stage changes from fractional to whole seconds; the completed stage remains 7.6s. Recordings advance the fixture clock once per second. These are component fixtures, not native iOS captures.
Native UI verification remains incomplete. iOS is unavailable on this Windows host. The Android follow-up attempted vp run mobile:install android emulator-5554; its dev-client build failed before installation in native dependency CMake/Ninja tasks with manifest 'build.ninja' still dirty after 100 tries. Packaged Electron, a second machine, and relay/tunnel connections were not exercised. Both native clients use the changed mobile code; desktop renders the changed web code.
Submitted on behalf of @zmm2025. Model: GPT-6.1 Sol (gpt-6.1-sol), high reasoning effort. Harness: Codex in T3 Code.
Macroscope's review found this PR approvable — Live duration labels now show whole seconds across mobile and web, while completed durations retain their existing precision. The change is confined to presentation and introduces no material operational or data exposure.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between e552a91 and 818d842.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The shared timing module adds whole-second formatting for live durations. Mobile and web elapsed-time displays use it for active or open-ended work, while completed durations retain regular formatting.
The shared module adds formatLiveDuration. Tests cover invalid and negative values, sub-second durations, and second, minute, and hour boundaries.
Mobile thread elapsed labels apps/mobile/src/features/threads/ThreadAgentsSheet.tsx, apps/mobile/src/features/threads/ThreadWorkflowGroup.tsx, apps/mobile/src/features/threads/subagent-card-presentation.ts, apps/mobile/src/features/threads/subagent-card-presentation.test.ts
Active subagent labels use live formatting; completed labels retain regular formatting. Tests check elapsed output for running and completed agents.
Setup and activity elapsed displays apps/mobile/src/features/threads/worktree-setup-card.tsx, apps/web/src/components/chat/WorktreeSetupCard.tsx, apps/web/src/components/chat/ThreadActivityBanners.tsx
Open-ended setup intervals and web activity timers use live formatting. Completed setup intervals retain regular formatting. Invalid elapsed values still render nothing where specified.
pingdotgg/t3code#25418 — The formatter displays negative or pre-start elapsed values as 0s, but this change does not address the issue’s reported server/client clock skew.
Suggested reviewers:juliusmarminge, t3dotgg
Merge Risk: Minimal · previous review 63ee2
Live labels show whole seconds while completed durations retain their precision. No merge-blocking issue is identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly summarizes the main change: live duration labels now show whole seconds.
Description check
The description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the behavior, scope, approval exception, test results, UI evidence, and remaining verifi…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the behavior, scope, approval exception, test results, UI evidence, and remaining verification gaps.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Merged current main into the branch with a merge commit (63ee2f46cd); no rebase. The only conflict was packages/shared/src/orchestrationTiming.test.ts: main's #33994 added formatDuration cases and now renders whole minutes as 1m 0s. Kept both test blocks. Since formatLiveDuration delegates to formatDuration, its 60_000 row now expects 1m 0s instead of 1m. No source changes beyond that row.
Both earlier review findings were already fixed in 8f8a1178c9. The previous Label PR failure was a 504 while downloading Nu, and it passed on rerun.
On Blacksmith, the focused shared and mobile tests passed (30 tests). vp run check:changed passed format, lint, knip, typecheck, 4 test files and the React Compiler checks. CI shows 30/30 checks passing on 63ee2f46cd, and GitHub reports the PR mergeable.
Earlier verification (by gpt-6.1-sol, head bfa592d)
Verified in a real dev environment
Verified unchanged head bfa592d56e62c1f4c0677a985f5c846f950af37b on this Linux Boat VM using repository Playwright and /usr/bin/google-chrome, a running dev server, and real Codex gpt-6.1-sol turns through the local proxy. No fixtures, replay provider, mocked timestamps, or component harnesses.
Reproduced on github/main at efcb937695: added the real repository through the UI, configured its actual node scripts/setup-worktree.ts action, and submitted a new worktree thread. The running dependency-install stage displayed fractional seconds, including 7.7s. Stopped main's server before starting the PR server with a separate explicit home directory.
Repeated the same project, prompt, setup action and worktree flow on the PR head. The live setup stage displayed whole seconds (4s, 5s, onward). Completed stages retained their existing precision (721ms for fetch). The setup completed and the real Codex turn read package.json and answered successfully.
Also started a real Codex background command (timeout 90 sh -c "sleep 60; git status --short"). Its running banner displayed whole seconds. Clicking Stop removed the banner, and a follow-up Codex turn completed successfully. The recording shows the running timer and stop transition. The transient stopping state was too brief to inspect its timer.
Before, main:
After, PR:
Inspected the screenshots and recording; uploaded video playback and seeking worked in Chrome. Focused existing tests ran on Blacksmith:
vp test run packages/shared/src/orchestrationTiming.test.ts apps/mobile/src/features/threads/subagent-card-presentation.test.ts
2 files passed, 23 tests passed
The current head has 31 successful CI checks. No source changes or pushes were needed.
Not verified
Native iOS/Android working, setup, subagent and workflow labels: this Linux VM has no attached Android device (adb devices -l was empty) or iOS client. Packaged Electron, other providers, remote/relay/tunnel connections, long-duration minute/hour transitions in the real client, and the transient stopping timer were not exercised. The existing subsecond label guards discussed in review were not changed by this verification pass.
The reason will be displayed to describe this comment to others. Learn more.
kinda related to #30490 which implements more-or-less the same thing
nice work here too, id personally prefer <500ms to show up as 0s and 500ms-1s as 1s (or simply <1s as 0s) - not sure if the pr does that already even the description says it does...
just saying, as maria's screenshots show ms instead 1s:
@BelKed This already implements your second option: live values below 1s show 0s, then values from 1s up to 2s show 1s. The shared formatter test explicitly checks 999ms renders as 0s.
The 721ms in Maria's screenshot is the completed fetch step. Completed setup timings retain their measured precision; the running stage beside it uses whole seconds. #30490 handles completed turn-fold labels, while this PR covers live setup/activity timers and mobile subagent/workflow labels.
This branch has not been deployed
No deployments
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
size:M30-99 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
3 participants
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.
Problem
Live chat timers can display
7.6s → 8.6s → 9.6swhile refreshing once per second. They subtract a start timestamp with milliseconds, then use the same fractional formatter as completed actions. The main working timers already display whole seconds.Change
Add a shared
formatLiveDurationthat floors elapsed time to whole seconds, including0sbelow one second. Apply it to mobile working/setup, subagent and workflow labels, plus web/desktop setup, background-work and stopping labels. Live labels also show0sduring the first second, including when the shared clock is earlier than a fractional start timestamp. Completed durations retain their existing precision.This is client formatting only. The existing shared second clock, visibility gating, server timestamps, contracts and provider adapters are unchanged, so local, remote and tunnel connections follow the same path.
Scope and approval
A small fix for the same precision mismatch across existing live labels, submitted under the obvious-bug exception. No prior issue or product-direction change. Searched existing issues and PRs; the related #27316 intentionally preserves fractional completed durations.
Verification
7.6s, 8.6s, 9.6sinstead of7s, 8s, 9s. It passes after the fix and checks that completed work still shows7.6s.0sat 500 ms and1sat 1.5 seconds for both.vp run check:changedpassed formatting, lint, both knip passes, affected-package typechecks, 26 focused tests and 9 selected React Compiler checks. Commit hooks also passed.Working for 0s → 1s → 2s, completed, and displayedWorked for 2.4s.7.6s. Recordings advance the fixture clock once per second. These are component fixtures, not native iOS captures.Before recording · After recording
Native UI verification remains incomplete. iOS is unavailable on this Windows host. The Android follow-up attempted
vp run mobile:install android emulator-5554; its dev-client build failed before installation in native dependency CMake/Ninja tasks withmanifest 'build.ninja' still dirty after 100 tries. Packaged Electron, a second machine, and relay/tunnel connections were not exercised. Both native clients use the changed mobile code; desktop renders the changed web code.Submitted on behalf of @zmm2025. Model: GPT-6.1 Sol (
gpt-6.1-sol), high reasoning effort. Harness: Codex in T3 Code.