{"record":{"id":"9b987551e1b4713a","repo":"iflytek/astron-agent","slug":"eng-protocol-validate-error-invalid-default-option-branch","errorCode":"ENG_PROTOCOL_VALIDATE_ERROR","errorMessage":"Invalid default option branch configuration","messagePattern":"Invalid default option branch configuration","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/nodes/question_answer/question_answer_node.py","lineNumber":301,"sourceCode":"            processed_option = Option(\n                id=option.id,\n                name=option.name,\n                type=option.type,\n                content=replaced_content,\n                content_type=option.content_type,\n            )\n            if processed_option.type == OptionType.DEFAULT.value:\n                default_option_cnt += 1\n            self.processed_options.append(processed_option)\n\n            interrupt_option = InterruptOption(\n                id=option.name, content_type=option.content_type, text=replaced_content\n            )\n            interrupt_options.append(interrupt_option.dict())\n\n        if default_option_cnt > 1:\n            err_msg = \"Invalid default option branch configuration\"\n            raise CustomException(\n                err_code=CodeEnum.ENG_PROTOCOL_VALIDATE_ERROR,\n                err_msg=err_msg,\n                cause_error=\"Invalid default option branch configuration\",\n            )\n\n        await span_context.add_info_events_async(\n            {\"interrupt option\": json.dumps(interrupt_options, ensure_ascii=False)}\n        )\n        return interrupt_options\n\n    async def qa_fetch_resume_data(self, span_context: Span) -> ResumeData:\n        \"\"\"\n        Asynchronously fetch resume data\n\n        :param span_context: Context object for tracking and recording events\n        :return: ResumeData object containing event type, content, retries, and timestamp\n        :raises CustomException: When specific errors occur\n        \"\"\"","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/nodes/question_answer/question_answer_node.py#L283-L319","documentation":"The question-answer node validates its interrupt options: exactly one default option branch may be configured. When process_option_answers counts more than one option marked as default (default_option_cnt > 1), it raises ENG_PROTOCOL_VALIDATE_ERROR. This is a workflow-definition protocol violation caught before emitting the interrupt.","triggerScenarios":"A question-answer node is configured with two or more options flagged as the default branch, then async_execute reaches process_option_answers during node execution.","commonSituations":"A workflow author toggles 'default' on multiple options in the console, or hand-edited/imported workflow JSON marks several options as default; often after duplicating an existing option without clearing its default flag.","solutions":["Open the question-answer node config and ensure only one option is marked as the default branch","If the definition was imported, fix the duplicated default flags in the workflow JSON before re-running","Re-publish/save the workflow so the corrected definition is used"],"exampleFix":"// before\noptions = [{\"name\": \"yes\", \"default\": true}, {\"name\": \"no\", \"default\": true}]\n// after\noptions = [{\"name\": \"yes\", \"default\": true}, {\"name\": \"no\", \"default\": false}]","handlingStrategy":"validation","validationCode":"defaults = [o for o in qa_options if o.get(\"default\")]\nif len(defaults) > 1: raise ValueError(\"only one default option allowed\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce single-default at workflow editor/save time","Review imported workflow JSON for duplicated default flags","Add a save-time lint rule for QA node options"],"tags":["workflow","validation","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}