Repository navigation
Conversation
Greptile SummaryThis PR fixes a browser main-thread freeze on the Usage page when a session spans a DST clock change. It replaces the ambiguous local Confidence Score: 5/5Safe to merge; the DST-safe stepping is correct and all edge cases are handled with no blocking issues. All findings are P2 or lower. The core logic replacing setToHourEnd with setHours(h+1,0,0,0) is the standard JS approach for DST-safe hour advancing. Loop termination is guaranteed in all cases by the monotonicity guard that falls back to endMs. Regression tests explicitly cover DST fallback, spring-forward, exact boundaries, and the hour filter path. No files require special attention. Reviews (1): Last reviewed commit: "fix(usage): handle Daylight saving time ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fc7ce4206
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }); | ||
|
|
||
| afterEach(() => { | ||
| process.env.TZ = ORIGINAL_TZ; |
There was a problem hiding this comment.
Restore TZ by deleting env var when unset
If ORIGINAL_TZ is undefined (a common default in CI), process.env.TZ = ORIGINAL_TZ writes the literal string "undefined" instead of unsetting the variable. That leaks an invalid timezone into later tests running in the same Vitest worker and can cause unrelated local-time assertions to fail intermittently. Restore with delete process.env.TZ when there was no original value.
Useful? React with 👍 / 👎.
4fc7ce4 to
813b502
Compare
813b502 to
3d9604e
Compare
3d9604e to
a05a1c8
Compare
10c0910 to
5c0ef3c
Compare
|
Thanks for the contribution. This PR has been inactive for a while and still is not in a landable state. Close this PR as abandoned: it contains a plausible fix for a still-relevant DST hour-slicing bug, but its head has been inactive since April 28, 2026, is currently conflict-dirty, has no real after-fix behavior proof, and retains a test-environment cleanup defect. So I’m closing this as inactive for now. If you pick the work back up, push a rebased branch with green checks and reopen (or open a fresh PR) and it will be reviewed again. Review detailsBest possible solution: Preserve the DST-safe next-boundary design in a fresh, rebased PR that fixes the TZ restoration, resolves current conflicts, and includes redacted real Usage-page proof across a DST boundary. Do we have a high-confidence way to reproduce the issue? No high-confidence executed reproduction is available in this review. Current main retains the local end-of-hour cursor logic described by the report, so the failure path is source-reproducible but not live-verified here. Is this the best way to solve the issue? No. The shared next-hour-boundary helper is the right general direction, but this stale branch is conflict-dirty, lacks real behavior evidence, and needs the TZ cleanup repair before it is a safe solution vehicle. Security review: Security review cleared: The three-file UI and test change introduces no concrete security or supply-chain concern. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against e04ea7916c5b. |
5c0ef3c to
bab8ccc
Compare
bab8ccc to
49e0900
Compare
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
This fixes a Control UI Usage-page freeze when a long session spans a local Daylight saving time (DST) transition.
Today the hour-slicing code computes a local
:59:59.999hour end from the current wall-clock time. In a repeated local hour at Daylight saving time (DST) fallback, that can resolve to an earlier instant and stop cursor progress.This change switches Usage hour slicing and selected-hour filtering to monotonic next-hour-boundary stepping so aggregation always moves forward in the selected timezone.
Why
This fixes cases where:
Without this change, the Control UI can wedge the browser main thread while rendering Usage data for long sessions.
Changes
getNextHourStart()plus bounded next-hour stepping inui/src/ui/views/usage-metrics.ts[cursor, nextBoundary)so exact boundaries do not create zero-duration bucketsui/src/ui/views/usage.tsthrough the same DST-safe helper instead of maintaining a duplicate loopTesting
AI-assisted: yes
Built and tested in: Codex App
Model: GPT-5.4
Reasoning effort: Extra High
Testing: focused local test
pnpm --dir ui exec vitest run --config vitest.node.config.ts src/ui/views/usage-metrics.node.test.ts