Skip to content

The agent that grows with you

simplify(compat): image_generation_tool — drop 2 re-export noqa blocks (13 names), repoint 2 callers + 2 tests to image_generation_catalog

Teknium67ccfaed399f
diff --git a/hermes_cli/tools_config_providers.py b/hermes_cli/tools_config_providers.py
index bf7f524f108..3f1a5870885 100644
--- a/hermes_cli/tools_config_providers.py
+++ b/hermes_cli/tools_config_providers.py
@@ -479,8 +479,8 @@ def _detect_active_provider_index(providers: list, config: dict, *, force_fresh:
def _fal_model_catalog():
- """Lazy-load the FAL model catalog from the tool module."""
- from tools.image_generation_tool import FAL_MODELS, DEFAULT_MODEL
+ """Lazy-load the FAL model catalog."""
+ from tools.image_generation_catalog import FAL_MODELS, DEFAULT_MODEL
return FAL_MODELS, DEFAULT_MODEL
diff --git a/plugins/image_gen/fal/__init__.py b/plugins/image_gen/fal/__init__.py
index 9b9be919ca8..ba884373c7d 100644
--- a/plugins/image_gen/fal/__init__.py
+++ b/plugins/image_gen/fal/__init__.py
@@ -38,12 +38,12 @@ class FalImageGenProvider(StaticImageGenProvider):
return False
def list_models(self) -> List[Dict[str, Any]]:
- import tools.image_generation_tool as _it
- return catalog_rows(_it.FAL_MODELS)
+ from tools.image_generation_catalog import FAL_MODELS
+ return catalog_rows(FAL_MODELS)
def default_model(self) -> Optional[str]:
- import tools.image_generation_tool as _it
- return _it.DEFAULT_MODEL
+ from tools.image_generation_catalog import DEFAULT_MODEL
+ return DEFAULT_MODEL
def capabilities(self) -> Dict[str, Any]:
# Image-to-image depends on the selected model (``edit_endpoint``); upscale works for any.
diff --git a/tests/plugins/image_gen/test_fal_provider.py b/tests/plugins/image_gen/test_fal_provider.py
index 083c1bedad5..7f41688063c 100644
--- a/tests/plugins/image_gen/test_fal_provider.py
+++ b/tests/plugins/image_gen/test_fal_provider.py
@@ -35,13 +35,13 @@ class TestFalImageGenProviderSurface:
def test_default_model_matches_legacy(self):
from plugins.image_gen.fal import FalImageGenProvider
- from tools.image_generation_tool import DEFAULT_MODEL
+ from tools.image_generation_catalog import DEFAULT_MODEL
assert FalImageGenProvider().default_model() == DEFAULT_MODEL
def test_list_models_uses_legacy_catalog(self):
from plugins.image_gen.fal import FalImageGenProvider
- from tools.image_generation_tool import FAL_MODELS
+ from tools.image_generation_catalog import FAL_MODELS
provider = FalImageGenProvider()
models = provider.list_models()
diff --git a/tests/tools/test_image_generation_image_to_image.py b/tests/tools/test_image_generation_image_to_image.py
index 6bfa308929a..5dd3ea7591b 100644
--- a/tests/tools/test_image_generation_image_to_image.py
+++ b/tests/tools/test_image_generation_image_to_image.py
@@ -60,7 +60,7 @@ class TestFalEditPayload:
def test_text_only_model_has_no_edit_endpoint(self):
- from tools.image_generation_tool import FAL_MODELS
+ from tools.image_generation_catalog import FAL_MODELS
# z-image/turbo is a pure text-to-image model — no edit endpoint.
assert "edit_endpoint" not in FAL_MODELS["fal-ai/z-image/turbo"]
diff --git a/tools/image_generation_tool.py b/tools/image_generation_tool.py
index bc9d3fc5f52..b72e9ca766b 100644
--- a/tools/image_generation_tool.py
+++ b/tools/image_generation_tool.py
@@ -29,9 +29,8 @@ def _load_fal_client() -> Any:
from tools.debug_helpers import DebugSession
-from tools.fal_common import ( # noqa: F401 — _normalize_fal_queue_url_format re-exported for tests
- _ManagedFalSyncClient, _extract_http_status, _normalize_fal_queue_url_format)
-from tools.image_generation_catalog import ( # noqa: F401 — re-exported (plugins/tests/tools_config)
+from tools.fal_common import _ManagedFalSyncClient, _extract_http_status, _normalize_fal_queue_url_format
+from tools.image_generation_catalog import (
DEFAULT_ASPECT_RATIO, DEFAULT_MODEL, FAL_MODELS, UPSCALER_CREATIVITY, UPSCALER_DEFAULT_PROMPT,
UPSCALER_FACTOR, UPSCALER_GUIDANCE_SCALE, UPSCALER_MODEL, UPSCALER_NEGATIVE_PROMPT,
UPSCALER_NUM_INFERENCE_STEPS, UPSCALER_RESEMBLANCE, UPSCALER_SAFETY_CHECKER, VALID_ASPECT_RATIOS,