Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix(core): remove dependency-driven readiness demotions (#10034)
Kian Jonesbc625b35c4ae
diff --git a/letta/data_sources/redis_client.py b/letta/data_sources/redis_client.pyindex 6ff6c2694..28b2574d9 100644--- a/letta/data_sources/redis_client.py+++ b/letta/data_sources/redis_client.py@@ -13,7 +13,6 @@ from letta.constants import ()from letta.errors import ConversationBusyError, MemoryRepoBusyErrorfrom letta.log import get_logger-from letta.monitoring.readiness_state import set_readiness_statefrom letta.otel.metric_registry import MetricRegistryfrom letta.settings import settings@@ -135,9 +134,6 @@ class AsyncRedisClient:return await func(self, *args, **kwargs)except TimeoutError as e:MetricRegistry().redis_timeout_counter.add(1, attributes={"operation": func.__name__})- from letta.settings import readiness_settings- if readiness_settings.enforcement_enabled:- set_readiness_state(reason="degraded_dependency", source=f"redis_timeout:{func.__name__}")last_error = eif attempt < max_attempts - 1:await asyncio.sleep(delay * (2**attempt))diff --git a/letta/monitoring/readiness_state.py b/letta/monitoring/readiness_state.pyindex a8de30798..c67a5638c 100644--- a/letta/monitoring/readiness_state.py+++ b/letta/monitoring/readiness_state.py@@ -10,7 +10,6 @@ _VALID_REASONS = {"warming","draining","degraded",- "degraded_dependency","manual_disable",}diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.pyindex 2a038b276..80b825b50 100644--- a/letta/server/rest_api/app.py+++ b/letta/server/rest_api/app.py@@ -252,7 +252,6 @@ async def lifespan(app_: FastAPI):logger.info(f"[Worker {worker_id}] Scheduler initialization completed")except Exception as e:logger.error(f"[Worker {worker_id}] Scheduler initialization failed: {e}", exc_info=True)- set_readiness_state(reason="degraded_dependency", source="scheduler_init_failure")set_readiness_state(reason="ready", source="lifespan_startup_complete")logger.info(f"[Worker {worker_id}] Lifespan startup completed")diff --git a/letta/server/rest_api/routers/v1/health.py b/letta/server/rest_api/routers/v1/health.pyindex e25ccec81..34f201397 100644--- a/letta/server/rest_api/routers/v1/health.py+++ b/letta/server/rest_api/routers/v1/health.py@@ -12,7 +12,7 @@ if TYPE_CHECKING:router = APIRouter(tags=["health"])# States that should cause readiness to return 503 when enforcement is enabled.-_UNREADY_STATES = {"degraded", "degraded_dependency", "manual_disable", "warming"}+_UNREADY_STATES = {"degraded", "manual_disable", "warming"}@router.get("/health/", response_model=Health, operation_id="check_health")diff --git a/letta/services/streaming_service.py b/letta/services/streaming_service.pyindex 8c7eea2c7..cfdfaae66 100644--- a/letta/services/streaming_service.py+++ b/letta/services/streaming_service.py@@ -26,7 +26,6 @@ from letta.errors import ()from letta.helpers.datetime_helpers import get_utc_timestamp_nsfrom letta.log import get_logger-from letta.monitoring.readiness_state import set_readiness_statefrom letta.otel.context import get_ctx_attributesfrom letta.otel.metric_registry import MetricRegistryfrom letta.schemas.agent import AgentState@@ -504,10 +503,6 @@ class StreamingService:except LLMTimeoutError as e:MetricRegistry().request_timeout_counter.add(1, attributes=in_flight_attrs)MetricRegistry().provider_timeout_counter.add(1, attributes={"provider": provider_name})- from letta.settings import readiness_settings-- if readiness_settings.enforcement_enabled:- set_readiness_state(reason="degraded_dependency", source="provider_timeout")run_status = RunStatus.failedstop_reason = LettaStopReason(stop_reason=StopReasonType.llm_api_error)error_message = LettaErrorMessage(