mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-03 14:53:36 +00:00
refactor(agents): hide provider error pattern internals
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user