From 5f9cb3f3c19350a5b36b6cab9666e84122b96d1f Mon Sep 17 00:00:00 2001 From: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com> Date: Thu, 23 Apr 2026 12:55:16 -0700 Subject: [PATCH] fix(surprisal): use correct filter format for level observations (#581) The Surprisal module passes `{"level": levels}` directly to `get_all_documents()`, but `apply_filter()` expects operator syntax: `{"level": {"in": levels}}`. Without the `in` operator, the filter is silently ignored, causing `_fetch_level_observations()` to return 0 results. This makes the entire Surprisal phase of the Dream cycle a no-op. Fixes #559 --- src/dreamer/surprisal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dreamer/surprisal.py b/src/dreamer/surprisal.py index 093b2d7b..e05ce84d 100644 --- a/src/dreamer/surprisal.py +++ b/src/dreamer/surprisal.py @@ -261,7 +261,7 @@ async def _fetch_recent_observations( workspace_name=workspace_name, observer=observer, observed=observed, - filters={"level": levels} if levels else None, + filters={"level": {"in": levels}} if levels else None, limit=limit, )