Skip to content

feat(web): add usage limits popup panel#1832

Open
Talimanato wants to merge 4 commits into
MoonshotAI:mainfrom
Talimanato:talimanato/usage-limit-popup
Open

feat(web): add usage limits popup panel#1832
Talimanato wants to merge 4 commits into
MoonshotAI:mainfrom
Talimanato:talimanato/usage-limit-popup

Conversation

@Talimanato

@Talimanato Talimanato commented Jul 17, 2026

Copy link
Copy Markdown

Related Issue

Resolve #1825

Problem

Kimi Web currently exposes conversation context usage through the composer meter, but users cannot see their account limits without leaving the chat and checking the Kimi Code console. This makes it easy to approach a rolling or weekly limit without noticing.

What changed

  • Added an end-to-end managed usage path from the OAuth toolkit through agent-core-v2 and kap-server to Kimi Web. The wire contract carries weekly and rolling limits, reset metadata, booster balance, and stable error codes.
  • Turned the composer context meter into a keyboard-accessible usage limits popup panel. It refreshes when opened and every 60 seconds while visible, with localized labels, reset times, loading, empty, sign-in, and unavailable states.
  • Restricted account-limit requests to the managed Kimi Code OAuth provider. Other providers retain the context meter without requesting managed usage data.
  • Made the popup mutually exclusive with the model, permission, and mode menus, and added graceful fallback for older backends without the usage endpoint.
  • Extracted usage formatting into pure helpers and added regression coverage for payload parsing, wire mapping, authentication errors, client fallbacks, durations, reset hints, and row identity.

This approach reuses the existing composer context entry point and managed OAuth usage service, keeping the UI compact while avoiding behavior changes for custom providers.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 18c444c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@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: 6f016d11d8

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

Comment thread apps/kimi-web/src/components/chat/ContextUsagePanel.vue Outdated

@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: d959c83220

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

Comment thread apps/kimi-web/src/lib/usagePanelPosition.ts Outdated
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.

feat(web): add a usage limits popup panel to the composer

1 participant