Skip to content

fix(ui): prevent Usage hour filters from freezing during DST - #146919

Merged
steipete merged 1 commit into
mainfrom
codex/v8-usage-dst-progress
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/v8-usage-dst-progress

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #146914. Related: #61335, which previously identified the DST traversal problem.

What Problem This Solves

Fixes Usage hour filtering freezing when a session crosses the repeated local hour at the end of daylight saving time.

User Impact

Users can select hours and clear filters across clock changes. Session-span allocation also preserves elapsed time across repeated hours, skipped hours, fractional-hour transitions, and exact millisecond boundaries.

Why This Change Was Made

Local Date setters can resolve the second occurrence of an hour back into its first occurrence, leaving the traversal cursor unchanged. Both affected loops now share a numeric boundary calculation that always advances and splits at an earlier timezone transition when necessary. Allocation uses adjacent half-open intervals; filtering still includes the final activity instant. No new cache, configuration, or persistence is introduced.

The current Gateway emits zero-token buckets for timestamped messages without model usage. Those sessions reach the span-based hour filter, so this is reachable with current responses. The earlier report by rex993 in #61335 is retained as context.

Evidence

  • The new real-timezone regression fails on unchanged main: the public hour-filtering call does not finish before its 10-second child-process bound. It passes with this repair. A separate full Usage-render benchmark had exposed the same baseline hang before any performance timing began.
  • All 68 metrics and view tests pass. New cases exercise Los Angeles folds/gaps, Lord Howe half-hour changes, Chatham transitions at :45, Kathmandu, UTC, inclusive endpoints, and allocation across a two-millisecond span.
  • Both canonical bundled calendar browser cases pass on Windows Chromium 153 with a mocked Gateway. The new case verifies current zero-token response data, actual hour-2 and absent-hour selection, and filter clearing; the existing skipped-midnight case also passes. Synthetic capture and request evidence were inspected. This is browser boundary proof, not a live Gateway or provider run.
  • Independent review through P2 found no actionable issues. All 18 test type graphs, UI types, selected guards, i18n, targeted lint, formatting, and diff checks pass. The production export scan passes; the aggregate export scan retains the two reproduced baseline script exports, canonicalProviderName and listPackagedStaticExtensionAssetOutputs.

The initial browser attempt had an incorrect expected recent-sort order and failed before hour selection; the corrected exact-order assertion passes without changing the tested flow or timeouts. Browser proof and review preceded type-only tuple annotations and two lint-only fixture object-copy rewrites. Their data and runtime behavior are unchanged, and final type/lint checks pass. Current CI 34750955653 and its required openclaw/ci-gate pass at 8da6effcea90bde3e2a1fcdadb0e246bb7ceaa4c. Native preparation and merge remain pending.

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 10:05
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:13 AM ET / 10:13 UTC.

ClawSweeper review

What this changes

Repairs Usage hour filtering and elapsed-time allocation across daylight-saving transitions, with timezone regressions and browser coverage for selecting and clearing filters.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: fetched main and the latest release retain the freezing traversal. No actionable introduced defect was found, and the earlier DST proposal was closed unmerged.

Priority: P2
Reviewed head: 8da6effcea90bde3e2a1fcdadb0e246bb7ceaa4c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful timezone and browser regressions and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor gate does not apply. Reported Windows Chromium coverage exercises the actual Usage filter against a mocked Gateway; it is supporting browser-boundary evidence, not an independently inspected live-Gateway run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor gate does not apply. Reported Windows Chromium coverage exercises the actual Usage filter against a mocked Gateway; it is supporting browser-boundary evidence, not an independently inspected live-Gateway run.
Evidence reviewed 8 items Current main still needs the repair: Fetched main retains setToHourEnd and cursor = nextMs + 1 in both affected loops. The metrics module is unchanged between the pinned merge base and fetched main.
Introduced repair and interval semantics: The introduced production patch replaces the shared local setter with advancing numeric boundaries, splits within-hour offset transitions, preserves every elapsed millisecond, and explicitly checks the inclusive filtering endpoint. Precise token-bucket selection remains unchanged.
Reachable production input: The rollup creates quarter-hour token entries even when their totals are zero. The UI skips these entries and reaches session-span filtering through renderUsage, making the supplied repeated-hour scenario reachable.
Findings None None.
Security None None.

How this fits together

The Control UI Usage page turns Gateway session summaries into charts and filtered session lists. Hour traversal handles sessions without usable token buckets using their first and last activity timestamps.

flowchart TD
  A[Gateway session summaries] --> B{Usable token buckets?}
  B -->|Yes| C[Map precise activity hours]
  B -->|No| D[Traverse session activity span]
  E[Local or UTC selection] --> D
  D --> F[Advance through hour and clock boundaries]
  C --> G[Usage charts and filtered sessions]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +15, Tests +390. Total +405 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 31 16 +15
