mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-30 19:09:28 +00:00
When FTS5 index corruption prevents INSERT INTO messages, the gateway accumulates messages in _pending_messages (memory-only). On shutdown, .clear() discards the only surviving copy — permanent user data loss. Changes: - Add gateway/shutdown_flush.py with flush_pending_to_file() and recover_pending_to_db() for two-phase data preservation. - Patch gateway/run.py: flush runner._pending_messages before clear() in _stop_impl_body, and recover on startup after runner.start(). - Patch gateway/platforms/base.py: flush adapter._pending_messages before clear() in the adapter shutdown path. Recovery behavior: - Reads pending JSON files from ~/.hermes/pending_messages/ - Inserts messages into state.db directly - Per-session isolation: one corrupt session doesn't block others - Successful recovery deletes the flush file - Failed recovery re-saves for next startup retry |
||
|---|---|---|
| .. | ||
| qqbot | ||
| __init__.py | ||
| _http_client_limits.py | ||
| ADDING_A_PLATFORM.md | ||
| api_server.py | ||
| base.py | ||
| bluebubbles.py | ||
| helpers.py | ||
| msgraph_webhook.py | ||
| signal.py | ||
| signal_format.py | ||
| signal_rate_limit.py | ||
| webhook.py | ||
| webhook_filters.py | ||
| weixin.py | ||
| whatsapp_cloud.py | ||
| whatsapp_common.py | ||
| yuanbao.py | ||
| yuanbao_media.py | ||
| yuanbao_proto.py | ||
| yuanbao_sticker.py | ||