refactor(agents): hide provider error pattern internals

This commit is contained in:
Vincent Koc
2026-06-17 13:48:22 +08:00
parent e655357197
commit a48a9bbd7d

View File

@@ -21,7 +21,7 @@ type ProviderErrorPattern = {
* `isContextOverflowError()` in errors.ts. Called from `isContextOverflowError()`
* to catch provider-specific wording that the generic regex misses.
*/
export const PROVIDER_CONTEXT_OVERFLOW_PATTERNS: readonly RegExp[] = [
const PROVIDER_CONTEXT_OVERFLOW_PATTERNS: readonly RegExp[] = [
// AWS Bedrock validation / stream errors use provider-specific wording.
/\binput token count exceeds the maximum number of input tokens\b/i,
/\binput is too long for this model\b/i,
@@ -51,7 +51,7 @@ export const PROVIDER_CONTEXT_OVERFLOW_PATTERNS: readonly RegExp[] = [
* These handle cases where the generic classifiers in failover-matches.ts
* produce wrong results for specific providers.
*/
export const PROVIDER_SPECIFIC_PATTERNS: readonly ProviderErrorPattern[] = [
const PROVIDER_SPECIFIC_PATTERNS: readonly ProviderErrorPattern[] = [
{
test: /\bthrottlingexception\b/i,
reason: "rate_limit",
@@ -123,7 +123,7 @@ function looksLikeProviderContextOverflowCandidate(errorMessage: string): boolea
);
}
export type ProviderSpecificErrorContext = {
type ProviderSpecificErrorContext = {
provider?: string;
modelId?: string;
errorMessage: string;