fix(memory): preserve full consolidation input - #5379
Conversation
Solaris-star
left a comment
There was a problem hiding this comment.
Checked head fd50eb5c40fb179c765d9337cc80b75586c30315 in a clean checkout.
uv run --no-sync ruff check nanobot/agent/memory.py nanobot/utils/helpers.py tests/agent/test_consolidator.py tests/utils/test_helpers.py— passeduv run --no-sync pytest tests/utils/test_helpers.py tests/agent/test_consolidator.py tests/agent/test_auto_compact.py tests/agent/test_memory_store.py tests/agent/test_dream.py -q— 210 passeduv run --no-sync basedpyright nanobot/agent/memory.py nanobot/utils/helpers.py— 0 errors
The joined chunks are lossless, the cursor advances only after the complete archive attempt, and the delayed history writes avoid leaving a partial summary before the raw fallback. I did not find a blocking correctness issue in the reviewed files.
One operational trade-off worth keeping visible: very large histories now make serial provider calls and return a concatenated _last_summary, so latency/cost and injected summary size grow with the number of chunks. If that is intentional, the current tests document the behavior well; if not, a later pass could aggregate/cap the returned summary separately from the per-chunk history entries.
Summary
Testing
uv run --no-sync ruff check nanobot/agent/memory.py nanobot/utils/helpers.py tests/agent/test_consolidator.py tests/utils/test_helpers.pyuv run --no-sync pytest tests/utils/test_helpers.py tests/agent/test_consolidator.py tests/agent/test_auto_compact.py tests/agent/test_memory_store.py tests/agent/test_dream.py -q(210 passed)uv run --no-sync pytest -q(6190 passed, 51 skipped; 5 environment-specific failures reproduced on unmodified origin/main)Fixes #5377