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(cli): exclude spans before the trace summary window - #42571
t3 trace summary --since 1m can count a span that ended one nanosecond before the window. At current epoch timestamps, converting nanoseconds to floating-point milliseconds can make that span compare equal to the cutoff. A short window such as --since '1 nano' can also round away when subtracted from the current time.
Change
Compute the cutoff once from the clock's integer milliseconds and the requested duration in nanoseconds. Compare integer trace timestamps directly to that cutoff, including a span that ends exactly on it. Other accepted numeric spellings keep their millisecond comparison.
Scope
This fixes window membership in one CLI command. #42208 addressed the date printed by the summary. The reproducer below shows the separate counting error.
Verification
I ran the CLI on temporary trace files with the clock fixed at 2026-11-24T00:01:00.000Z. Each row used the same input before and after the fix.
Window
Span end times in the file
Before
After
--since 1m
1 ms before the cutoff, 1 ns before it, exactly at it
2 spans
1 span, exactly at the cutoff
--since '1 nano'
2 ns before now, 1 ns before now, now
3 spans
2 spans, starting 1 ns before now
Without a window the first file reports all three spans. I also checked scientific notation at the cutoff and both signed infinite durations. The focused regression test failed on the upstream filter and passed with the fix.
vp run check:changed upstream/main passed on the submitted commit, including typechecking three packages and running all eight selected tests.
Reviewing files that changed from the base of the PR and between 0b69bd3 and 705c1da.
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 trace summarizer now accepts a window with a timestamp and duration. It uses duration-aware cutoffs to filter spans. The CLI constructs the window from --since, and tests cover boundary and sub-millisecond cases. A duplicate import is removed from a desktop test.
Changes: Trace summary window
Layer / File(s)
Summary
Window filtering and boundary tests apps/server/src/cli/trace.ts, apps/server/src/cli/trace.test.ts
makeTraceSpanSummary accepts a window and compares span end times against millisecond or nanosecond cutoffs. Tests cover boundary inclusion, sub-millisecond durations, scientific notation, and skipped lines.
CLI window construction apps/server/src/cli/trace.ts
The CLI passes a window based on the current time and --since duration. The no-spans message uses the presence of the window to determine whether to mention it.
This change makes t3 trace summary --since window membership exact at the cutoff and for very short durations. No concrete merge-blocking risk was found in the supplied context.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(cli): exclude spans before the trace summary window" matches the main change: the trace summary CLI window filter now excludes spans that end before the cutoff. It uses a conventional c…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the nanosecond-to-millisecond rounding error with a reproduction case. The …
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: Title check
Explanation
The title "fix(cli): exclude spans before the trace summary window" matches the main change: the trace summary CLI window filter now excludes spans that end before the cutoff. It uses a conventional commit prefix and names the affected component.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the nanosecond-to-millisecond rounding error with a reproduction case. The Change section explains the integer cutoff fix. The Scope section links issue #42208 and explains the boundary of the fix. The Verification section gives a before/after table, lists the focused regression test, and reports the check command result. It names the model and harness. It does not link an issue that shows the bug, and it does not say why no issue is needed. The description also covers the BrowserSession duplicate import cleanup only in the PR objectives, not in the description. These gaps are minor.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between d2e5de1 and 2954a11.
Files selected for processing: 1
apps/desktop/src/preview/BrowserSession.test.ts
Files with no reviewable changes: 1
apps/desktop/src/preview/BrowserSession.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…sion test"
Main fixed the duplicate import itself in 36d6333; keeping both deletions would remove the import entirely.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixed the CLI clock at 2026-11-24T00:01:00.000Z and ran identical synthetic trace files on Linux x64 through the real Node CLI entry point. Ran trace summary --since 1m, trace summary --since '1 nano', and the no---since control. Base counts were 2 / 3 / 3; head counts were 1 / 2 / 3, as expected. The exact cutoff remains included in both windows. Images below render the captured command output.
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:S10-29 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 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
t3 trace summary --since 1mcan count a span that ended one nanosecond before the window. At current epoch timestamps, converting nanoseconds to floating-point milliseconds can make that span compare equal to the cutoff. A short window such as--since '1 nano'can also round away when subtracted from the current time.Change
Compute the cutoff once from the clock's integer milliseconds and the requested duration in nanoseconds. Compare integer trace timestamps directly to that cutoff, including a span that ends exactly on it. Other accepted numeric spellings keep their millisecond comparison.
Scope
This fixes window membership in one CLI command. #42208 addressed the date printed by the summary. The reproducer below shows the separate counting error.
Verification
I ran the CLI on temporary trace files with the clock fixed at
2026-11-24T00:01:00.000Z. Each row used the same input before and after the fix.--since 1m--since '1 nano'Without a window the first file reports all three spans. I also checked scientific notation at the cutoff and both signed infinite durations. The focused regression test failed on the upstream filter and passed with the fix.
vp run check:changed upstream/mainpassed on the submitted commit, including typechecking three packages and running all eight selected tests.Model: GPT-6. Harness: Codex Desktop.