TradingAgents/docs
陈少杰 78312851f9 refactor(orchestrator): centralize provider validation in factory
Move provider × base_url validation patterns from llm_runner.py to
factory.py's ProviderSpec, implementing the architecture improvement
suggested in docs/architecture/orchestrator-validation.md.

Changes:
- Add base_url_patterns field to ProviderSpec dataclass
- Split ollama and openrouter into separate ProviderSpec entries
  (previously shared openai's spec with dynamic provider selection)
- Add validate_provider_base_url() function in factory for reusable validation
- Simplify LLMRunner._detect_provider_mismatch() to delegate to factory
- Update architecture doc with change log and implementation notes

Benefits:
- Single source of truth for provider configuration
- Easier maintenance when adding/updating providers
- Reduced code duplication (llm_runner.py: -39 lines, factory.py: +84 lines)
- Factory validation can be tested independently

All 28 orchestrator validation tests pass, including 6 provider mismatch tests.
2026-04-16 20:06:30 +08:00
..
architecture refactor(orchestrator): centralize provider validation in factory 2026-04-16 20:06:30 +08:00
contracts wip: stage uncommitted changes before merge 2026-04-16 17:01:04 +08:00
migration feat(orchestrator): add comprehensive provider and timeout validation 2026-04-16 11:43:19 +08:00