Tests 2 390 0 +390
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 421 16 +405

Review metrics

Metric Value Why it matters
Timezone regression coverage 5 zones; 9 allocation scenarios plus repeated-hour filtering Coverage distinguishes full-hour, fractional-hour, and millisecond boundaries that a fixed elapsed-hour step would mishandle.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #146914
Summary: This PR is the current implementation candidate for the paired report; the earlier unmerged proposal documents the same traversal failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one advancing boundary calculation for both span consumers while preserving precise buckets, instantaneous sessions, and inclusive hour filtering.

Do we have a high-confidence way to reproduce the issue?

Yes: the supplied Los Angeles timestamps and zero-token response reach a current-main loop whose cursor repeats at the second 01:00. This review verified the source path without executing it; the report records a bounded baseline timeout.

Is this the best way to solve the issue?

Yes: the patch repairs the shared traversal owner without changing configuration or storage, and handles fractional-hour transitions more accurately than a fixed one-hour increment.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 58dce7657690.

Labels

Label changes:

  • add P2: This repairs a deterministic Usage-page hang under a specific DST and session-data combination, with no demonstrated broader runtime outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor gate does not apply. Reported Windows Chromium coverage exercises the actual Usage filter against a mocked Gateway; it is supporting browser-boundary evidence, not an independently inspected live-Gateway run.

Label justifications:

  • P2: This repairs a deterministic Usage-page hang under a specific DST and session-data combination, with no demonstrated broader runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor gate does not apply. Reported Windows Chromium coverage exercises the actual Usage filter against a mocked Gateway; it is supporting browser-boundary evidence, not an independently inspected live-Gateway run.

Evidence

What I checked:

  • Current main still needs the repair: Fetched main retains setToHourEnd and cursor = nextMs + 1 in both affected loops. The metrics module is unchanged between the pinned merge base and fetched main. (ui/src/pages/usage/metrics.ts:231, 58dce7657690)
  • Introduced repair and interval semantics: The introduced production patch replaces the shared local setter with advancing numeric boundaries, splits within-hour offset transitions, preserves every elapsed millisecond, and explicitly checks the inclusive filtering endpoint. Precise token-bucket selection remains unchanged. (ui/src/pages/usage/metrics.ts:230, 8da6effcea90)
  • Reachable production input: The rollup creates quarter-hour token entries even when their totals are zero. The UI skips these entries and reaches session-span filtering through renderUsage, making the supplied repeated-hour scenario reachable. (src/infra/session-cost-usage-rollup.ts:586, 8da6effcea90)
  • Existing user contract: The Usage documentation defines hour filters as selecting active sessions and supports Local or UTC hourly charts across daylight-saving transitions. Public docs: docs/web/control-ui/feature-reference.md. (docs/web/control-ui/feature-reference.md:92, 8da6effcea90)
  • Latest release retains the defect: Source at the supplied v2026.9.4 release commit still uses the ambiguous local setter and the original span traversal; this repair is not already present there. (ui/src/pages/usage/metrics.ts:208, 3a9d69db306c)
  • Regression coverage and reported browser result: The complete supplied PR body reports a bounded baseline timeout, 68 passing metrics/view tests, and both calendar browser cases passing on Windows Chromium 153 with a mocked Gateway. The added browser case exercises the registered Usage page, selects hour 2 and an absent hour, and clears the filter. Source inspection confirms that coverage; no tests were executed during this read-only review, and no capture files were available in the supplied scratch directory. (ui/src/e2e/usage-calendar-boundaries.e2e.test.ts:10, 8da6effcea90)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 1393a71 into main Sep 13, 2026
186 checks passed
@steipete
steipete deleted the codex/v8-usage-dst-progress branch September 13, 2026 10:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* refs/heads/temp/pr-146883: (159 commits)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* refs/heads/temp/pr-146833: (43 commits)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-146802: (51 commits)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  fix(backup): preserve discovery under concurrent state writes (#146912)
  fix: keep queued deliveries in their original state directory (#146917)
  fix(discord): settle voice waveform work before releasing input (#146885)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
…ssion-list-roster-batch-20260913

* commit 'f513c0f345f7f2514c49ccfbc00adc3f78b9a755': (46 commits)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  fix: share Doctor lifecycle coordination with SQLite workers (#146714)
  fix: retain native session model provenance (#146801)
  fix: settle embedded transcript repairs before session cleanup (#146842)
  feat(macos): improve agent navigation and chat layout (#146531)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Usage hour filtering freezes during the repeated daylight-saving hour

1 participant