Bug Description
After the .jsonl session logging was removed (commits 351fdcc / b4b118c, v2026.5.28+), the SQLite state.db is the only session persistence layer. However, state.db can lose assistant messages under certain conditions.
Observed Behavior:
In a gateway chat (Matrix), when multiple user messages arrive in rapid succession, the AI agent is interrupted mid-turn. The assistant's response is successfully delivered to the chat platform (visible to the user), but the corresponding assistant row is missing from state.db.
Evidence:
Session 20260610_103107_523f0e18 (message IDs 10414–10429). Hermes's responses appeared normally in Matrix Element chat, but state.db shows no assistant rows in that range — a gap spanning 12+ user messages. System note "Your previous turn was interrupted before you could process" appears before each gap.
Result:
Session history in state.db incomplete. session_search and subsequent agent turns miss context. Cannot be cross-checked because .jsonl logging was removed.
Suggested Fix:
Restore .jsonl session file logging as a reliable fallback. .jsonl is append-only and does not depend on end-of-turn flush. SQLite + .jsonl dual logging existed before v2026.5.16 and was reliable.
Steps to Reproduce
- Deploy the agent in a Matrix room with default single-agent configuration (no parallel processing).
- Chat normally — send a message, let the agent begin responding.
- Before the agent finishes its response, send another message.
- Observe: the assistant's response from step 2 arrives in the chat, but state.db contains no matching assistant row for that turn.
Expected Behavior
All assistant messages delivered to the chat platform must be recorded in persistent session storage. Session history (state.db and/or .jsonl) must be a reliable superset of what was sent to the chat, not a subset.
Actual Behavior
Assistant messages sent to the chat during a mid-turn interruption are visible to the user but absent from state.db. Session history is therefore incomplete — a replay of state.db silently misses messages that the user actually received.
Affected Component
Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
No response
Debug Report
Report https://paste.rs/XtsfP
agent.log https://paste.rs/rcgcf
gateway.log https://paste.rs/bpqZE
Operating System
Deepin 23 (Linux 6.6.25 x86_64 )
Python Version
No response
Hermes Version
No response
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
Bug Description
After the .jsonl session logging was removed (commits 351fdcc / b4b118c, v2026.5.28+), the SQLite state.db is the only session persistence layer. However, state.db can lose assistant messages under certain conditions.
Observed Behavior:
In a gateway chat (Matrix), when multiple user messages arrive in rapid succession, the AI agent is interrupted mid-turn. The assistant's response is successfully delivered to the chat platform (visible to the user), but the corresponding assistant row is missing from state.db.
Evidence:
Session 20260610_103107_523f0e18 (message IDs 10414–10429). Hermes's responses appeared normally in Matrix Element chat, but state.db shows no assistant rows in that range — a gap spanning 12+ user messages. System note "Your previous turn was interrupted before you could process" appears before each gap.
Result:
Session history in state.db incomplete. session_search and subsequent agent turns miss context. Cannot be cross-checked because .jsonl logging was removed.
Suggested Fix:
Restore .jsonl session file logging as a reliable fallback. .jsonl is append-only and does not depend on end-of-turn flush. SQLite + .jsonl dual logging existed before v2026.5.16 and was reliable.
Steps to Reproduce
Expected Behavior
All assistant messages delivered to the chat platform must be recorded in persistent session storage. Session history (state.db and/or .jsonl) must be a reliable superset of what was sent to the chat, not a subset.
Actual Behavior
Assistant messages sent to the chat during a mid-turn interruption are visible to the user but absent from state.db. Session history is therefore incomplete — a replay of state.db silently misses messages that the user actually received.
Affected Component
Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
No response
Debug Report
Operating System
Deepin 23 (Linux 6.6.25 x86_64 )
Python Version
No response
Hermes Version
No response
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?