Description
The Surprisal module in src/dreamer/surprisal.py line 264 uses an incorrect filter format when calling get_all_documents().
Problem
# Current code (incorrect)
filters = {"level": levels}
This format is not recognized by the apply_filter function in src/utils/filter.py, which expects:
# Expected format
filters = {"level": {"in": levels}}
Impact
When Surprisal tries to filter observations by level, it returns 0 results, causing:
- Surprisal computation to fail silently
- Dream cycle to skip the Surprisal phase
- No high-surprisal observations are identified
Fix
Change line 264 in src/dreamer/surprisal.py:
# Before
filters = {"level": levels}
# After
filters = {"level": {"in": levels}}
Environment
- Honcho version: latest (commit from April 2026)
- Python: 3.11+
Verification
After fix:
docker compose up -d --build deriver
docker exec honcho-deriver-1 python -c "
from src.dreamer.surprisal import get_surprisal_observations
import asyncio
result = asyncio.run(get_surprisal_observations(workspace='test', peer_id='test'))
print(f'Found {len(result)} high-surprisal observations')
"
Should return non-zero count of observations.
Related
This bug was discovered during practical testing with SURPRISAL_ENABLED=true. The fix was verified with a complete Dream cycle that successfully identified 15 high-surprisal observations from 152 total.
Description
The Surprisal module in
src/dreamer/surprisal.pyline 264 uses an incorrect filter format when callingget_all_documents().Problem
This format is not recognized by the
apply_filterfunction insrc/utils/filter.py, which expects:Impact
When Surprisal tries to filter observations by level, it returns 0 results, causing:
Fix
Change line 264 in
src/dreamer/surprisal.py:Environment
Verification
After fix:
Should return non-zero count of observations.
Related
This bug was discovered during practical testing with SURPRISAL_ENABLED=true. The fix was verified with a complete Dream cycle that successfully identified 15 high-surprisal observations from 152 total.