Skip to content

CAPIError: <duration> not parsed correctly. "Please try again in <duration>" #2385

@el-j

Description

@el-j

Describe the bug

!please move this bug where it belongs correctly! did not know correct repo to be honest!

<duration> not correctly parsed in ui

when hitting a rate limit in online session. the banner announcement does not correctly display the "duration" the user has to wait. the <duration> keyword seems not to be replaced correctly.

the main ERROR in the copilot run in deeper investigation reports a full ERROR.text with correct text and time in hours like:

"name": "CAPIError",
"text": "Sorry, you've hit a rate limit that restricts the number of Copilot model requests you can make within a specific time period. Please try again in 3 hours. Please review [...]

Affected version

copilot chat online and vscode

Steps to reproduce the behavior

  1. hit capa rate limit
  2. try again
  3. duration not parsed correctly in banner
Image

Expected behavior

see the time till CAPIError is gone correctly in the chat ui and banner report.
why not use error.text as it has correct 3h in my case.

ADDITIONAL:
vscode plugin should also show the time:
Image

model-picker should also show usage-rates for their specific capacity and when reset in vscode

super nice would be also an upgrade for the chat-input and the menu item to show state of CAPALimit (with timer?) to the user directly

Image

Additional context

Full error message:

ERROR: {
  "name": "CAPIError",
  "text": "Sorry, you've hit a rate limit that restricts the number of Copilot model requests you can make within a specific time period. Please try again in 3 hours. Please review our Terms of Service (https://docs.github.com/site-policy/github-terms/github-terms-of-service). If the problem persists, please contact GitHub Support, including the request ID `A415:358C27:A0255D:D0DE92:69C91350`. To retry, leave a comment on this pull request asking Copilot to try again.",
  "stack": "CAPIError: 429 Sorry, you've exceeded your rate limits. Please review our [Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service).\n    at _0x3b16a6.fromAPIError (file:///home/runner/work/_temp/***-action-main/dist/index.js:28:4630535)\n    at i1e.getCompletionWithTools (file:///home/runner/work/_temp/***-action-main/dist/index.js:28:4648479)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async hae.getCompletionWithTools (file:///home/runner/work/_temp/***-action-main/dist/index.js:28:4781454)\n    at async pHe.runCompletionWithTools (file:///home/runner/work/_temp/***-action-main/dist/index.js:150:38027)\n    at async _0x2e1183 (file:///home/runner/work/_temp/***-action-main/dist/index.js:150:35816)\n    at async pHe.agent (file:///home/runner/work/_temp/***-action-main/dist/index.js:150:36111)\n    at async pHe.runAgentLoop (file:///home/runner/work/_temp/***-action-main/dist/index.js:150:45768)\n    at async pHe.runAgentCore (file:///home/runner/work/_temp/***-action-main/dist/index.js:150:43298)\n    at async pHe.runAgentCoreAndEvaluate (file:///home/runner/work/_temp/***-action-main/dist/index.js:150:77846)",
  "message": "429 Sorry, you've exceeded your rate limits. Please review our [Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service).",
  "code": "user_global_rate_limited:pro",
  "request_id": "00000-203a7cdd-4af8-4d10-ae63-8b214c5df9e9",
  "ghRequestId": "A415:358C27:A0255D:D0DE92:69C91350",
  "service": "capi",
  "skipReport": false,
  "isVisionFlow": false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions