MCPcopy Create free account
hub / github.com/codeaashu/claude-code / addExceededLimit

Function addExceededLimit

src/services/mockRateLimits.ts:249–270  ·  view source on GitHub ↗
(
  type: 'five_hour' | 'seven_day' | 'seven_day_opus' | 'seven_day_sonnet',
  hoursFromNow: number,
)

Source from the content-addressed store, hash-verified

247
248// Add function to add exceeded limit with custom reset time
249export function addExceededLimit(
250 type: 'five_hour' | 'seven_day' | 'seven_day_opus' | 'seven_day_sonnet',
251 hoursFromNow: number,
252): void {
253 if (process.env.USER_TYPE !== 'ant') {
254 return
255 }
256
257 mockEnabled = true
258 const resetsAt = Math.floor(Date.now() / 1000) + hoursFromNow * 3600
259
260 // Remove existing limit of same type
261 exceededLimits = exceededLimits.filter(l => l.type !== type)
262 exceededLimits.push({ type, resetsAt })
263
264 // Update status to rejected if we have exceeded limits
265 if (exceededLimits.length > 0) {
266 mockHeaders['anthropic-ratelimit-unified-status'] = 'rejected'
267 }
268
269 updateRepresentativeClaim()
270}
271
272// Set mock early warning utilization for time-relative thresholds
273// claimAbbrev: '5h' or '7d'

Callers

nothing calls this directly

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected