From 94cc0a12703be7f6a85f22b07778bacd7a5a1ab6 Mon Sep 17 00:00:00 2001 From: DK09876 Date: Wed, 28 Jan 2026 12:04:19 -0700 Subject: [PATCH] fix: search_mental_models uuid type mismatch after text id migration (#225) The mental_models.id column was changed from UUID to TEXT in migration u6p7q8r9s0t1, but the exclude_ids filter in search_mental_models still cast the parameter as ::uuid[]. This caused every search_mental_models call during reflect to fail with "operator does not exist: text <> uuid", forcing the reflect agent to waste all 5 iterations on retries and producing degraded mental model content. Co-authored-by: Claude Opus 4.5 --- hindsight-api/hindsight_api/engine/reflect/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hindsight-api/hindsight_api/engine/reflect/tools.py b/hindsight-api/hindsight_api/engine/reflect/tools.py index 90957aae..61ffd87f 100644 --- a/hindsight-api/hindsight_api/engine/reflect/tools.py +++ b/hindsight-api/hindsight_api/engine/reflect/tools.py @@ -69,7 +69,7 @@ async def tool_search_mental_models( next_param += 1 if exclude_ids: - filters += f" AND id != ALL(${next_param}::uuid[])" + filters += f" AND id != ALL(${next_param}::text[])" params.append(exclude_ids) next_param += 1