iflytek/astron-agent · error · CustomException

ENG_PROTOCOL_VALIDATE_ERROR

ENG_PROTOCOL_VALIDATE_ERROR

Error message

Invalid default option branch configuration

What it means

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.

Solutions

  1. Open the question-answer node config and ensure only one option is marked as the default branch
  2. If the definition was imported, fix the duplicated default flags in the workflow JSON before re-running
  3. Re-publish/save the workflow so the corrected definition is used

Example fix

// before
options = [{"name": "yes", "default": true}, {"name": "no", "default": true}]
// after
options = [{"name": "yes", "default": true}, {"name": "no", "default": false}]
Defensive patterns

Strategy: validation

Validate before calling

defaults = [o for o in qa_options if o.get("default")]
if len(defaults) > 1: raise ValueError("only one default option allowed")

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/9b987551e1b4713a. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/engine/nodes/question_answer/question_answer_node.py:301

            processed_option = Option(
                id=option.id,
                name=option.name,
                type=option.type,
                content=replaced_content,
                content_type=option.content_type,
            )
            if processed_option.type == OptionType.DEFAULT.value:
                default_option_cnt += 1
            self.processed_options.append(processed_option)

            interrupt_option = InterruptOption(
                id=option.name, content_type=option.content_type, text=replaced_content
            )
            interrupt_options.append(interrupt_option.dict())

        if default_option_cnt > 1:
            err_msg = "Invalid default option branch configuration"
            raise CustomException(
                err_code=CodeEnum.ENG_PROTOCOL_VALIDATE_ERROR,
                err_msg=err_msg,
                cause_error="Invalid default option branch configuration",
            )

        await span_context.add_info_events_async(
            {"interrupt option": json.dumps(interrupt_options, ensure_ascii=False)}
        )
        return interrupt_options

    async def qa_fetch_resume_data(self, span_context: Span) -> ResumeData:
        """
        Asynchronously fetch resume data

        :param span_context: Context object for tracking and recording events
        :return: ResumeData object containing event type, content, retries, and timestamp
        :raises CustomException: When specific errors occur
        """

View on GitHub (pinned to 5e758547a8)