MCPcopy
hub / github.com/codeaashu/claude-code / isExtraUsageEnabled

Function isExtraUsageEnabled

src/utils/model/check1mAccess.ts:11–43  ·  view source on GitHub ↗

* Check if extra usage is enabled based on the cached disabled reason. * Extra usage is considered enabled if there's no disabled reason, * or if the disabled reason indicates it's provisioned but temporarily unavailable.

()

Source from the content-addressed store, hash-verified

9 * or if the disabled reason indicates it's provisioned but temporarily unavailable.
10 */
11function isExtraUsageEnabled(): boolean {
12 const reason = getGlobalConfig().cachedExtraUsageDisabledReason
13 // undefined = no cache yet, treat as not enabled (conservative)
14 if (reason === undefined) {
15 return false
16 }
17 // null = no disabled reason from API, extra usage is enabled
18 if (reason === null) {
19 return true
20 }
21 // Check which disabled reasons still mean "provisioned"
22 switch (reason as OverageDisabledReason) {
23 // Provisioned but credits depleted — still counts as enabled
24 case 'out_of_credits':
25 return true
26 // Not provisioned or actively disabled
27 case 'overage_not_provisioned':
28 case 'org_level_disabled':
29 case 'org_level_disabled_until':
30 case 'seat_tier_level_disabled':
31 case 'member_level_disabled':
32 case 'seat_tier_zero_credit_limit':
33 case 'group_zero_credit_limit':
34 case 'member_zero_credit_limit':
35 case 'org_service_level_disabled':
36 case 'org_service_zero_credit_limit':
37 case 'no_limits_configured':
38 case 'unknown':
39 return false
40 default:
41 return false
42 }
43}
44
45// @[MODEL LAUNCH]: Add check if the new model supports 1M context
46export function checkOpus1mAccess(): boolean {

Callers 2

checkOpus1mAccessFunction · 0.85
checkSonnet1mAccessFunction · 0.85

Calls 1

getGlobalConfigFunction · 0.85

Tested by

no test coverage detected