from __future__ import annotations

from app.modules.agent.orchestration.context.execution_context import ExecutionContext
from app.modules.agent.orchestration.processes.v2.steps.workflow_step_base import WorkflowStepBase


class ExecuteFallbackWorkflowStep(WorkflowStepBase):
    intent_name = "FALLBACK"

    def should_run(self, context: ExecutionContext) -> bool:
        route_result = context.route_result
        if route_result is None:
            return False
        return str(route_result.intent or "").upper() not in {
            "DOCUMENTATION_EXPLAIN",
            "OPENAPI_GENERATION",
            "GENERAL_QA",
        }
