mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-06-29 19:26:24 +03:00
chore(config): remove the no-op analyst_concurrency_limit knob
The knob was accepted but inert — analysts run strictly sequentially and the value was never used. Remove it rather than ship a misleading config key. Parallel analyst execution is tracked for v0.3 (#634/#671/#487).
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"])
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user