From e1e5e7aedf868aaaa2e0d4d32ac2ddc4ab134a64 Mon Sep 17 00:00:00 2001 From: Junyan Chin Date: Wed, 25 Mar 2026 21:06:49 +0800 Subject: [PATCH] fix: get_llm_models handler returns UUID strings instead of full model dicts (#2081) The plugin SDK declares get_llm_models() -> list[str] (UUID strings), but the host handler returned the full model dict list from llm_model_service.get_llm_models(). This caused TypeError when invoke_llm passed a dict to get_model_by_uuid (which is decorated with @async_lru and requires hashable arguments). Extract only the 'uuid' field to match the SDK contract. --- src/langbot/pkg/plugin/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/langbot/pkg/plugin/handler.py b/src/langbot/pkg/plugin/handler.py index ae6bb7b9..8236126b 100644 --- a/src/langbot/pkg/plugin/handler.py +++ b/src/langbot/pkg/plugin/handler.py @@ -314,11 +314,11 @@ class RuntimeConnectionHandler(handler.Handler): @self.action(PluginToRuntimeAction.GET_LLM_MODELS) async def get_llm_models(data: dict[str, Any]) -> handler.ActionResponse: - """Get llm models""" + """Get llm models, returns list of UUID strings""" llm_models = await self.ap.llm_model_service.get_llm_models(include_secret=False) return handler.ActionResponse.success( data={ - 'llm_models': llm_models, + 'llm_models': [m['uuid'] for m in llm_models], }, )