diff --git a/agenta-cli/agenta/sdk/decorators/routing.py b/agenta-cli/agenta/sdk/decorators/routing.py index 92d9a3572f..c1f3e51df2 100644 --- a/agenta-cli/agenta/sdk/decorators/routing.py +++ b/agenta-cli/agenta/sdk/decorators/routing.py @@ -164,6 +164,12 @@ async def run_wrapper(request: Request, *args, **kwargs) -> Any: } # LEGACY + if request.state.config["parameters"] is None: + raise HTTPException( + status_code=400, + detail="Config not found based on provided references.", + ) + kwargs, _ = self.split_kwargs(kwargs, default_parameters) return await self.execute_wrapper(request, False, *args, **kwargs) diff --git a/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py b/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py index 45229ea4bc..3b6433e898 100644 --- a/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py +++ b/services/completion-stateless-sdk/agenta/sdk/decorators/routing.py @@ -166,6 +166,12 @@ async def run_wrapper(request: Request, *args, **kwargs) -> Any: } # LEGACY + if request.state.config["parameters"] is None: + raise HTTPException( + status_code=400, + detail="Config not found based on provided references.", + ) + kwargs, _ = self.split_kwargs(kwargs, default_parameters) # TODO: Why is this not used in the run_wrapper?