Commit 7411628
committed
refactor(llm_service): split module into package
Decompose the 1137-line services/llm_service.py into a package along a
clean dependency DAG (retry <- chat_client <- analyzer -> tool_output):
- retry: APIErrorClassifier, llm_retry_decorator, AgentRetryTracker
- chat_client: RetryableChatOpenAI (retry-wrapped ChatOpenAI)
- tool_output: token-limiting and formatting of agent tool output
- analyzer: AgentResult, MultiAgentAnalyzer orchestration
Function bodies moved verbatim (byte-identical, verified via AST). Public
surface unchanged: AgentResult and MultiAgentAnalyzer still importable from
the same path and via services/__init__; retry internals re-exported for the
retry-mechanism test.
Two split-mechanics fixes:
- analyzer imports AgentMCPConfigService via '..agent_mcp_config' (it is a
services sibling, now one level up from the package).
- test_404_retry_mechanism patches MultiServerMCPClient at its resolved
namespace (…llm_service.analyzer) instead of the old flat module path.
89 passed / 2 skipped.1 parent c8f0776 commit 7411628
7 files changed
Lines changed: 1189 additions & 1139 deletions
File tree
- pure_auto_codeql/services
- llm_service
- test
0 commit comments