From 5a69f75bd891e702ff53827bd2a0f8f7465b5fc1 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 24 Apr 2026 17:30:32 -0700 Subject: [PATCH] fix: mypy + UI page-metadata sync for memory page Two CI failures: 1. mypy: `_find_memory_for_caller` had `key_filter` inferred as `dict[str, str]` (literal type) and the conditional `{"AND": [key_filter, vis]}` returned `dict[str, list[...]]`, so the join site failed `dict-item` typing. Annotate both intermediates as `dict` so mypy widens the value type. 2. UI test (`page_utils.test.ts > should have descriptions for all pages`): every leftnav entry must have a description in `page_metadata.ts`, and `memory` was missing. Added a one-line description, matching the style of neighboring entries. Co-Authored-By: Claude Opus 4.7 (1M context) --- litellm/proxy/memory/memory_endpoints.py | 4 ++-- ui/litellm-dashboard/src/components/page_metadata.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/memory/memory_endpoints.py b/litellm/proxy/memory/memory_endpoints.py index 39c5f03031f..0cb97f1dccd 100644 --- a/litellm/proxy/memory/memory_endpoints.py +++ b/litellm/proxy/memory/memory_endpoints.py @@ -367,9 +367,9 @@ async def _find_memory_for_caller( prisma_client: Any, key: str, user_api_key_dict: UserAPIKeyAuth ) -> Any: """Look up a memory row by key, scoped to the caller's visibility.""" - key_filter = {"key": key} + key_filter: dict = {"key": key} vis = _visibility_filter(user_api_key_dict) - where = key_filter if vis is None else {"AND": [key_filter, vis]} + where: dict = key_filter if vis is None else {"AND": [key_filter, vis]} rows = await prisma_client.db.litellm_memorytable.find_many( where=where, take=1, order={"updated_at": "desc"} ) diff --git a/ui/litellm-dashboard/src/components/page_metadata.ts b/ui/litellm-dashboard/src/components/page_metadata.ts index 8edbc790799..63f03f4586c 100644 --- a/ui/litellm-dashboard/src/components/page_metadata.ts +++ b/ui/litellm-dashboard/src/components/page_metadata.ts @@ -10,6 +10,7 @@ export const pageDescriptions: Record = { models: "Configure and manage LLM models and endpoints", agents: "Create and manage AI agents", "mcp-servers": "Configure Model Context Protocol servers", + memory: "Inspect and manage agent memory entries stored under /v1/memory", guardrails: "Set up content moderation and safety guardrails", policies: "Define access control and usage policies", "search-tools": "Configure RAG search and retrieval tools",