[chat] ai_interaction.py imports private _detect_provider and ANTHROPIC_MODELS from llm_core internals #730

Closed
opened 2026-06-03 00:09:02 +02:00 by sleepy · 0 comments
Owner

Problem

src/ai_interaction.py lines 72 and 1097 import:

from src.llm_core import _detect_provider, ANTHROPIC_MODELS

_detect_provider is a private function (underscore-prefixed) belonging to llm_core. ANTHROPIC_MODELS is an internal constant. This is cross-feature coupling through internals.

This same issue was flagged for endpoint_resolver and model_routes (#704, #703).

AGENTS.md violations

  • Features communicate through narrow, typed interfaces — never import another feature's internals directly
  • No cross-feature dependencies without explicit interfaces

Suggested fix

  1. If _detect_provider is needed by multiple modules, promote it to a public function in a shared utility (e.g., src/provider_detection.py)
  2. If ANTHROPIC_MODELS is a shared constant, move it to a constants module
  3. Provide a public resolve_model function in llm_core or endpoint_resolver that encapsulates provider detection internally
## Problem `src/ai_interaction.py` lines 72 and 1097 import: ```python from src.llm_core import _detect_provider, ANTHROPIC_MODELS ``` `_detect_provider` is a private function (underscore-prefixed) belonging to llm_core. `ANTHROPIC_MODELS` is an internal constant. This is cross-feature coupling through internals. This same issue was flagged for endpoint_resolver and model_routes (#704, #703). ## AGENTS.md violations - **Features communicate through narrow, typed interfaces — never import another feature's internals directly** - **No cross-feature dependencies without explicit interfaces** ## Suggested fix 1. If `_detect_provider` is needed by multiple modules, promote it to a public function in a shared utility (e.g., `src/provider_detection.py`) 2. If `ANTHROPIC_MODELS` is a shared constant, move it to a constants module 3. Provide a public `resolve_model` function in llm_core or endpoint_resolver that encapsulates provider detection internally
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#730
No description provided.