Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
chore(api): convert AppContext from ABC to Protocol (#37203)
Eric Caoa8977be9991c
diff --git a/api/context/execution_context.py b/api/context/execution_context.pyindex 6fb3ca19712..ea3d9969290 100644--- a/api/context/execution_context.py+++ b/api/context/execution_context.py@@ -7,7 +7,6 @@ consumes injected context managers when it needs to preserve thread-local state.import contextvarsimport threading-from abc import ABC, abstractmethodfrom collections.abc import Callable, Generatorfrom contextlib import AbstractContextManager, contextmanagerfrom typing import Any, Protocol, final, override, runtime_checkable@@ -15,28 +14,25 @@ from typing import Any, Protocol, final, override, runtime_checkablefrom pydantic import BaseModel-class AppContext(ABC):+class AppContext(Protocol):"""- Abstract application context interface.+ Application context interface.Application adapters can implement this to restore framework-specific statesuch as Flask app context around worker execution."""- @abstractmethoddef get_config(self, key: str, default: Any = None) -> Any:"""Get configuration value by key."""- raise NotImplementedError+ ...- @abstractmethoddef get_extension(self, name: str) -> Any:"""Get application extension by name."""- raise NotImplementedError+ ...- @abstractmethoddef enter(self) -> AbstractContextManager[None]:"""Enter the application context."""- raise NotImplementedError+ ...@runtime_checkablediff --git a/api/tests/unit_tests/core/workflow/context/test_execution_context.py b/api/tests/unit_tests/core/workflow/context/test_execution_context.pyindex 3ce4bb753b9..82411e1b10d 100644--- a/api/tests/unit_tests/core/workflow/context/test_execution_context.py+++ b/api/tests/unit_tests/core/workflow/context/test_execution_context.py@@ -20,15 +20,6 @@ from context.execution_context import ()-class TestAppContext:- """Test AppContext abstract base class."""-- def test_app_context_is_abstract(self):- """Test that AppContext cannot be instantiated directly."""- with pytest.raises(TypeError):- AppContext() # type: ignore--class TestNullAppContext:"""Test NullAppContext implementation."""