The history trimming logic cleared session_id = None whenever entries
exceeded history_size. Since the history was always at capacity, every
new message wiped the session_id immediately after storing it. This
meant --resume was never passed to Claude Code, making every turn a
fresh conversation.
Fix: preserve session_id on trim. Claude Code's --resume loads the
full conversation from its own session transcript on disk, so trimming
our local tracking entries doesn't invalidate the session.
Also adds debug logging for session_id capture/storage (temporary).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The mergemaster's auto-resolver inserted a duplicate chat_stream call
inside the tokio::select! permission loop, producing mismatched braces.
The 266 merge didn't contribute useful code changes to bot.rs — the
session_id handling was already present.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The homeserver requires User-Interactive Authentication before accepting
cross-signing keys. Pass the bot's password so bootstrap succeeds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the require_verified_devices config toggle. The bot now always requires
encrypted rooms and cross-signing-verified devices before executing any command.
Messages from unencrypted rooms or unverified devices are rejected.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add end-to-end encryption support to the Matrix bot using the matrix-sdk
crypto features. The bot now:
- Enables E2EE on the Matrix client with cross-signing bootstrapping
- Auto-verifies its own cross-signing identity on startup
- Handles key verification requests from other users automatically
- Sends encrypted messages in E2EE-enabled rooms
- Adds MATRIX_STORE_PATH config for persistent crypto store
Squash merge of feature/story-194_story_enable_matrix_e2ee_with_cross_signing_verification_on_bot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Story 191: Matrix bot should only respond when directly addressed.
The bot now checks if it was mentioned by name or replied to before
responding, preventing it from answering every message in a room.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add HTML formatted_body to Matrix bot messages so that markdown-style
formatting (code blocks, bold, italic, lists) renders properly in Matrix
clients. Uses the pulldown-cmark crate to convert markdown to HTML and
sets the message format to org.matrix.custom.html.
Story: 188_story_render_matrix_bot_messages_with_html_formatting
Instead of waiting for the full LLM response and sending it as a single
message, stream bot responses to Matrix as they are generated. Paragraphs
are delimited by double-newline boundaries, giving users incremental
feedback while the model is still thinking.
Story: 184_story_stream_bot_responses_to_matrix_on_double_newline_boundaries