From edb3cefb7e737c86a7a90b181b06475c119029c9 Mon Sep 17 00:00:00 2001 From: harshitgavita-07 Date: Sat, 17 Oct 2026 10:15:32 +0530 Subject: [PATCH] router: drop stale RouterError from lm15.router.__all__ Commit 228775a removed the RouterError class when the router error codes joined the vocabulary, but left the name in __all__. A star import of lm15.router crashes: >>> from lm15.router import * AttributeError: module 'lm15.router' has no attribute 'RouterError' Add a regression test that every name in lm15.router.__all__ resolves. --- lm15/router.py | 1 - tests/test_router.py | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lm15/router.py b/lm15/router.py index a42c64a..d2b5eee 100644 --- a/lm15/router.py +++ b/lm15/router.py @@ -98,7 +98,6 @@ "CHAT_PRESET_ROUTES", "Resolution", "RouterConfig", - "RouterError", "UnknownModelError", "AmbiguousModelError", "MissingCredentialError", diff --git a/tests/test_router.py b/tests/test_router.py index b774fd7..fd48ad9 100644 --- a/tests/test_router.py +++ b/tests/test_router.py @@ -555,6 +555,15 @@ def test_router_surface_placement() -> None: assert hasattr(router_mod, name), name +def test_router_module_all_resolves() -> None: + # Every name in lm15.router.__all__ must exist: a stale entry crashes + # `from lm15.router import *` with AttributeError. + import lm15.router as router_mod + + for name in router_mod.__all__: + assert hasattr(router_mod, name), name + + def test_router_error_codes_are_bare_nouns() -> None: # Taxonomy convention: codes are bare nouns ('transport', 'provider', # ...), never suffixed with '_error'.