Skip to content

fix(tradingagents): auto_trigger 误读不存在的 AgentConfig.raw_config,改为 config - #102

Open
pscgyLancer wants to merge 1 commit into
TNT-Likely:mainfrom
pscgyLancer:fix/auto-trigger-raw-config
Open

fix(tradingagents): auto_trigger 误读不存在的 AgentConfig.raw_config,改为 config#102
pscgyLancer wants to merge 1 commit into
TNT-Likely:mainfrom
pscgyLancer:fix/auto-trigger-raw-config

Conversation

@pscgyLancer

Copy link
Copy Markdown

AgentConfig 模型的 JSON 配置列名为 config(src/web/models.py), auto_trigger 中的 agent.raw_config 在运行时抛
AttributeError: 'AgentConfig' object has no attribute 'raw_config' 导致盘中急涨/急跌联动 TradingAgents 深度分析永远无法触发
(_read_auto_trigger_config / _budget_allows 均会失败)。

  • _read_auto_trigger_config 与 _budget_allows 改读 agent.config
  • 单测 _make_agent 改用 MagicMock(spec=AgentConfig) + 真实字段 config, 从根上杜绝字段名回归(裸 MagicMock 任意属性都存在,此前测不出该 bug)

AgentConfig 模型的 JSON 配置列名为 config(src/web/models.py),
auto_trigger 中的 agent.raw_config 在运行时抛
AttributeError: 'AgentConfig' object has no attribute 'raw_config'
导致盘中急涨/急跌联动 TradingAgents 深度分析永远无法触发
(_read_auto_trigger_config / _budget_allows 均会失败)。

- _read_auto_trigger_config 与 _budget_allows 改读 agent.config
- 单测 _make_agent 改用 MagicMock(spec=AgentConfig) + 真实字段 config,
  从根上杜绝字段名回归(裸 MagicMock 任意属性都存在,此前测不出该 bug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant