[llm_core] 1110-line god file must be split per AGENTS.md ~400 line limit #700
Labels
No labels
area:chat
area:core
area:llm
area:routes
area:tools
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sleepy/odysseus#700
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File:
src/llm_core.py(1110 lines)AGENTS.md rule: Split files that exceed ~400 lines or contain multiple concerns.
llm_core.pycontains at least 5 distinct concerns that should be separate modules:_detect_provider,_provider_label,_normalize_anthropic_url,_is_ollama_native_url,_ollama_api_root,_normalize_ollama_url(~80 lines)_build_anthropic_payload,_build_ollama_payload,_provider_headers,_build_anthropic_headers(~100 lines)_dead_hosts,_host_fails,_model_activity,_mark_host_dead,_clear_host_dead,note_model_activity,seconds_since_model_activity(~60 lines)_response_cache,_get_cache_key,_get_cached_response,_set_cached_response(~30 lines)llm_call,llm_call_async,stream_llm+ fallback variants (~600 lines)stream_llm(~200 lines)Suggested split:
src/llm_core/providers.py— detection, URL normalization, header buildingsrc/llm_core/cache.py— response cachesrc/llm_core/host_tracker.py— dead-host cooldown, model activitysrc/llm_core/payloads.py— provider-specific payload builderssrc/llm_core/calls.py—llm_call,llm_call_async, fallback variantssrc/llm_core/streaming.py—stream_llm,stream_llm_with_fallbacksrc/llm_core/__init__.py— re-export public APISplitting would also make each piece independently testable.