hermes-agent/gateway/platforms
JonthanaHanh 58f6678e6d fix(gateway): flush pending messages to disk before shutdown clear (#72680)
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
2026-07-28 18:08:24 +05:30
..
qqbot fix(gateway): pass encoding="utf-8" to read_text/write_text in update path (#37423) 2026-07-24 15:47:12 -07:00
ADDING_A_PLATFORM.md
…
__init__.py
…
_http_client_limits.py
…
api_server.py fix(api): redact subagent stream fields + forward child_session_id 2026-07-26 20:37:04 -07:00
base.py fix(gateway): flush pending messages to disk before shutdown clear (#72680) 2026-07-28 18:08:24 +05:30
bluebubbles.py
…
helpers.py
…
msgraph_webhook.py
…
signal.py
…
signal_format.py
…
signal_rate_limit.py
…
webhook.py refactor(gateway): promote autonomous silence matcher to shared response_filters helper 2026-07-26 16:55:42 -07:00
webhook_filters.py
…
weixin.py fix(weixin): tighten TCPConnector keepalive to drain CLOSE_WAIT sockets 2026-07-26 19:43:44 -07:00
whatsapp_cloud.py
…
whatsapp_common.py
…
yuanbao.py
…
yuanbao_media.py
…
yuanbao_proto.py
…
yuanbao_sticker.py
…