@@ -89,20 +89,38 @@ def test_run_command_names_an_exhausted_quota(self) -> None:
8989 self .assertIn ("quota is exhausted" , str (error ))
9090 self .assertEqual (outputs .read_text (encoding = "utf-8" ), f"failure_reason={ error } \n " )
9191
92- def test_quota_failure_preserves_cores_recovery_message (self ) -> None :
92+ def test_engine_refusals_preserve_cores_recovery_message (self ) -> None :
9393 messages = (
94- "Your free CodeBoarding quota is exhausted. Buy a CodeBoarding license at "
95- "https://codeboarding.org/pricing, or wait for your weekly reset." ,
96- "The LLM provider's token or credit quota is exhausted. "
97- "Add credits or raise the quota for this provider, then re-run." ,
94+ (
95+ 3 ,
96+ "Your CodeBoarding quota is exhausted. Buy a CodeBoarding license at "
97+ "https://codeboarding.org/pricing, or wait for your weekly reset." ,
98+ ),
99+ (
100+ 3 ,
101+ "The LLM provider's token or credit quota is exhausted. "
102+ "Add credits or raise the quota for this provider, then re-run." ,
103+ ),
104+ (
105+ 3 ,
106+ "The hosted LLM provider's quota is exhausted. "
107+ "This is a CodeBoarding service issue. Please try again later or contact CodeBoarding support." ,
108+ ),
109+ (2 , "Your openai API key was rejected (HTTP 401). Verify the key ending in '…a8dd' and try again." ),
110+ (
111+ 2 ,
112+ "CodeBoarding's hosted openrouter credentials were rejected (HTTP 401). This run used no key of "
113+ "yours: check that the workflow grants `id-token: write`, then re-run." ,
114+ ),
98115 )
99- for message in messages :
100- with self .subTest (message = message ), tempfile .TemporaryDirectory () as tmp :
116+ for exit_code , message in messages :
117+ with self .subTest (exit_code = exit_code , message = message ), tempfile .TemporaryDirectory () as tmp :
101118 outputs = Path (tmp ) / "github_output"
102119 program = (
103120 "import sys; "
104121 f"print('ERROR [codeboarding_cli.main:140] CodeBoarding: ' + { message !r} , file=sys.stderr); "
105- "sys.exit(3)"
122+ "print('Additional unprefixed guidance', file=sys.stderr); "
123+ f"sys.exit({ exit_code } )"
106124 )
107125 with patch .dict ("os.environ" , {"GITHUB_OUTPUT" : str (outputs )}), patch ("sys.stderr" , io .StringIO ()):
108126 with self .assertRaises (ar .AnalysisError ) as caught :
0 commit comments