JuliusBrussee/caveman · error
cachebench: replay declared billed-token ceiling exceeds lim
Error message
cachebench: replay declared billed-token ceiling exceeds limit %d
What it means
Error "cachebench: replay declared billed-token ceiling exceeds limit %d" thrown in JuliusBrussee/caveman.
Source
Thrown at cacheengine/cachebench/replay.go:401
}
at, err := time.Parse(time.RFC3339Nano, record.At)
if err != nil || !previous.IsZero() && at.Before(previous) {
return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q has invalid time order", record.RequestID)
}
if limits.RequireGroundedTiming && record.TimingBasis != TimingGrounded {
return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q timing basis %q is not globally grounded", record.RequestID, record.TimingBasis)
}
timing[record.TimingBasis] = true
if limits.RequireProviderTokens && record.TokenBasis != TokenProviderCounted {
return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q token basis %q is not provider-counted", record.RequestID, record.TokenBasis)
}
tokens[record.TokenBasis] = true
if record.DeclaredInputTokens <= 0 || record.DeclaredInputTokens < record.PrefixTokens || record.MaxOutputTokens <= 0 || !requestBudgetMatchesBody(record) {
return ReplayPreflight{}, fmt.Errorf("cachebench: replay request %q has invalid billed-token budget", record.RequestID)
}
input, output := int64(record.DeclaredInputTokens), int64(record.MaxOutputTokens)
if input > limits.MaxDeclaredBilledTokens-worstCase || output > limits.MaxDeclaredBilledTokens-worstCase-input {
return ReplayPreflight{}, fmt.Errorf("cachebench: replay declared billed-token ceiling exceeds limit %d", limits.MaxDeclaredBilledTokens)
}
declaredInput += input
declaredOutput += output
worstCase += input + output
if !previous.IsZero() {
gap, err := scaledReplayGap(at.Sub(previous), timeScale)
if err != nil || gap > limits.MaxGap {
return ReplayPreflight{}, fmt.Errorf("cachebench: replay gap before %q exceeds limit %s", record.RequestID, limits.MaxGap)
}
if int64(gap) > math.MaxInt64-scheduled {
return ReplayPreflight{}, errors.New("cachebench: replay schedule duration overflow")
}
scheduled += int64(gap)
}
previous = at
}
bases := make([]string, 0, len(timing))
for basis := range timing {View on GitHub (pinned to 27d5a3981a)
Solutions
- Lower the declared billed-token ceiling below the limit.
When it happens
Trigger: Thrown at cacheengine/cachebench/replay.go:401 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/aa29fd7c08f43674.
Report an issue: GitHub.