TradingAgents/tradingagents
ahmet guzererler 2145b04318
fix: graceful LLM 404 handling + per-tier fallback model config (#108)
* fix: per-tier fallback LLM for provider 404/policy errors

- tool_runner: catch status_code==404 from chain.invoke(), re-raise as
  RuntimeError with actionable message (OpenRouter privacy URL + env var hint)
- langgraph_engine: wrap astream_events in try/except, detect policy errors
  and re-raise with model/provider context
- langgraph_engine: _run_one_ticker distinguishes policy 404s (logger.error,
  no traceback) from real bugs (logger.exception with traceback); if fallback
  is configured, rebuilds pipeline with fallback model tier and retries
- langgraph_engine: add _is_policy_error() and _build_fallback_config() helpers
- default_config: add quick/mid/deep_think_fallback_llm + _provider keys
  (TRADINGAGENTS_QUICK_THINK_FALLBACK_LLM etc.)
- .env.example: document new fallback env vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: ADR 017 LLM policy fallback, correct ADR 016 findings, update CLAUDE.md

- docs/agent/decisions/017: add ADR for per-tier LLM fallback design decision
- docs/agent/decisions/016: correct 3 inaccurate review findings — list_pm_decisions
  ObjectId projection, created_at datetime type, and base_dir pointer handling are
  all already correctly implemented in PR#106
- CLAUDE.md: add Per-Tier Fallback LLM section and _is_policy_error critical pattern
- CURRENT_STATE.md: update milestone and recent progress for PR#106/107/108 merges

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:19:08 +01:00
..
agents fix: graceful LLM 404 handling + per-tier fallback model config (#108) 2026-03-25 11:19:08 +01:00
dataflows merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
graph feat(scanner): Finviz smart money scanner + Golden Overlap strategy 2026-03-24 16:03:17 +01:00
llm_clients merge: sync with upstream TauricResearch/TradingAgents v0.2.2 2026-03-23 12:17:25 +00:00
memory fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
pipeline feat: include portfolio holdings in auto mode pipeline analysis (#104) 2026-03-24 18:35:53 +01:00
portfolio fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
__init__.py fix: set process-level UTF-8 default for cross-platform consistency 2026-03-22 23:42:37 +00:00
api_usage.py Address code review: add debug logging for unknown method resolution 2026-03-21 17:27:38 +00:00
daily_digest.py feat: daily digest consolidation and Google NotebookLM sync (#23) 2026-03-19 12:21:03 +01:00
default_config.py fix: graceful LLM 404 handling + per-tier fallback model config (#108) 2026-03-25 11:19:08 +01:00
notebook_sync.py merge: resolve conflicts with origin/main (PR #85 merged) 2026-03-22 06:52:39 +00:00
observability.py fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00
report_paths.py fix: address all PR#106 review findings (ADR 016) (#106) 2026-03-25 11:14:23 +01:00