honcho/tests
lilyplasticlabs c8fe40a329 fix(dreamer): preserve last_dream_document_count in completion write
CodeRabbit caught this: update_collection_internal_metadata uses a
top-level JSONB `||` merge, so passing {"dream": {"last_dream_at": ...}}
replaces the entire "dream" subkey and drops last_dream_document_count
that was written by enqueue_dream.

Symptom: after every completed dream, the baseline drops to 0. Next
check_and_schedule_dream reads documents_since_last_dream as
current_count - 0 = current_count, so any collection with >= 50
explicit observations can re-trigger immediately once the 8h guard
expires, even with no new raw material.

Fix: read-modify-write. Fetch current collection, merge last_dream_at
into the existing "dream" dict, write the merged dict back. Preserves
sibling keys (current: last_dream_document_count; future-proof for
telemetry fields that might land in PR 4).

Regression test added to tests/dreamer/test_dreamer_integration.py:
pre-seeds {"dream": {"last_dream_document_count": 42}}, runs
process_dream, asserts both last_dream_at is written AND
last_dream_document_count == 42 is preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 17:43:28 -04:00
..
alembic feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
bench Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
crud fix dialectic held connection (#477) 2026-04-02 11:13:09 -04:00
deriver test(dreamer): threshold filter + last_dream_at relocation regression tests 2026-04-17 15:30:45 -04:00
dialectic feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
dreamer fix(dreamer): preserve last_dream_document_count in completion write 2026-04-17 17:43:28 -04:00
integration Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
reconciler fix: Various Codex Audits (#386) 2026-02-13 12:00:15 -05:00
routes fix(files): handle empty json uploads safely (#434) 2026-03-18 18:36:34 -04:00
sdk ts SDK fix: adding strict checking (#421) 2026-03-30 10:57:12 -04:00
sdk_typescript Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
telemetry switch OTEL metrics to prometheus (#344) 2026-01-25 17:26:42 -05:00
unified fix: Remove noisy sentry error on llm failure and upgrade deps (#396) 2026-02-23 15:53:29 -05:00
utils Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
webhooks Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
__init__.py [0.0.10] Release 2024-07-25 13:45:27 -04:00
conftest.py Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
test_advanced_filters.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
test_datetime_parsing.py create Representation class and use it to unify all formatting (#214) 2025-10-07 15:28:44 -04:00
test_dependencies.py Vineeth/force rollback (#486) 2026-04-03 11:58:03 -04:00
test_schema_validations.py fix: add migration for 'deriver' to 'reasoning' in ResolvedConfiguration (#352) 2026-01-27 11:17:49 -05:00
test_search.py Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00