diff --git a/services/elephant_alpha_autonomous_engine.py b/services/elephant_alpha_autonomous_engine.py index 264bfd0..ed650a0 100644 --- a/services/elephant_alpha_autonomous_engine.py +++ b/services/elephant_alpha_autonomous_engine.py @@ -280,7 +280,8 @@ class ElephantAlphaAutonomousEngine: trigger_type="weekly_insight", conditions={"min_new_insights": 5, "cooldown_hours": 6}, threshold=0.7, - enabled=True, + # weekly_strategy 由 run_scheduler.py 週一 06:00 統一發送,EA 不再 6h 觸發(防 35+/週重複) + enabled=False, ), ] @@ -588,22 +589,11 @@ class ElephantAlphaAutonomousEngine: ) return - if agent_type == "openclaw" and action in ( - "generate_strategic_analysis", - "generate_weekly_strategy", - "generate_market_analysis", - "generate_pricing_strategy", - ): - return await self._run_with_timeout( - self._generate_strategy_report, - timeout=SSH_COMMAND_TIMEOUT, - ) - - if agent_type == "openclaw" and action == "generate_meta_analysis": - return await self._run_with_timeout( - self._generate_meta_report, - timeout=SSH_COMMAND_TIMEOUT, - ) + # NOTE: openclaw weekly_strategy / meta_analysis / strategic_analysis / + # market_analysis / pricing_strategy dispatch removed — weekly_strategy 由 + # run_scheduler.py 週一 06:00 統一發送(防 EA 6h 重複觸發 35+/週)。 + # 若 orchestrator Gemini 仍回傳這些 action,會落到下方 raise ValueError, + # 由 _execute_decision 的 try/except 捕捉並計入 circuit breaker。 if action in {"auto_heal", "resource_optimization", "optimize_resources", "handle_exception"}: return await self._run_with_timeout( @@ -644,12 +634,19 @@ class ElephantAlphaAutonomousEngine: ) async def _generate_strategy_report(self) -> Any: - from services.openclaw_strategist_service import generate_weekly_strategy_report - return await self._run_with_timeout(generate_weekly_strategy_report, timeout=SSH_COMMAND_TIMEOUT) + # 深層保險:即便未來新增 caller,此 method 仍立即崩,避免 EA 再度繞過 dedupe + # 重複發送 weekly_strategy。weekly_strategy 路徑唯一擁有者:run_scheduler.py 週一 06:00。 + raise RuntimeError( + "EA autonomous engine no longer generates weekly/meta reports — " + "owned by run_scheduler.py" + ) async def _generate_meta_report(self) -> Any: - from services.openclaw_strategist_service import generate_meta_analysis_report - return await self._run_with_timeout(generate_meta_analysis_report, timeout=SSH_COMMAND_TIMEOUT) + # 同 _generate_strategy_report:meta_analysis 不再由 EA 觸發。 + raise RuntimeError( + "EA autonomous engine no longer generates weekly/meta reports — " + "owned by run_scheduler.py" + ) def _run_auto_heal(self, error_type: str, context: Dict[str, Any]) -> Any: from services.auto_heal_service import auto_heal_service