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(usage): keep large dashboard logs responsive by Ingwannu · Pull Request #501 · lidge-jun/opencodex

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Jul 26, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Owner

Summary

  • cache only compact usage summaries for an exact file revision/query; never retain normalized request rows after a response
  • cooperatively batch full parses and deduplicate concurrent reads only for the same file identity
  • invalidate summaries on file revision, range expiry, or local-day rollover
  • poll 30-day usage independently from dashboard health/providers/settings at a one-minute cadence

Validation

  • bun test tests/usage-log.test.ts tests/api-usage.test.ts (26 passed)
  • bun run typecheck
  • bun test tests/dashboard-contracts.test.ts (5 passed)
  • full GUI: 288 passed, ESLint passed, production build passed

Closes #500

Sorry, something went wrong.

Uh oh!

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

All reactions
@Ingwannu
fix(usage): keep large dashboard logs responsive
3e19534
@Ingwannu
Ingwannu requested a review from lidge-jun as a code owner July 26, 2026 12:55
@github-actions github-actions Bot added the bug Something isn't working label Jul 26, 2026
@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Ingwannu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0885e85a-605a-4044-b483-c10eded616d8

📥 Commits

Reviewing files that changed from the base of the PR and between 3e19534 and 63b15e5.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml
  • gui/src/pages/use-dashboard-data.ts
  • gui/tests/dashboard-contracts.test.ts
  • src/server/management/logs-usage-routes.ts
  • src/usage/log.ts
  • structure/05_gui-and-management-api.md
  • tests/api-usage.test.ts
  • tests/ci-workflows.test.ts
  • tests/usage-log.test.ts
📝 Walkthrough

Walkthrough

The usage log now caches parsed entries, incrementally processes appends, and performs cooperative rebuilds for management reads. The dashboard fetches usage through an independent polling resource instead of waiting for usage during core health and settings polling.

Changes

Usage performance and dashboard responsiveness

Layer / File(s) Summary
Incremental usage-log cache
src/usage/log.ts
Adds cached JSONL parsing with file identity, size, newline, and suffix validation; unchanged content is reused, safe appends are parsed incrementally, and invalidated content triggers a full rebuild.
Cooperative management usage reads
src/usage/log.ts, src/server/management/logs-usage-routes.ts, tests/usage-log.test.ts, structure/05_gui-and-management-api.md
Adds cooperative full reads and in-flight deduplication for management requests, updates /api/usage to await the management reader, and documents and tests cache invalidation, incremental parsing, and event-loop yielding.
Independent dashboard usage polling
gui/src/pages/dashboard-core-poll.ts, gui/src/pages/use-dashboard-data.ts, gui/tests/dashboard-contracts.test.ts
Removes usage from DashboardCorePoll, adds fetchDashboardUsage, polls it as dashboard-usage:${apiBase} every five seconds, and verifies the core poll no longer includes the usage endpoint.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant useDashboardData
  participant UsageRoute
  participant UsageReader
  Dashboard->>useDashboardData: start core and usage resources
  useDashboardData->>UsageRoute: GET /api/usage?range=30d
  UsageRoute->>UsageReader: readUsageEntriesForManagement()
  UsageReader-->>UsageRoute: cached, incremental, or cooperatively rebuilt entries
  UsageRoute-->>useDashboardData: usage summary
  useDashboardData-->>Dashboard: update usage30d independently
Loading

Suggested labels: enhancement

Suggested reviewers: lidge-jun, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements append-aware caching, rewrite detection, cooperative full reads, and decoupled usage polling, matching #500's responsiveness goals.
Out of Scope Changes check ✅ Passed The changes stay focused on usage-log performance, dashboard polling, tests, and documentation, with no clear unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: improving responsiveness around large usage logs and dashboard polling.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-issue-500-usage-cache

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

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

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Jul 26, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e19534ef3

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/usage/log.ts Resolved

Uh oh!

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

Comment thread src/usage/log.ts Resolved

Uh oh!

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

