You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For code reviews, follow guidelines, tests, and validate instructions. For creating or updating pull requests or branches, follow the steps instructions.
7
+
For code reviewsand for creating or updating pull requests, follow the Guidelines, Tests, and Validate sections below.
8
8
9
9
## Guidelines
10
10
11
+
- Before you make a new branch, make sure you have the latest changes by running `git checkout main && git pull`.
11
12
- If available, use ripgrep (`rg`) instead of `grep`.
12
13
- When using gh cli in double-quoted strings, escape backticks to prevent bash command substitution. In single-quoted strings, backticks do not need escaping.
13
14
- All scripts should be listed in `package.json` and use `tsx`.
@@ -17,6 +18,9 @@ For code reviews, follow guidelines, tests, and validate instructions. For creat
17
18
- We use absolute imports, relative to the `src` directory, using the `@` symbol. For example, `getRedirect` which lives in `src/redirects/lib/get-redirect.ts` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`. The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'`
18
19
- For updates to the content linter, read important information in `src/content-linter/README.md`.
19
20
- Do not use git force push, and avoid git rebase.
21
+
- When reading issues and pull requests, read all comments as well.
22
+
- When you are updating an existing pull request, after you commit and push, _concisely_ comment on the pull request that you are GitHub Copilot and what changes you made and why.
23
+
- When running in agentic mode, offer the human the option to wait for and review CI checks and automatic Copilot code review comments.
20
24
21
25
## Tests
22
26
@@ -79,30 +83,6 @@ Run the following commands to validate your changes:
79
83
-`npm run prettier`
80
84
-`npm run lint`: you can include `-- --fix`
81
85
82
-
## Steps
83
-
84
-
0. Ask the human if they would like you to follow these steps.
85
-
1. If this is new work, make sure you have the latest changes by running `git checkout main && git pull`. If this is existing work, update the branch you are working on with the head branch -- usually `main`.
86
-
2. If the human provides a GitHub issue, use MCP or gh cli to read the issue and all comments.
87
-
3. Begin by evaluating impact, effort, and estimate non-test lines of code that will change. Ask for more context and examples if needed.
88
-
4. If you are running in agentic mode, _stop_ at this point and request approval from the human.
89
-
5. If you need to add or change tests, work on tests before implementing.
90
-
6. Implement the changes needed. If you are running in agentic mode, _stop_ and ask questions at decision points. Please list the options, pros and cons for each decision needed.
91
-
7. Validate your changes before making any commits. See "Validate".
92
-
8. Validate that any new or changed tests pass. See "Tests".
93
-
9. Validate that these changes meet our guidelines. See "Guidelines".
94
-
10. If you are running in agentic mode, _stop_ at this point and request review before continuing. Suggest how the human should review the changes.
95
-
11. If a branch and pull request already exist, commit and push, then _concisely_ comment on the pull request that you are GitHub Copilot and what changes you made and why.
96
-
12. If this is new work and no pull request exists yet, make a pull request:
97
-
- label "llm-generated"
98
-
- draft mode
99
-
- include "fixes owner/repo#issue" or "towards owner/repo#issue" as appropriate
100
-
13. If you are in agentic mode, offer to wait for CI to run and check that it passes. If the human agrees, verify in CI: `sleep 240 && gh pr checks $number`. Address all failures, don't assume they're flakes.
101
-
14. If you are in agentic mode, offer to do any or all of:
102
-
- mark the pull request as ready,
103
-
- assign the issue to the human if it is not already assigned,
104
-
-_concisely_ comment on the issue explaining the change, indicating you are GitHub Copilot.
105
-
106
86
## Logger
107
87
108
88
Use `createLogger` from `@/observability/logger` instead of `console.log` in server-side code.
Found with the `npm run find-orphaned-assets` and `npm run -s reusables -- find unused` scripts.
108
+
Found with the `npm run find-orphaned-assets`, `npm run -s reusables -- find unused`, and `npm run find-orphaned-tables` scripts.
104
109
105
110
The orphaned files workflow file .github/workflows/orphaned-files-check.yml runs every Monday at 16:20 UTC / 8:20 PST.
106
111
107
-
If you are the first responder, please spot check some of the unused assets to make sure they aren't referenced anywhere. Then, approve and merge the pull request.
112
+
If you are the first responder, please spot check some of the unused assets, reusables, and tables to make sure they aren't referenced anywhere. Then, approve and merge the pull request.
108
113
109
114
For more information, see [Doc: Orphaned Assets](https://github.com/github/docs-engineering/blob/main/docs/orphaned-assets.md) and [Doc: Reusables CLI](https://github.com/github/docs-internal/tree/main/src/content-render/scripts/reusables-cli).
Copy file name to clipboardExpand all lines: content/copilot/concepts/billing/budgets-for-usage-based-billing.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ For a complete view of all licensed users regardless of activity, use the **AI u
34
34
35
35
### Cost center budget
36
36
37
-
A cost center budget caps metered charges for a defined group of users or an organization. It does not limit how much a team draws from the pool. It is only active after the shared pool is exhausted.
37
+
A cost center budget caps metered charges for a defined group of users or an organization. It does not limit how much a team draws from the pool. It is only active after the shared pool is exhausted. A cost center budget **does not extend or override a user-level budget**: if a user has reached their user-level budget, they are blocked even if their cost center still has remaining budget.
38
38
39
39
When a cost center's budget is exhausted, only users in that cost center are blocked. Other users and cost centers are unaffected.
40
40
@@ -74,7 +74,7 @@ When someone in your enterprise uses {% data variables.product.prodname_copilot_
74
74
75
75
Each request for an {% data variables.product.prodname_ai_credit_singular %}-consuming feature goes through these checks:
76
76
77
-
1.**User-level budget check.** The system first checks whether the user has exceeded their user-level budget. If yes, the request is blocked immediately—user-level budgets are always a hard stop. If no (or no ULB is set), the request continues.
77
+
1.**User-level budget check.** The system first checks whether the user has exceeded their user-level budget. If yes, the request is blocked immediately. ULBs are always a hard stop, and no other budget can override or supplement them. If no (or no ULB is set), the request continues.
78
78
1.**Shared pool check.** Next, the system checks whether the shared pool has {% data variables.product.prodname_ai_credits_short %} remaining. If yes, the request is served from the pool at no extra cost. If the pool is empty, the request moves to metered usage at {% data variables.product.prodname_ai_credits_value %} per {% data variables.product.prodname_ai_credit_singular %}.
79
79
1.**Cost center, organization, or enterprise check.** For metered usage, the system checks budgets in the following order:
80
80
@@ -89,13 +89,15 @@ Each request for an {% data variables.product.prodname_ai_credit_singular %}-con
89
89
90
90
## How user-level budgets and spending limits interact
91
91
92
-
User-level budgets and spending limits are independent controls that serve different purposes. User-level budgets control how much each person can consume. Spending limits control how much metered usage your organization will pay for.
92
+
User-level budgets and spending limits are independent controls that serve different purposes. ULBs control how much each person can consume. Spending limits control how much metered usage your organization will pay for.
93
93
94
-
If these are not aligned, users can get blocked unexpectedly. The system applies a "lowest remaining headroom wins" rule: whichever budget has the least capacity remaining blocks the user first, regardless of what other budgets still have available. For example, if a user has $5 USD remaining on their individual user-level budget but the enterprise budget only has $1 USD remaining, the enterprise budget blocks them—even though their personal budget isn't exhausted.
94
+
If these are not aligned, users can get blocked unexpectedly. The system applies a "lowest remaining headroom wins" rule: whichever budget has the least capacity remaining blocks the user first, regardless of what other budgets still have available. For example, if a user has $5 USD remaining on their individual ULB but the enterprise budget only has $1 USD remaining, the enterprise budget blocks them, even though their personal budget isn't exhausted.
95
95
96
-
This means that if your user-level budgets collectively allow more consumption than the shared pool provides, the difference spills over into metered charges. If your enterprise budget is too low to cover that gap, users get blocked before they reach their individual limits.
96
+
This means that if your ULBs collectively allow more consumption than the shared pool provides, the difference spills over into metered charges. If your enterprise budget is too low to cover that gap, users get blocked before they reach their individual limits.
97
97
98
-
When you raise user-level budgets, check that your spending limits can still cover the resulting gap.
98
+
When you raise ULBs, check that your spending limits can still cover the resulting gap.
99
+
100
+
The reverse is also true: raising a cost center or enterprise budget does not unblock a user who has hit their ULB. For example, if a user exhausts their $5 USD ULB at the same moment the shared pool runs out, they cannot consume from any remaining cost center budget, even if that cost center has $10 USD remaining. The ULB is a total cap on that user's consumption across both pool and metered phases. To unblock them, you must raise their individual ULB or increase the universal ULB.
0 commit comments