mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Move gateway routing metadata (session_key, platform, chat_type, origin, display_name, memory_flushed) from sessions.json into the sessions table in state.db. This eliminates the dual-file dependency that caused the mcp_serve polling bug (#8925) and makes state.db the single source of truth for session discovery. Changes: - Schema v7 migration: add 6 new columns to sessions table with backfill from existing sessions.json during migration - New SessionDB methods: set_gateway_metadata(), list_gateway_sessions(), find_session_by_origin(), set_memory_flushed() - Gateway session.py: write routing metadata to state.db on every session create/reset/switch - Rewire all consumers (mcp_serve, mirror, channel_directory, status) to query state.db first with sessions.json fallback for pre-migration databases - mcp_serve _poll_once: simplified to watch only state.db mtime (fixes the split-mtime bug from #8925 as a side effect) sessions.json continues to be written by the gateway for now but is no longer read as the primary source by any consumer. Can be made optional in a future PR. |
||
|---|---|---|
| .. | ||
| builtin_hooks | ||
| platforms | ||
| __init__.py | ||
| channel_directory.py | ||
| config.py | ||
| delivery.py | ||
| display_config.py | ||
| hooks.py | ||
| mirror.py | ||
| pairing.py | ||
| restart.py | ||
| run.py | ||
| session.py | ||
| session_context.py | ||
| status.py | ||
| sticker_cache.py | ||
| stream_consumer.py | ||