fix: system message encryption and message processing#30
Open
JohnEsleyer wants to merge 25 commits into
Open
Conversation
- System messages are no longer encrypted (fixes garbled output) - XML commands are rejected when takeover mode is off - Remove unnecessary double-encryption in response - Add isSeen column for unread message tracking - Add helper functions: MarkHistorySeen, GetUnseenCount - Add test files: dog.jpg, 720p.mp4 for give command testing Ref: docs/message-processing.md
- Return role in chat responses for proper client handling - Add error handling for decryption failures (return 400 error) - Log decryption errors in GetHistory with placeholder message - Ref: docs/message-processing.md
- Add isRejected column to history table for tracking rejected XML commands - Add AddHistoryWithRejection function to db.go - Add HandleMarkMessagesSeen endpoint for marking messages as read - Update HandleGetUnreadCount to return actual count from database - Update GetHistory to include isRejected field Ref: docs/message-processing.md
- Switch from GCM to CBC encryption for client compatibility - System prompt now always uses global context.md (ignores agent-specific) - Parser requires <message> tag - rejects responses without it - Fixed duplicate messages in WebSocket broadcast - Add timestamp to history for copy context feature - Handle both enc: and cbc: encryption prefixes
Major improvements to calendar/scheduling system: Parser: - Add new <schedule minutes="N" hours="H" days="D"> tag for relative time scheduling - Server calculates absolute datetime from current time + duration - Supports any combination of minutes/hours/days Scheduler (agent-aware mode): - Move scheduler from main.go to Server for access to LLM - Scheduler injects reminders as user messages to agent - Agent processes reminder and responds naturally - Fix duplicate injection with mutex locking - Mark events executed before triggering agent (prevents race conditions) - Change reminder format to [SCHEDULED_REMINDER] prefix Context/prompt: - Add detailed instructions for handling scheduled reminders - Explicitly instruct agent NOT to re-schedule [SCHEDULED_REMINDER] messages - Show correct vs wrong response examples Other fixes: - ensureRuntimeData now updates existing context.md if source is newer - Add retry mechanism for missing <message> tag (1 retry with reminder) - Typewriter animation uses fixed 5ms per character Docs: - Document new <schedule> tag with examples - Update reminder scenarios to use relative time
… and scheduler improvements - Add event_type field to calendar for action vs deliver scheduling - action type: triggers LLM when fired (for tasks like 'write code in 1 hour') - deliver type: sends pre-written content directly (no LLM call) - Fix timezone handling: use GetSystemTime() for consistent scheduling - Store raw LLM response in history for debugging, broadcast clean message to UI - Add debug logging to scheduler for troubleshooting - Update context.md with scheduling documentation
…an history - Add broadcastMessageWithRole for flexible message role broadcasting - Add broadcastReminderMessage for scheduled reminder styling - Format system execution feedback as readable output instead of raw JSON - Skip terminal execution results when building context (reduce noise) - Store parsed message content in history (not raw XML) - Reminder messages now use 'reminder' role for proper Flutter styling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isSeencolumn for unread message tracking<give>command testingChanges
HermitShell (v0.7.0)
isSeencolumn withMarkHistorySeen()andGetUnseenCount()helpersTest Files
dog.jpg,720p.mp4for<give>command testingTesting
go build ./...Ref: docs/message-processing.md