mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-06-16 21:06:15 +03:00
fix: merge streamed chunks into final_state so reports save correctly
graph.stream() yields per-node deltas, not the full state. Taking trace[-1] only captured the last node's contribution, so reports saved to disk were missing every section except the final decision. Merge all chunks in both the CLI path and trading_graph._run_graph's debug branch. #719 #736
This commit is contained in:
@@ -1154,8 +1154,11 @@ def run_analysis(checkpoint: bool = False):
|
||||
|
||||
trace.append(chunk)
|
||||
|
||||
# Get final state and decision
|
||||
final_state = trace[-1]
|
||||
# Streamed chunks are per-node deltas, not full state. Merge them
|
||||
# so every report field populated across the run is present.
|
||||
final_state = {}
|
||||
for chunk in trace:
|
||||
final_state.update(chunk)
|
||||
decision = graph.process_signal(final_state["final_trade_decision"])
|
||||
|
||||
# Update all agent statuses to completed
|
||||
|
||||
Reference in New Issue
Block a user