๐คฏ LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
โจ feat(model-runtime): classify 9 error patterns from 2026-09 triage (#19004)
Arvin Xu8996397b2a84
diff --git a/packages/model-runtime/src/errors/match.test.ts b/packages/model-runtime/src/errors/match.test.tsindex dbfab87edaf..cd9d5116ad2 100644--- a/packages/model-runtime/src/errors/match.test.ts+++ b/packages/model-runtime/src/errors/match.test.ts@@ -505,3 +505,60 @@ describe('matchErrorPattern โ gateway user/upstream residues by category', ()).toBe(AgentRuntimeErrorType.InvalidVertexCredentials);});});++describe('2026-09 triage harvest (production residue)', () => {+ // Real messages sampled from `agent_operations` rows that landed in the+ // UpstreamHttpError / bare-500 / bare-403 residue over 30 days. Every pattern+ // here was audited to match zero `provider = 'lobehub'` rows first โ first-party+ // provider errors are our own bugs and must stay visible.+ const cases: [string, string][] = [+ ['Sorry, your account balance is insufficient', AgentRuntimeErrorType.InsufficientQuota],+ [+ '403 {"error":{"type":"Aihubmix_api_error","message":"Your account balance is insufficient. Please recharge your account to continue using the API."}}',+ AgentRuntimeErrorType.InsufficientQuota,+ ],+ [+ 'LLM stream error: You have no credits remaining. Add credits to continue using the API at https://platform.openai.com/settings/organization/billing/.',+ AgentRuntimeErrorType.InsufficientQuota,+ ],+ [+ '404 Model "gpt-5.6-luna" is not supported by any configured account in this group',+ AgentRuntimeErrorType.ModelNotFound,+ ],+ [+ 'This model models/gemini-2.5-pro is no longer available to new users. Please update your code to use a newer model.',+ AgentRuntimeErrorType.ModelNotFound,+ ],+ [+ '404 This model is only available through the Batch API. Use the /api/beta/batches endpoint instead.',+ AgentRuntimeErrorType.CapabilityNotSupported,+ ],+ [+ '400 ๅฝๅๆจกๅๆๅๅฎถไธๆฏๆ่ฏทๆฑไธญ็่ฝๅใ ๅๅ ๏ผ่ฏทๆฑไฝฟ็จไบๅฝๅๆธ ้ไธๆฏๆ็่ฝๅ๏ผไพๅฆๅพ็ใPDFใtoolsใresponse_formatใthinking ๆ็นๅฎๅ่ฎฎ่ฝๅใ',+ AgentRuntimeErrorType.CapabilityNotSupported,+ ],+ [+ '400 data: {"error":{"code":"data_inspection_failed","param":null,"message":"Input text data may contain inappropriate content."}}',+ AgentRuntimeErrorType.ContentModeration,+ ],+ [+ 'LLM stream error: provider temporarily unavailable. Error id: glm-7f67a83c5d74',+ AgentRuntimeErrorType.ProviderServiceUnavailable,+ ],+ [+ 'The bound service account is deleted or disabled. The service account bound to the API key is unavailable.',+ AgentRuntimeErrorType.InvalidProviderAPIKey,+ ],+ ];++ it.each(cases)('classifies %j', (message, expected) => {+ expect(matchErrorPattern({ message })?.code).toBe(expected);+ expect(isUserSideError(undefined, message)).toBe(true);+ });++ it('keeps first-party lobehub failures unclassified so they stay visible', () => {+ // The bare `Forbidden` body behind 2.4k lobehub-provider rows must NOT be+ // swept into a user-side code by any pattern added here.+ expect(matchErrorPattern({ message: 'Forbidden', provider: 'lobehub' })).toBeUndefined();+ });+});diff --git a/packages/model-runtime/src/errors/patterns.ts b/packages/model-runtime/src/errors/patterns.tsindex e5e41977e2f..fa2d0363126 100644--- a/packages/model-runtime/src/errors/patterns.ts+++ b/packages/model-runtime/src/errors/patterns.ts@@ -401,6 +401,18 @@ export const ERROR_PATTERNS: ErrorPattern[] = [match: sub('The free quota has been exhausted'),},+ // Harvested from the UpstreamHttpError / bare-500 residue (2026-09 triage):+ // BYOK proxies phrase balance exhaustion without the `, please recharge` tail+ // that the narrower pattern above requires.+ {+ code: AgentRuntimeErrorType.InsufficientQuota,+ match: sub('account balance is insufficient', { caseInsensitive: true }),+ },+ {+ code: AgentRuntimeErrorType.InsufficientQuota,+ match: sub('no credits remaining'),+ },+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ// RateLimitExceeded โ short-window rate limit (transient, retryable)// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ@@ -560,6 +572,12 @@ export const ERROR_PATTERNS: ErrorPattern[] = [{ code: AgentRuntimeErrorType.ProviderServiceUnavailable, match: sub('ๆๅกๅจ้ฎ้ข่ฐ่ฏไธญ') },{ code: AgentRuntimeErrorType.ProviderServiceUnavailable, match: sub('undergoing an upgrade') },+ {+ code: AgentRuntimeErrorType.ProviderServiceUnavailable,+ match: sub('provider temporarily unavailable. Error id:'),+ note: 'Aggregator proxies wrap a transient upstream outage in a bare 500.',+ },+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ// ProviderNetworkError โ connection / timeout// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ@@ -727,6 +745,17 @@ export const ERROR_PATTERNS: ErrorPattern[] = [match: sub('Unknown Model, please check the model code'),},+ {+ code: AgentRuntimeErrorType.ModelNotFound,+ match: sub('is not supported by any configured account'),+ note: 'Router/aggregator has no account able to serve the requested model.',+ },+ {+ code: AgentRuntimeErrorType.ModelNotFound,+ match: sub('is no longer available to new users'),+ note: 'Gemini retires a model for accounts that never called it before.',+ },+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ// InvalidVertexCredentials// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ@@ -782,6 +811,11 @@ export const ERROR_PATTERNS: ErrorPattern[] = [match: sub('No active credentials for provider'),},+ {+ code: AgentRuntimeErrorType.InvalidProviderAPIKey,+ match: sub('bound service account is deleted or disabled'),+ },+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ// InvalidGithubToken / InvalidGithubCopilotToken// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ@@ -897,6 +931,16 @@ export const ERROR_PATTERNS: ErrorPattern[] = [match: sub('The model rejected this request. It may not support the input you sent'),},+ {+ code: AgentRuntimeErrorType.CapabilityNotSupported,+ match: sub('only available through the Batch API'),+ },+ {+ code: AgentRuntimeErrorType.CapabilityNotSupported,+ match: sub('ไธๆฏๆ่ฏทๆฑไธญ็่ฝๅ'),+ note: 'Chinese aggregators reject unsupported image / PDF / tools / thinking capabilities.',+ },+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ// ContentModeration// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ@@ -949,6 +993,12 @@ export const ERROR_PATTERNS: ErrorPattern[] = [note: 'sensenova output-side',},+ {+ code: AgentRuntimeErrorType.ContentModeration,+ match: sub('data_inspection_failed'),+ note: 'Alibaba/Qwen content-safety rejection, delivered as a JSON error code.',+ },+// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ// InvalidRequestFormat โ provider rejected as malformed// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