feat(027-checkpoint-resume-contrib): use thread_id(ticker, date) for deterministic checkpoint keying

This commit is contained in:
Clayton Brown 2026-04-20 20:25:25 +10:00
parent 79b57a34fb
commit c960a8804b
1 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@ from tradingagents.agents.utils.agent_utils import (
get_global_news
)
from .checkpointer import get_checkpointer
from .checkpointer import get_checkpointer, thread_id
from .conditional_logic import ConditionalLogic
from .setup import GraphSetup
from .propagation import Propagator
@ -221,6 +221,11 @@ class TradingAgentsGraph:
)
args = self.propagator.get_graph_args()
# Inject thread_id so same ticker+date resumes, different date starts fresh
if self.config.get("checkpoint_enabled"):
tid = thread_id(company_name, str(trade_date))
args.setdefault("config", {}).setdefault("configurable", {})["thread_id"] = tid
if self.debug:
# Debug mode with tracing
trace = []