fix: stop restoring log_states_dict after portfolio analysis

The log_states_dict is meant to accumulate per-ticker state logs.
Restoring it after propagate_portfolio() was discarding all the
detailed logs generated during the portfolio run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Robin Lindbladh 2026-03-26 18:15:27 +01:00
parent 2648f91e09
commit 138c077cc6
1 changed files with 0 additions and 2 deletions

View File

@ -283,7 +283,6 @@ class TradingAgentsGraph:
"""
original_ticker = self.ticker
original_curr_state = self.curr_state
original_log_states = self.log_states_dict.copy()
try:
return self.portfolio_analyzer.analyze(
tickers, trade_date, self.propagate, debug=self.debug
@ -291,7 +290,6 @@ class TradingAgentsGraph:
finally:
self.ticker = original_ticker
self.curr_state = original_curr_state
self.log_states_dict = original_log_states
def reflect_and_remember(self, returns_losses):
"""Reflect on decisions and update memory based on returns."""