From b8e17c37c16d47e775d434fed6147f05e359b1ad Mon Sep 17 00:00:00 2001 From: Juan Pablo Vega Date: Mon, 25 Nov 2024 18:04:22 +0100 Subject: [PATCH] Remove Auth Cache + Fix tree=None --- agenta-cli/agenta/sdk/decorators/routing.py | 6 +++--- agenta-cli/agenta/sdk/middleware/auth.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/agenta-cli/agenta/sdk/decorators/routing.py b/agenta-cli/agenta/sdk/decorators/routing.py index 73d05a8571..32b0d29bfb 100644 --- a/agenta-cli/agenta/sdk/decorators/routing.py +++ b/agenta-cli/agenta/sdk/decorators/routing.py @@ -373,19 +373,19 @@ async def execute_function( async def handle_success(self, result: Any, inline_trace: bool): data = None - trace = dict() + tree = None with suppress(): data = self.patch_result(result) if inline_trace: - trace = await self.fetch_inline_trace(inline_trace) + tree = await self.fetch_inline_trace(inline_trace) log.info(f"----------------------------------") log.info(f"Agenta SDK - exiting with success: 200") log.info(f"----------------------------------") - return BaseResponse(data=data, tree=trace) + return BaseResponse(data=data, tree=tree) def handle_failure(self, error: Exception): log.warning("--------------------------------------------------") diff --git a/agenta-cli/agenta/sdk/middleware/auth.py b/agenta-cli/agenta/sdk/middleware/auth.py index 3c163ce9cd..c51e0614f7 100644 --- a/agenta-cli/agenta/sdk/middleware/auth.py +++ b/agenta-cli/agenta/sdk/middleware/auth.py @@ -27,6 +27,8 @@ "t", ) +AGENTA_SDK_AUTH_CACHE = False + AGENTA_UNAUTHORIZED_EXECUTION_ALLOWED = str( environ.get("AGENTA_UNAUTHORIZED_EXECUTION_ALLOWED", False) ).lower() in ("true", "1", "t")