Skip to content

Commit 23f8a3b

Browse files
authored
Merge pull request #39258 from github/repo-sync
Repo sync
2 parents 1c34384 + 3d40626 commit 23f8a3b

File tree

6 files changed

+212
-191
lines changed

6 files changed

+212
-191
lines changed

content/billing/managing-billing-for-your-products/about-billing-for-github-copilot.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ When {% data variables.product.prodname_copilot_short %} works on coding tasks,
7171

7272
This allowance of free premium requests is shared with other {% data variables.product.prodname_copilot_short %} features, such as {% data variables.copilot.copilot_chat_short %}.
7373

74-
When you use {% data variables.copilot.copilot_coding_agent %}, {% data variables.product.prodname_copilot_short %} will make multiple premium requests to complete a single task. Each time {% data variables.product.prodname_copilot_short %} calls the underlying model service, it counts as one premium request.
75-
76-
On average, {% data variables.copilot.copilot_coding_agent %} uses 30-50 premium requests each time it is invoked. The exact number of premium requests will vary depending on the task’s complexity and the number of required steps. See [AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/monitoring-usage-and-entitlements/avoiding-unexpected-copilot-costs).
74+
When you use {% data variables.copilot.copilot_coding_agent %}, {% data variables.product.prodname_copilot_short %} will use one premium request per session. A session begins when you ask {% data variables.product.prodname_copilot_short %} to create a pull request or make one or more changes to an existing pull request.
7775

7876
For more information about {% data variables.copilot.copilot_coding_agent %}, see [AUTOTITLE](/copilot/concepts/about-copilot-coding-agent).
7977

content/copilot/concepts/copilot-billing/understanding-and-managing-requests-in-copilot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following {% data variables.product.prodname_copilot_short %} features can u
3434
| Feature | Premium request consumption |
3535
| ------- | ----------- |
3636
| [{% data variables.copilot.copilot_chat_short %}](/copilot/using-github-copilot/copilot-chat) | {% data variables.copilot.copilot_chat_short %} uses **one premium request** per user prompt, multiplied by the model's rate. |
37-
| [{% data variables.copilot.copilot_coding_agent %}](/copilot/concepts/about-copilot-coding-agent) | {% data variables.copilot.copilot_coding_agent %} will make multiple premium requests to complete a single task. On average, {% data variables.copilot.copilot_coding_agent %} uses **30-50 premium requests** each time it is invoked. The exact number of premium requests will vary depending on the task’s complexity and the number of required steps. {% data variables.copilot.copilot_coding_agent %} uses a fixed multiplier of 1 for the premium requests it uses. |
37+
| [{% data variables.copilot.copilot_coding_agent %}](/copilot/concepts/about-copilot-coding-agent) | {% data variables.copilot.copilot_coding_agent %} uses **one premium request** per session. A session begins when you ask {% data variables.product.prodname_copilot_short %} to create a pull request or make one or more changes to an existing pull request. |
3838
| [Agent mode in {% data variables.copilot.copilot_chat_short %}](/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide#copilot-edits) | Agent mode uses **one premium request** per user prompt, multiplied by the model's rate. |
3939
| [{% data variables.product.prodname_copilot_short %} code review](/copilot/using-github-copilot/code-review/using-copilot-code-review) | When you assign {% data variables.product.prodname_copilot_short %} as a reviewer for a pull request, **one premium request** is used each time {% data variables.product.prodname_copilot_short %} posts comments to the pull request. |
4040
| [{% data variables.copilot.copilot_extensions_short %}](/copilot/building-copilot-extensions/about-building-copilot-extensions) | {% data variables.copilot.copilot_extensions_short %} uses **one premium request** per user prompt, multiplied by the model's rate. |

src/frame/tests/pages.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,42 @@ describe('pages module', () => {
5050
const englishPages = chain(pages)
5151
.filter(['languageCode', 'en'])
5252
.filter('redirect_from')
53-
.map((pages) => pick(pages, ['redirect_from', 'applicableVersions']))
53+
.map((pages) => pick(pages, ['redirect_from', 'applicableVersions', 'fullPath']))
5454
.value()
5555

56+
// Map from redirect path to Set of file paths
57+
const redirectToFiles = new Map()
5658
const versionedRedirects = []
5759

5860
englishPages.forEach((page) => {
5961
page.redirect_from.forEach((redirect) => {
6062
page.applicableVersions.forEach((version) => {
61-
versionedRedirects.push(removeFPTFromPath(path.posix.join('/', version, redirect)))
63+
const versioned = removeFPTFromPath(path.posix.join('/', version, redirect))
64+
versionedRedirects.push({ path: versioned, file: page.fullPath })
65+
if (!redirectToFiles.has(versioned)) {
66+
redirectToFiles.set(versioned, new Set())
67+
}
68+
redirectToFiles.get(versioned).add(page.fullPath)
6269
})
6370
})
6471
})
6572

66-
const duplicates = versionedRedirects.reduce((acc, el, i, arr) => {
67-
if (arr.indexOf(el) !== i && acc.indexOf(el) < 0) acc.push(el)
68-
return acc
69-
}, [])
70-
71-
const message = `Found ${duplicates.length} duplicate redirect_from ${
72-
duplicates.length === 1 ? 'path' : 'paths'
73-
}.
74-
Ensure that you don't define the same path more than once in the redirect_from property in a single file and across all English files.
75-
You may also receive this error if you have defined the same children property more than once.\n
76-
${duplicates.join('\n')}`
73+
// Only consider as duplicate if more than one unique file defines the same redirect
74+
const duplicates = Array.from(redirectToFiles.entries())
75+
.filter(([_, files]) => files.size > 1)
76+
.map(([path]) => path)
77+
78+
// Build a detailed message with sources for each duplicate
79+
const message =
80+
`Found ${duplicates.length} duplicate redirect_from path${duplicates.length === 1 ? '' : 's'}.
81+
Ensure that you don't define the same path more than once in the redirect_from property in a single file and across all English files.
82+
You may also receive this error if you have defined the same children property more than once.\n` +
83+
duplicates
84+
.map((dup) => {
85+
const files = Array.from(redirectToFiles.get(dup) || [])
86+
return `${dup}\n Defined in:\n ${files.join('\n ')}`
87+
})
88+
.join('\n\n')
7789
expect(duplicates.length, message).toBe(0)
7890
})
7991

0 commit comments

Comments
 (0)