Comment thread src/usage/log.ts Resolved

Uh oh!

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

Comment thread src/usage/log.ts Resolved

Uh oh!

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

@Ingwannu
fix(usage): preserve read failure diagnostics
6ebf84e
coderabbitai[bot]
coderabbitai Bot reviewed Jul 26, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/usage/log.ts`:
- Around line 425-531: Extract the duplicated cache-validation logic from
usageCacheNeedsFullRead and readUsageEntries into a shared classifier, such as
classifyUsageCacheState, returning reuse, append, or full based on
sameUsageFile, size, timestamps, newline state, and tail-signature checks.
Update both callers to use this single classification while preserving their
existing reuse, append, and full-read behaviors.
- Around line 346-372: Update usageTailSignature to return an independent copy
of the selected tail bytes rather than a subarray view, ensuring usageReadCache
retains only the bounded signature and not the full source buffer. Apply the
same copy-safe behavior to the append-path tail handling around
cache.tailSignature and combinedTail while preserving the existing signature
length and comparison logic.

In `@structure/05_gui-and-management-api.md`:
- Around line 90-97: Translate the Korean Decision Log field labels in the
section containing “Keep five-second dashboard refreshes responsive” into clear
English labels, while preserving the existing bullet content and decision-log
structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3896be8d-f4ba-493f-99c7-c7226e28c968

📥 Commits

Reviewing files that changed from the base of the PR and between 911373d and 3e19534.

📒 Files selected for processing (7)
  • gui/src/pages/dashboard-core-poll.ts
  • gui/src/pages/use-dashboard-data.ts
  • gui/tests/dashboard-contracts.test.ts
  • src/server/management/logs-usage-routes.ts
  • src/usage/log.ts
  • structure/05_gui-and-management-api.md
  • tests/usage-log.test.ts

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/usage/log.ts Resolved

Uh oh!

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

Comment thread src/usage/log.ts Resolved

Uh oh!

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

Comment thread structure/05_gui-and-management-api.md Resolved

Uh oh!

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

Ingwannu and others added 5 commits July 26, 2026 13:23
@Ingwannu
fix(usage): bound dashboard summary caching
6240176
@Ingwannu
fix(usage): reject non-file log paths
42dd815
@Ingwannu
ci: allow Windows suite to finish
1f3edda
@Ingwannu
test(ci): pin split timeout ceilings
79f3daa
@Ingwannu
fix(test): restore CI timeout assertions
63b15e5
@Ingwannu
Ingwannu merged commit 5078ffc into dev Jul 26, 2026
9 checks passed

Uh oh!

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

@Ingwannu Ingwannu mentioned this pull request Jul 26, 2026
[Bug][Performance] Dashboard reparses the entire usage.jsonl every 5 seconds and blocks management APIs #500
Closed
2 tasks done
@lidge-jun
lidge-jun deleted the agent/fix-issue-500-usage-cache branch July 29, 2026 04:29
This was referenced Aug 4, 2026
feat(usage): preserve usage history past the management read window with a daily rollup sidecar #1008
Closed
feat(control-plane): add indexed cursor-paginated request history #1004
Merged
feat(usage): add date filters and daily model breakdown in dashboard (#1058) #1079
Closed
feat(usage): raise the management read entry cap from 200k to 500k #1099
Merged
fix(usage): bound startup hydration tail reads #1256
Closed
This was referenced Aug 12, 2026
fix(usage): disclose the window a truncated read actually covers #1532
Merged
fix(usage): stop per-append 64MiB usage reparses #1620
Merged
[Feature]: add provider/model estimated cost and cache metrics to Usage #1820
Closed
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@Ingwannu
Merge pull request lidge-jun#501 from lidge-jun/agent/fix-issue-500-u…
0085718
…sage-cache

fix(usage): keep large dashboard logs responsive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@lidge-jun lidge-jun Awaiting requested review from lidge-jun lidge-jun is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

bug Something isn't working

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.

1 participant

@Ingwannu
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.