Adjust for unlimited plan option
This commit is contained in:
@@ -106,6 +106,16 @@ completion quota are intentionally omitted. Keep
|
||||
`packages/web/server/lib/quota/providers/copilot.js` and
|
||||
`packages/vscode/src/quotaProviders.ts` in sync.
|
||||
|
||||
The `/copilot_internal/user` endpoint is undocumented; its quota semantics mirror
|
||||
what `microsoft/vscode-copilot-chat` consumes (`CopilotUserQuotaInfo`). Each
|
||||
snapshot carries `entitlement`, `remaining`, `unlimited`, and
|
||||
`percent_remaining`. Providers must honor these rules:
|
||||
|
||||
- `unlimited: true` renders a percent-less window with an "Unlimited" value label.
|
||||
- Percent math requires a positive `entitlement`; entitlements of `0`, `-1`, or null are unusable.
|
||||
- When entitlement/remaining are unusable, fall back to `100 - percent_remaining`.
|
||||
- Snapshots other than `premium_interactions` (legacy annual plans) yield zero windows.
|
||||
|
||||
## Notes for contributors
|
||||
- Keep provider IDs stable; clients use them directly.
|
||||
- Avoid adding alias-based dispatch in `fetchQuotaForProvider`; dispatch currently expects exact provider IDs.
|
||||
|
||||
Reference in New Issue
Block a user