Skip to content

feat(claude): add Claude Design weekly detail metric#388

Merged
robinebers merged 3 commits into
mainfrom
cursor/claude-design-detail-metric
Apr 18, 2026
Merged

feat(claude): add Claude Design weekly detail metric#388
robinebers merged 3 commits into
mainfrom
cursor/claude-design-detail-metric

Conversation

@robinebers
Copy link
Copy Markdown
Owner

@robinebers robinebers commented Apr 18, 2026

Summary

  • Render the Claude API seven_day_omelette bucket as a new detail-only Claude Design weekly percent line in the Claude plugin, mirroring the existing seven_day_sonnet shape.
  • Document seven_day_omelette in the Claude provider reference.
  • Ignore local .claude/settings.local.json so it stops appearing as untracked.

Scope is intentionally narrow: no change to overview cards, primary progress selection, primaryCandidates, tray wiring, or the local HTTP API shape.

Changes

  • plugins/claude/plugin.json — add detail-scoped Claude Design line between Sonnet and Extra usage spent.
  • plugins/claude/plugin.js — push a weekly percent progress line when data.seven_day_omelette.utilization is numeric; uses ctx.util.toIso for resetsAt.
  • plugins/claude/plugin.test.js — three new cases: numeric utilization renders the line with normalized ISO, missing field omits, non-numeric omits.
  • docs/providers/claude.md — add seven_day_omelette to the /api/oauth/usage example.
  • .gitignore — ignore .claude/settings.local.json.

Test plan

  • bunx vitest run plugins/claude/plugin.test.js (82/82 passing, incl. 3 new cases)
  • Visual: Claude card detail view shows Claude Design line when API returns seven_day_omelette with a numeric utilization
  • Visual: overview/tray/primary progress unchanged

Made with Cursor


Note

Low Risk
Low risk: adds a new optional detail-only usage line driven by an additional API field, plus docs/tests and a .gitignore entry; no auth, request flow, or overview behavior changes.

Overview
Adds a new detail-only weekly usage progress line, Claude Design, sourced from the Claude API seven_day_omelette bucket (rendered only when utilization is numeric and resets_at is normalized via toIso).

Updates the Claude plugin manifest to include the new line, extends provider docs to document the new response field, adds targeted tests for render/omit behavior, and ignores local .claude/settings.local.json.

Reviewed by Cursor Bugbot for commit 4b2e87b. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Adds a new detail-only "Claude Design" weekly percent metric to the Claude plugin using the seven_day_omelette API bucket. No changes to overview, tray, primary progress, or local API shape.

  • New Features
    • Render "Claude Design" weekly percent line in detail when seven_day_omelette.utilization is numeric (limit 100, 7-day window), normalizing resets_at to ISO.
    • Add the line to the Claude plugin detail config and document seven_day_omelette in the provider reference.
    • Tests cover numeric/missing/non-numeric cases and assert ISO normalization using a non-normalized resets_at; ignore .claude/settings.local.json.

Written for commit 4b2e87b. Summary will update on new commits.

Surface seven_day_omelette as a detail-only "Claude Design" weekly
percent line, ignore local Claude settings, and document the new
bucket in the provider reference.

Made-with: Cursor
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 18, 2026

🤖 Augment PR Summary

Summary: Adds a new Claude plugin detail metric to surface the Claude API seven_day_omelette (“Claude Design”) weekly utilization bucket.

Changes:

  • Render a new detail-only Claude Design percent progress line when seven_day_omelette.utilization is present.
  • Register the metric in plugins/claude/plugin.json and add tests for present/missing/non-numeric utilization.
  • Document seven_day_omelette in the Claude provider reference and ignore local Claude settings in .gitignore.
Technical Notes: Uses ctx.util.toIso to normalize resets_at into resetsAt.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread plugins/claude/plugin.js
periodDurationMs: 7 * 24 * 60 * 60 * 1000 // 7 days
}))
}
if (data.seven_day_omelette && typeof data.seven_day_omelette.utilization === "number") {
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 18, 2026

Choose a reason for hiding this comment

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

plugins/claude/plugin.js:726 — typeof ...utilization === "number" will also accept NaN/Infinity, which then trips the runtime progress-line validation (invalid used) and can replace metrics with an error line; consider ensuring the value is finite before pushing the line.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fair point, but intentionally skipping for this PR to stay consistent with the sibling five_hour, seven_day, and seven_day_sonnet blocks, which all use the same typeof === "number" guard without a finite check. The Rust runtime already surfaces non-finite utilization as an error line (see src-tauri/src/plugin_engine/runtime.rs around invalid used), so this is a pre-existing latent behavior shared across all four Claude usage lines. Happy to tighten all of them with Number.isFinite in a follow-up PR if we want the client side to defensively drop the line instead of producing an error row.

Comment thread plugins/claude/plugin.test.js Outdated
ctx.host.http.request.mockReturnValue({
status: 200,
bodyText: JSON.stringify({
seven_day_omelette: { utilization: 7, resets_at: "2099-01-01T00:00:00.000Z" },
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 18, 2026

Choose a reason for hiding this comment

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

plugins/claude/plugin.test.js:507 — This test says it validates resetsAt normalization, but the fixture value is already normalized, so it would still pass even if ctx.util.toIso were removed/bypassed.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Previously the fixture was already in normalized ISO form, so the
assertion on `resetsAt` would pass even if `ctx.util.toIso` were
bypassed. Use a spaced `UTC` input that only matches after
normalization to make the test meaningful.

Made-with: Cursor
@robinebers robinebers merged commit cb16571 into main Apr 18, 2026
4 checks passed
@robinebers robinebers deleted the cursor/claude-design-detail-metric branch April 18, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant