github / github/copilot-cli

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

Open
#2,385 0 comments 0 reactions 0 assignees View on GitHub
area:models area:terminal-rendering
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the bug

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

**``** 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 `` 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:

```json
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
}
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how CAPIError and its error.text are handled when a rate limit reaches the chat UI and banner, including the VS Code plugin. Reproduce the rate-limit flow and compare the displayed message with the full error text; done means the wait duration is shown correctly wherever this issue’s affected interfaces report the limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
cli, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.