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
This commit is contained in:
Sanjay Santhanam 2026-04-23 12:55:16 -07:00 committed by GitHub
parent b389627194
commit 5f9cb3f3c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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,
)