@@ -314,7 +314,7 @@ describe("inference.error text", () => {
314314
315315 test ( "a classified failure gets its written line, not the provider body" , ( ) => {
316316 expect ( message ( { category : "credential_failure" , message : '{"error":{"code":401}}' } ) ) . toBe (
317- "Session expired — re-authenticating… " ,
317+ "Authentication failed — log in again. " ,
318318 ) ;
319319 expect ( message ( { category : "quota_exhausted" , message : "429" } ) ) . toBe (
320320 "Quota exhausted — usage limit reached." ,
@@ -371,6 +371,29 @@ describe("inference.error text", () => {
371371 expect ( event . message ) . not . toContain ( "Quota exhausted" ) ;
372372 } ) ;
373373
374+ test ( "ctx.providerId Codex + ChatGPT usage-limit 429 shows rate-limit copy" , ( ) => {
375+ const ctx = createStreamMapContext ( { providerId : "codex/abk-labs" } ) ;
376+ const [ event ] = mapProductionEvent (
377+ {
378+ type : "inference.error" ,
379+ data : {
380+ error : {
381+ category : "quota_exhausted" ,
382+ message : "You have hit your ChatGPT usage limit" ,
383+ statusCode : 429 ,
384+ raw : "You have hit your ChatGPT usage limit" ,
385+ } ,
386+ } ,
387+ } ,
388+ ctx ,
389+ ) ;
390+ expect ( event ?. type ) . toBe ( "error" ) ;
391+ if ( event ?. type !== "error" ) return ;
392+ expect ( event . message . toLowerCase ( ) ) . toMatch ( / r a t e l i m i t / ) ;
393+ expect ( event . message ) . not . toContain ( "Quota exhausted" ) ;
394+ expect ( event . message . toLowerCase ( ) ) . not . toContain ( "usage limit reached" ) ;
395+ } ) ;
396+
374397 test ( "bare quota_exhausted 429 without ctx/provider still shows Quota exhausted" , ( ) => {
375398 expect (
376399 message ( {
0 commit comments