fix(core): keep Anthropic model-not-found investigation text generic
The 404 path copied str(exc) into the investigation report, which can include internal model ids. Tell the operator to check ANTHROPIC_*_MODEL instead.
This commit is contained in:
@@ -289,8 +289,7 @@ def classify_llm_invoke_failure(exc: BaseException) -> LLMInvokeFailure | None:
|
||||
|
||||
if "anthropic" in err_msg and "was not found" in err_msg:
|
||||
return LLMInvokeFailure(
|
||||
user_message=raw.strip()
|
||||
or "Anthropic model was not found. Check your configured model name.",
|
||||
user_message="Anthropic model was not found. Check your configured model name.",
|
||||
tracker_message="Failed: Model not found",
|
||||
remediation_steps=[
|
||||
(
|
||||
|
||||
@@ -57,6 +57,18 @@ def test_timeout_user_message_does_not_echo_exception_text() -> None:
|
||||
assert "sk-secret" not in failure.tracker_message
|
||||
|
||||
|
||||
def test_anthropic_model_not_found_user_message_is_generic() -> None:
|
||||
failure = classify_llm_invoke_failure(
|
||||
RuntimeError("anthropic: model 'claude-internal-alias' was not found")
|
||||
)
|
||||
assert failure is not None
|
||||
assert failure.user_message == (
|
||||
"Anthropic model was not found. Check your configured model name."
|
||||
)
|
||||
assert "claude-internal-alias" not in failure.user_message
|
||||
assert "claude-internal-alias" not in failure.tracker_message
|
||||
|
||||
|
||||
def test_classify_returns_none_for_credit_exhausted_so_it_propagates() -> None:
|
||||
"""LLMCreditExhaustedError must propagate instead of becoming a degraded result."""
|
||||
from core.llm.shared.llm_retry import LLMCreditExhaustedError
|
||||
|
||||
Reference in New Issue
Block a user