Each log file is named for a specific trade_date, so it should only
contain that date's state. Writing self.log_states_dict caused O(N^2)
storage and I/O as every daily file redundantly included all previously
processed dates.
Suggested by GitHub Copilot review on PR #499.
- Remove unused `from langchain_openai import ChatOpenAI` imports from
graph/setup.py, graph/reflection.py, graph/signal_processing.py, and
agents/utils/agent_states.py. The framework supports multiple LLM
providers so these type hints were incorrect and misleading.
- Clean up agents/utils/agent_states.py: remove unused imports of
Sequence, date, timedelta, datetime, ChatOpenAI, agents star-import,
ToolNode, END, StateGraph, START (only Annotated, TypedDict, and
MessagesState are actually used).
- Fix graph/trading_graph.py _log_state(): replace hardcoded
"eval_results/" relative path with config["results_dir"] so logs land
in the same configured directory as other run outputs, regardless of
the working directory the user runs from.
- Fix dataflows/y_finance.py _get_stock_stats_bulk(): add missing
`import pandas as pd` which caused a NameError on pd.isna() during
bulk indicator calculation, silently falling back to the slower
per-day loop.
Made-with: Cursor
Add effort parameter (high/medium/low) for Claude 4.5+ and 4.6 models,
consistent with OpenAI reasoning_effort and Google thinking_level.
Also add content normalization for Anthropic responses.
InvestDebateState was missing bull_history, bear_history, judge_decision.
RiskDebateState was missing aggressive_history, conservative_history,
neutral_history, latest_speaker, judge_decision. This caused KeyError
in _log_state() and reflection, especially with edge-case config values.
Prevents UnicodeEncodeError on Windows where the default encoding
(cp1252/gbk) cannot handle Unicode characters in LLM output.
Closes#77, closes#114, closes#126, closes#215, closes#332
- Add StatsCallbackHandler for tracking LLM calls, tool calls, and tokens
- Integrate callbacks into TradingAgentsGraph and all LLM clients
- Dynamic agent/report counts based on selected analysts
- Fix report completion counting (tied to agent completion)