[cross-feature coupling] endpoint_resolver imports private _detect_provider from llm_core #704

Closed
opened 2026-06-02 23:56:16 +02:00 by sleepy · 1 comment
Owner

File: src/endpoint_resolver.py line 15

AGENTS.md rule: Features communicate through narrow, typed interfaces. Never import another feature's internals directly.

from src.llm_core import _detect_provider

endpoint_resolver imports _detect_provider — a private, underscore-prefixed function. This creates a tight coupling between two core modules. If llm_core is refactored (see issue #700), this import breaks.

Provider detection is used by both endpoint_resolver.py and model_routes.py and should either:

  1. Be promoted to a proper public function in llm_core (remove underscore prefix), or
  2. Be extracted to a shared src/llm_core/providers.py module that both can import from.

This is part of the broader duplication problem: _detect_provider is called in llm_core.py, endpoint_resolver.py, model_routes.py, and ai_interaction.py.

**File:** `src/endpoint_resolver.py` line 15 **AGENTS.md rule:** Features communicate through narrow, typed interfaces. Never import another feature's internals directly. ```python from src.llm_core import _detect_provider ``` `endpoint_resolver` imports `_detect_provider` — a private, underscore-prefixed function. This creates a tight coupling between two core modules. If `llm_core` is refactored (see issue #700), this import breaks. Provider detection is used by both `endpoint_resolver.py` and `model_routes.py` and should either: 1. Be promoted to a proper public function in `llm_core` (remove underscore prefix), or 2. Be extracted to a shared `src/llm_core/providers.py` module that both can import from. This is part of the broader duplication problem: `_detect_provider` is called in `llm_core.py`, `endpoint_resolver.py`, `model_routes.py`, and `ai_interaction.py`.
Author
Owner

Fixed via PR #874 — promoted private functions to public API, removed duplicated helpers from model_routes.

Fixed via PR #874 — promoted private functions to public API, removed duplicated helpers from model_routes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/odysseus#704
No description provided.