@@ -118,7 +118,7 @@ describe("provider failover hook structured signals", () => {
118118
119119 it . each ( [
120120 { errorType : "rate_limit_error" , reason : "rate_limit" , runtimeKind : "rate_limit" } ,
121- { errorType : "api_error" , reason : "timeout " , runtimeKind : "timeout " } ,
121+ { errorType : "api_error" , reason : "server_error " , runtimeKind : "unclassified " } ,
122122 ] as const ) (
123123 "classifies message-less Anthropic $errorType assistant failures" ,
124124 ( { errorType, reason, runtimeKind } ) => {
@@ -129,7 +129,7 @@ describe("provider failover hook structured signals", () => {
129129 if ( context . errorType === "rate_limit_error" ) {
130130 return "rate_limit" ;
131131 }
132- return context . errorType === "api_error" ? "timeout " : undefined ;
132+ return context . errorType === "api_error" ? "server_error " : undefined ;
133133 } ) ;
134134
135135 const message = makeAssistantMessageFixture ( {
@@ -150,6 +150,26 @@ describe("provider failover hook structured signals", () => {
150150 } ,
151151 ) ;
152152
153+ it . each ( [
154+ { provider : "google" , code : "SERVER_ERROR" } ,
155+ { provider : "anthropic" , code : "INSUFFICIENT_QUOTA" } ,
156+ { provider : "openai" , code : "INTERNAL" } ,
157+ { provider : "openai" , code : "DEADLINE_EXCEEDED" } ,
158+ { provider : "anthropic" , code : "UNAVAILABLE" } ,
159+ { provider : "google" , code : "API_ERROR" } ,
160+ { provider : "google" , code : "RATE_LIMIT_ERROR" } ,
161+ ] as const ) (
162+ "does not apply provider-native $code semantics to non-owner $provider" ,
163+ ( { provider, code } ) => {
164+ providerRuntimeMocks . classifyProviderPluginError . mockReturnValue ( undefined ) ;
165+
166+ expect ( classifyFailoverSignal ( { provider, code, message : "" } ) ) . toBeNull ( ) ;
167+ expect ( classifyProviderRuntimeFailureKind ( { provider, code, message : "" } ) ) . toBe (
168+ "unclassified" ,
169+ ) ;
170+ } ,
171+ ) ;
172+
153173 it ( "does not promote generic SDK type strings as structured provider descriptors" , ( ) => {
154174 providerRuntimeMocks . classifyProviderPluginError . mockReturnValue ( "billing" ) ;
155175
0 commit comments