fix(honcho): respect writeFrequency in sync_turn - #19650
Conversation
|
Thanks for the focused regression fix. The premise remains valid on current main: Automated hermes-sweeper review. |
d415914 to
3d0ea20
Compare
3d0ea20 to
dcef3f9
Compare
|
Reproduced this on current main in a live Hermes+Honcho setup: a profile with I verified the minimal routing change ( This directly addresses the observed every-turn persistence and keeps the existing |
…ager.save() sync_turn called manager._flush_session() directly, which flushes synchronously every turn no matter what writeFrequency says — the "async", "session", and every-N-turns modes were dead configuration on the main turn path. Route through save(), the dispatcher that actually implements those modes. Same bug class reported in #19650 (starship-s) and #72708 (Diaspar4u); this takes the minimal one-line routing fix without their broader lifecycle refactors. Co-authored-by: starship-s <45587122+starship-s@users.noreply.github.com>
Context
Honcho's
writeFrequencysetting is the user's control for when completed conversation turns are written to Honcho: immediately, asynchronously, at session end, or every N turns. This matters for users who intentionally defer or batch writes, especially for session-end or cadence-based memory syncing.The
sync_turn()path was appending the turn and then calling_flush_session()directly. That bypassedHonchoSessionManager.save(), which is wherewriteFrequencyrouting is applied. As a result, deferred modes such assessionand integer cadences could silently behave like per-turn writes.Change
sync_turn()persistence throughHonchoSessionManager.save()so configuredwriteFrequencymodes are honored.async,turn,session, and integer write-frequency routing fromsync_turn().Why this approach
HonchoSessionManager.save()already centralizes the write-frequency decision. Routingsync_turn()through it keeps the completed-turn sync path consistent with the rest of the Honcho session manager, while preserving immediate flushing for modes that are supposed to flush immediately.This keeps the fix narrow: one routing change plus tests for each supported write-frequency mode.
Test Plan
python -m pytest tests/honcho_plugin/test_sync_turn_write_frequency.py tests/honcho_plugin/test_async_memory.py -q(45 passed)python -m pytest tests/honcho_plugin -q(271 passed)