Skip to content

isContextOverflowError

function isContextOverflowError(error): boolean;

Returns true if the error is a provider context-overflow / “prompt too long” condition. Matches on AI SDK APICallError + raw provider errors + proxy-reshaped errors.

Bias: tolerate false positives (wasted retry), reject false negatives (fatal turn loss).

Parameter Type

error

unknown

boolean