GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): trace summary prints the correct date at a millisecond boundary by only21mil · Pull Request #42208 · pingdotgg/t3code

Conversation

@only21mil

@only21mil only21mil commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Problem

t3 trace summary can print the wrong end date. It reads each span's endTimeUnixNano as a JavaScript number before dividing by 1,000,000, and a number cannot hold a 19-digit nanosecond time exactly. A span that ended at 2026-11-23T23:59:59.999999999Z rounds up to 1795478400000000000, so the summary says the spans ran until 2026-11-24T00:00:00.000Z, the next day.

Change

apps/server/src/cli/trace.ts now decodes decimal integer endTimeUnixNano values (what every trace writer emits) as a bigint; any other spelling the old command accepted still decodes as a number, and those spans print the exact date they printed before. The Date-range skip, the --since window, and the /min rate keep their existing float math (unchanged lines). For printed dates, each span's printed millisecond is Number(ns / 1_000_000n) for a bigint (the conversion unixNanoToDateTime in diagnostics/TraceDiagnostics.ts uses) or the old float value for other spellings; the summary prints the earliest and latest of those.

Scope

A small fix of an obvious bug in one CLI command, with no issue because the repro below is the whole report. Nothing else in the summary changes: accepted lines, window, rate, and skipped-line counts behave as before.

Verification

An AI agent (Claude Opus 5.5 orchestrating, T3 Code Nightly) ran these checks on Linux with Node 26.13.1.

  • Tests in apps/server/src/cli/trace.test.ts: the boundary test (keeps sub-millisecond windows and rates without rounding printed dates) uses a sub-millisecond --since cutoff, one span just before it (dropped), and two after it whose float values both round up into the next millisecond; it asserts span count (2), printed /min cell (120000.0, same as main), and from 2026-11-23T23:59:59.998Z to 2026-11-23T23:59:59.999Z (main prints both one millisecond late). It fails on main, on two earlier branch versions (whole-ms truncation; exact-nanosecond rate), and on a mutant that prints the first date from a float. A new test (prints end times in other numeric spellings as before) checks that "1795478400001e6" prints to 2026-11-24T00:00:00.001Z; it fails on a version that converted those spellings back to bigint (it printed .000Z).
  • vp run check:changed passes (format, lint, knip, typecheck, tests beside the changed files).
  • Real CLI, same two-span trace file on both commits, node apps/server/src/bin.ts trace summary --base-dir <scratch dir>:
main 43a0e74 This branch 25af0a4
2 spans ended from 2026-11-23T23:59:00.000Z to 2026-11-24T00:00:00.000Z (1 min). 2 spans ended from 2026-11-23T23:59:00.000Z to 2026-11-23T23:59:59.999Z (1 min).

No screen changes: this is CLI text output only, so there are no screenshots.

Generated with Gemini 4 Neon in T3 Code Nightly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@only21mil
fix(cli): trace summary prints the correct date at a millisecond boun…
25af0a4
…dary

t3 trace summary read endTimeUnixNano as a float, so a span ending at
23:59:59.999999999Z rounded up to the next day. Decode decimal end
times as a bigint (other spellings keep the old number decode) and
print the first and last end times from the exact value. The window,
rate and skip logic keep their existing float math.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Trace summary parsing now accepts bigint-string and finite-number-string end times. It uses millisecond values for range and rate calculations while tracking printed timestamp bounds separately. Tests cover fractional-millisecond windows and scientific-notation timestamps.

Changes: Trace timestamp handling

Layer / File(s) Summary
Timestamp decoding and summary bounds
apps/server/src/cli/trace.ts, apps/server/src/cli/trace.test.ts
The summary accepts bigint and finite-number timestamp strings. It uses millisecond values for range and rate calculations and tracks printed timestamp bounds separately. Tests cover fractional-millisecond windows and scientific-notation timestamps.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 9d5ff

Merge Risk: ⚪ Minimal · up to 9d5ff

This fixes the date printed by the trace summary at a millisecond boundary and leaves the window, rate, and skip logic unchanged. The change is small, covered by new tests, and easy to revert, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a CLI trace summary fix so printed dates are correct at a millisecond boundary. The change decodes decimal integer endTimeUnixNano as bigint so printed end dates no longer …
Description check Passed The description covers the template sections: Problem, Change, Scope, and Verification. It explains the float rounding bug with a concrete example, describes the bigint decoding and the unchanged floa…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: a CLI trace summary fix so printed dates are correct at a millisecond boundary. The change decodes decimal integer endTimeUnixNano as bigint so printed end dates no longer round up into the next day. The title is specific and follows the conventional commit style of the repository template.

Full details: Description check

Explanation

The description covers the template sections: Problem, Change, Scope, and Verification. It explains the float rounding bug with a concrete example, describes the bigint decoding and the unchanged float math for window, rate, and skip logic, and gives a scope rationale for having no linked issue. Verification lists focused tests, a passing check:changed run, a real CLI before/after comparison, and states that no screenshots apply. The agent model line is present. The description is mostly complete, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: ae45e00
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be36db53-b32d-469d-81b9-c04a48d11bb7
Commits

Reviewing files that changed from the base of the PR and between ae45e00 and 25af0a4.

Files selected for processing: 2

  • apps/server/src/cli/trace.test.ts
  • apps/server/src/cli/trace.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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@juliusmarminge
Merge remote-tracking branch 'origin/main' into fix/cli-trace-summary…
9d5ffc5
…-bigint-timestamp
@juliusmarminge

juliusmarminge commented Nov 24, 2026

Copy link
Copy Markdown
Member

Evidence

Run the real CLI on fresh synthetic trace files containing two 1ms rpc spans, ending at 1795478340000000000 and 1795478399999999999. Repeat with the last value changed to 1795478399999990000 as a control. Environment: Linux x86_64, Node v26.13.1. Images render captured CLI output.

Before After
ae45e00923 9d5ffc5f6b
Before: boundary prints next day After: boundary prints correct date

The boundary changes from 2026-11-24T00:00:00.000Z to 2026-11-23T23:59:59.999Z. The control remains correct, and all runs retain 2 spans at 2.0/min.

Reproduction driver · Before transcript · After transcript

Not shown:

  • The reproduction verifies the printed date, counts, rates, and control case; --since filtering was not separately exercised.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit c6e32aa into pingdotgg:main Nov 24, 2026
55 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
@jadelike-wine jadelike-wine mentioned this pull request Nov 25, 2026
fix(cli): exclude spans before the trace summary window #42571
Merged
@patroza patroza mentioned this pull request Nov 25, 2026
Merge upstream main through feecca53e4dc patroza/t3code#675
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@only21mil @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.