Skip to content

feat(quota): support Antigravity quota history - #702

Open
uvwt wants to merge 1 commit into
Willxup:mainfrom
uvwt:feat/antigravity-quota-history
Open

uvwt wants to merge 1 commit into
Willxup:mainfrom
uvwt:feat/antigravity-quota-history

Conversation

@uvwt

@uvwt uvwt commented Nov 11, 2026

Copy link
Copy Markdown

Summary

Support quota history recording, querying, and multi-series chart visualization for �ntigravity credentials:

  • Backend Observation & Storage: Extend QuotaWindowKey / QuotaWindowRole and BuildMainQuotaObservations to map each Antigravity model group and bucket metric (e.g. �ntigravity-gemini-models/5h, �ntigravity-claude-and-gpt-models/weekly) into quota_cycles and quota_percent_segments without altering existing codex or claude primary/secondary window semantics.
  • History Lookup & Cycle Deletion: Allow �ntigravity credentials in GetCodexQuotaHistory and DeleteCodexQuotaHistoryCycle, preserving strict primary / secondary validation for codex and claude.
  • Frontend Multi-Series Chart: Enable the Quota History tab for �ntigravity in CredentialDetailDrawer and add AntigravityQuotaHistoryPanel to render multi-model/window remaining-percentage series with interactive legend toggling and tooltips.

Verification

  • go build ./... and go test ./internal/quota/test ./internal/repository/test ./internal/repository/migration/test -count=1 — passed.

pm --prefix web run typecheck and
pm --prefix web run build — passed.

  • Verified end-to-end on live deployment with an active Antigravity credential across 4 group/window buckets (5h and weekly).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T02:12:35.066565Z f8042cb PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: f8042cb706

ℹ️ 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".

},
},
scales: {
x: { ticks: { color: theme.textSecondary, maxRotation: 0, autoSkip: true, maxTicksLimit: 6 }, grid: { color: theme.grid } },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a time-proportional x-axis for quota history

When observations have unequal gaps—for example, samples one hour apart followed by a two-day polling gap—this configuration leaves the line chart on Chart.js's default category x-scale. The timestamps are only label strings, so both intervals occupy the same horizontal distance. Because labels combine change points from every series, another model's observations also alter the apparent consumption rate of an otherwise unchanged series. Supply numeric timestamp coordinates with a linear or time x-scale, formatting ticks separately.

Useful? React with 👍 / 👎.

}, [series])

const data = useMemo<ChartData<'line', Array<number | null>, string>>(() => ({
labels: labels.map((time) => new Date(time).toLocaleString()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the project timezone in observation labels

When the browser timezone differs from the server's configured TZ, this conversion shifts every chart label and tooltip into the browser's zone without identifying that zone. For example, an API observation at 08:00+08:00 appears as midnight in a UTC browser. The existing CodexQuotaHistoryPanel deliberately uses createQuotaHistoryDateTimeFormatter to preserve the API's wall-clock time, so the new panel gives inconsistent times for the same instant. Preserve the source offset or project timezone and reuse the shared formatter.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant