This commit is contained in:
Aiden Cline
2026-02-10 10:16:20 -06:00
parent 3cf3325240
commit 18e5da652a
3 changed files with 4 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ export namespace SessionCompaction {
const output = ProviderTransform.maxOutputTokens(input.model)
const usable = input.model.limit.input || context - output
return count > usable
return count >= usable
}
export const PRUNE_MINIMUM = 20_000

View File

@@ -342,6 +342,9 @@ export namespace SessionProcessor {
stack: JSON.stringify(e.stack),
})
const error = MessageV2.fromError(e, { providerID: input.model.providerID })
// DO NOT retry context overflow errors
if (MessageV2.ContextOverflowError.isInstance(error)) {
}
const retry = SessionRetry.retryable(error)
if (retry !== undefined) {
attempt++

View File

@@ -59,9 +59,6 @@ export namespace SessionRetry {
}
export function retryable(error: ReturnType<NamedError["toObject"]>) {
// DO NOT retry context overflow errors
if (MessageV2.ContextOverflowError.isInstance(error)) return undefined
if (MessageV2.APIError.isInstance(error)) {
if (!error.data.isRetryable) return undefined
return error.data.message.includes("Overloaded") ? "Provider is overloaded" : error.data.message