diff --git a/ddms_compliance_suite/stage_framework.py b/ddms_compliance_suite/stage_framework.py index 2874afa..53a0bee 100644 --- a/ddms_compliance_suite/stage_framework.py +++ b/ddms_compliance_suite/stage_framework.py @@ -229,13 +229,15 @@ class BaseAPIStage: llm_service: Optional[LLMService] = None, global_api_spec: Optional[ParsedAPISpec] = None, # <--- 修改类型注解 operation_keywords: Optional[Dict[str, List[str]]] = None, - stage_llm_config: Optional[Dict[str, bool]] = None): + stage_llm_config: Optional[Dict[str, bool]] = None, + orchestrator: Optional['APITestOrchestrator'] = None): self.logger = logging.getLogger(f"{__name__}.{self.__class__.__name__}") self.current_api_group_metadata = api_group_metadata self.api_group_metadata = api_group_metadata # Let's ensure this common name is also available. self.apis_in_group = apis_in_group # CORRECTED attribute name self.global_api_spec: ParsedAPISpec = global_api_spec self.llm_service = llm_service + self.orchestrator = orchestrator # 🔑 关键修复:保存orchestrator引用 # Stage专用的LLM配置 self.stage_llm_config = stage_llm_config or { diff --git a/ddms_compliance_suite/test_orchestrator.py b/ddms_compliance_suite/test_orchestrator.py index 45f9390..f52c5e8 100644 --- a/ddms_compliance_suite/test_orchestrator.py +++ b/ddms_compliance_suite/test_orchestrator.py @@ -2545,7 +2545,8 @@ class APITestOrchestrator: apis_in_group=[], global_api_spec=parsed_spec, llm_service=self.llm_service, - stage_llm_config=self.stage_llm_config + stage_llm_config=self.stage_llm_config, + orchestrator=self # 🔑 关键修复:传递orchestrator引用 ) for current_api_group_name in api_groups_to_iterate: @@ -2632,7 +2633,8 @@ class APITestOrchestrator: apis_in_group=current_apis_in_group_for_stage, global_api_spec=parsed_spec, llm_service=self.llm_service, - stage_llm_config=self.stage_llm_config + stage_llm_config=self.stage_llm_config, + orchestrator=self # 🔑 关键修复:传递orchestrator引用 ) try: