diff --git a/cli/main.py b/cli/main.py index 047e31057..e97399001 100644 --- a/cli/main.py +++ b/cli/main.py @@ -1084,10 +1084,7 @@ def run_analysis(checkpoint: bool | None = None): # Normalize analyst selection to predefined order (selection is a 'set', order is fixed) selected_set = {analyst.value for analyst in selections["analysts"]} selected_analyst_keys = [a for a in ANALYST_ORDER if a in selected_set] - analyst_execution_plan = build_analyst_execution_plan( - selected_analyst_keys, - concurrency_limit=config["analyst_concurrency_limit"], - ) + analyst_execution_plan = build_analyst_execution_plan(selected_analyst_keys) analyst_wall_time_tracker = AnalystWallTimeTracker(analyst_execution_plan) # Initialize the graph with callbacks bound to LLMs diff --git a/tests/test_analyst_execution.py b/tests/test_analyst_execution.py index 896c9e21e..807caf6d4 100644 --- a/tests/test_analyst_execution.py +++ b/tests/test_analyst_execution.py @@ -10,10 +10,9 @@ from tradingagents.graph.analyst_execution import ( class AnalystExecutionPlanTests(unittest.TestCase): def test_build_plan_preserves_selected_order(self): - plan = build_analyst_execution_plan(["news", "market"], concurrency_limit=2) + plan = build_analyst_execution_plan(["news", "market"]) self.assertEqual([spec.key for spec in plan.specs], ["news", "market"]) - self.assertEqual(plan.concurrency_limit, 2) self.assertEqual(plan.specs[0].agent_node, "News Analyst") self.assertEqual(plan.specs[0].tool_node, "tools_news") self.assertEqual(plan.specs[0].clear_node, "Msg Clear News") @@ -22,10 +21,6 @@ class AnalystExecutionPlanTests(unittest.TestCase): with self.assertRaises(ValueError): build_analyst_execution_plan(["market", "macro"]) - def test_requires_positive_concurrency_limit(self): - with self.assertRaises(ValueError): - build_analyst_execution_plan(["market"], concurrency_limit=0) - def test_get_initial_analyst_node_uses_plan_metadata(self): plan = build_analyst_execution_plan(["fundamentals", "news"]) diff --git a/tradingagents/default_config.py b/tradingagents/default_config.py index 3c5b09c1c..a25d0f76b 100644 --- a/tradingagents/default_config.py +++ b/tradingagents/default_config.py @@ -105,7 +105,6 @@ DEFAULT_CONFIG = _apply_env_overrides({ "max_debate_rounds": 1, "max_risk_discuss_rounds": 1, "max_recur_limit": 100, - "analyst_concurrency_limit": 1, # News / data fetching parameters # Increase for longer lookback strategies or to broaden macro coverage; # decrease to reduce token usage in agent prompts. diff --git a/tradingagents/graph/analyst_execution.py b/tradingagents/graph/analyst_execution.py index 6587ea7eb..0e653742b 100644 --- a/tradingagents/graph/analyst_execution.py +++ b/tradingagents/graph/analyst_execution.py @@ -15,7 +15,6 @@ class AnalystNodeSpec: @dataclass(frozen=True) class AnalystExecutionPlan: specs: list[AnalystNodeSpec] - concurrency_limit: int ANALYST_NODE_SPECS: dict[str, AnalystNodeSpec] = { @@ -56,11 +55,7 @@ ANALYST_NODE_SPECS: dict[str, AnalystNodeSpec] = { def build_analyst_execution_plan( selected_analysts: Iterable[str], - concurrency_limit: int = 1, ) -> AnalystExecutionPlan: - if concurrency_limit < 1: - raise ValueError("analyst concurrency limit must be >= 1") - specs: list[AnalystNodeSpec] = [] for analyst_key in selected_analysts: spec = ANALYST_NODE_SPECS.get(analyst_key) @@ -71,7 +66,7 @@ def build_analyst_execution_plan( if not specs: raise ValueError("at least one analyst must be selected") - return AnalystExecutionPlan(specs=specs, concurrency_limit=concurrency_limit) + return AnalystExecutionPlan(specs=specs) def get_initial_analyst_node(plan: AnalystExecutionPlan) -> str: diff --git a/tradingagents/graph/setup.py b/tradingagents/graph/setup.py index 8771dd0bb..3f87e213f 100644 --- a/tradingagents/graph/setup.py +++ b/tradingagents/graph/setup.py @@ -35,14 +35,12 @@ class GraphSetup: deep_thinking_llm: Any, tool_nodes: dict[str, ToolNode], conditional_logic: ConditionalLogic, - analyst_concurrency_limit: int = 1, ): """Initialize with required components.""" self.quick_thinking_llm = quick_thinking_llm self.deep_thinking_llm = deep_thinking_llm self.tool_nodes = tool_nodes self.conditional_logic = conditional_logic - self.analyst_concurrency_limit = analyst_concurrency_limit def setup_graph( self, selected_analysts=("market", "social", "news", "fundamentals") @@ -56,10 +54,7 @@ class GraphSetup: - "news": News analyst - "fundamentals": Fundamentals analyst """ - plan = build_analyst_execution_plan( - selected_analysts, - concurrency_limit=self.analyst_concurrency_limit, - ) + plan = build_analyst_execution_plan(selected_analysts) analyst_factories = { "market": lambda: create_market_analyst(self.quick_thinking_llm), diff --git a/tradingagents/graph/trading_graph.py b/tradingagents/graph/trading_graph.py index 253dd82be..cfbfc93d4 100644 --- a/tradingagents/graph/trading_graph.py +++ b/tradingagents/graph/trading_graph.py @@ -110,7 +110,6 @@ class TradingAgentsGraph: self.deep_thinking_llm, self.tool_nodes, self.conditional_logic, - analyst_concurrency_limit=self.config.get("analyst_concurrency_limit", 1), ) self.propagator = Propagator(