Skip to content

Commit 89c2343

Browse files
fix: read the llm input the way the credential check does
`llm: Hosted` passes the credential check, which lower-cases it, but the quota comment compared it raw and gave the own-key remedy instead of the free-tier reset. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent d2357b0 commit 89c2343

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎scripts/action/engine_failure.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def _auth(llm: str) -> list[str]:
6161
def render(error: dict, env: dict[str, str]) -> str:
6262
kind = error["kind"]
6363
mode = env.get("MODE", "review")
64-
llm = env.get("LLM", "") or "hosted"
64+
# credential_check.py accepts any case, so `Hosted` must read as hosted here too.
65+
llm = env.get("LLM", "").strip().lower() or "hosted"
6566
lines = [f"### CodeBoarding {mode} · {HEADINGS[kind]}", ""]
6667
lines.append("CodeBoarding stopped instead of publishing a map without AI naming.")
6768
lines += _quota(llm) if kind == "llm_quota_exhausted" else _auth(llm)

‎tests/test_engine_failure.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def test_quota_on_your_own_key_points_at_your_provider(self) -> None:
7979
self.assertIn("On `llm: openai` that is the quota of your own provider account", body)
8080
self.assertNotIn("Monday", body)
8181

82+
def test_llm_input_is_case_insensitive_like_the_credential_check(self) -> None:
83+
_, body, _ = self._run(QUOTA, LLM=" Hosted ")
84+
self.assertIn("resets Monday 00:00 UTC", body)
85+
8286
def test_quota_on_a_license_offers_your_own_key(self) -> None:
8387
_, body, _ = self._run(QUOTA, LLM="license")
8488
self.assertIn("your CodeBoarding plan's allowance", body)

0 commit comments

Comments
 (0)