refactor(agents): hide provider error pattern internals · openclaw/openclaw@a48a9bb
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
File tree
src/agents/embedded-agent-helpers
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ type ProviderErrorPattern = {
|
21 | 21 | * `isContextOverflowError()` in errors.ts. Called from `isContextOverflowError()` |
22 | 22 | * to catch provider-specific wording that the generic regex misses. |
23 | 23 | */ |
24 | | -export const PROVIDER_CONTEXT_OVERFLOW_PATTERNS: readonly RegExp[] = [ |
| 24 | +const PROVIDER_CONTEXT_OVERFLOW_PATTERNS: readonly RegExp[] = [ |
25 | 25 | // AWS Bedrock validation / stream errors use provider-specific wording. |
26 | 26 | /\binput token count exceeds the maximum number of input tokens\b/i, |
27 | 27 | /\binput is too long for this model\b/i, |
@@ -51,7 +51,7 @@ export const PROVIDER_CONTEXT_OVERFLOW_PATTERNS: readonly RegExp[] = [
|
51 | 51 | * These handle cases where the generic classifiers in failover-matches.ts |
52 | 52 | * produce wrong results for specific providers. |
53 | 53 | */ |
54 | | -export const PROVIDER_SPECIFIC_PATTERNS: readonly ProviderErrorPattern[] = [ |
| 54 | +const PROVIDER_SPECIFIC_PATTERNS: readonly ProviderErrorPattern[] = [ |
55 | 55 | { |
56 | 56 | test: /\bthrottlingexception\b/i, |
57 | 57 | reason: "rate_limit", |
@@ -123,7 +123,7 @@ function looksLikeProviderContextOverflowCandidate(errorMessage: string): boolea
|
123 | 123 | ); |
124 | 124 | } |
125 | 125 | |
126 | | -export type ProviderSpecificErrorContext = { |
| 126 | +type ProviderSpecificErrorContext = { |
127 | 127 | provider?: string; |
128 | 128 | modelId?: string; |
129 | 129 | errorMessage: string; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。