- Add more nickname length variants (4-12 chars)
- Add explicit 'Kene' nickname for names starting with 'kene'
- Fix duplicate removal to be case-insensitive
- Add global event handler to log all IRC events
- Add on_join handler to properly track channel joins
- Add on_disconnect handler to detect connection drops
- Add on_privmsg handler to catch messages that might not trigger pubmsg
- Add detailed debug logging throughout message flow
- Improve test_irc.py with same debugging capabilities
Enhanced _generate_nicknames() to support more name variations:
Before (for 8-char name "Kenearos"):
- Generated: Kene (4 chars only)
After:
- Generates at 4, 6, 8, 10, 12 character positions
- For "kenearosmd": Kene, Kenear, Kenearos, kenearosmd
- Special handling: removes 'md' suffix if present
(kenearosmd → also adds kenearos)
This allows users with longer usernames to be recognized:
- Bot name "kenearosmd" generates: kene, kenear, kenearos
- Bot responds to all variations and the full name
Fixes issue where users couldn't use their full username
if it was longer than the configured bot name.
Added two diagnostic tools:
test_mention.py:
- Tests MentionDetector with various message formats
- Shows nickname generation (Kene from Kenearos)
- Displays extracted content from mentions
- Helps verify mention detection is working correctly
test_irc.py:
- Minimal IRC bot for testing message reception
- Prints all received messages to console
- Helps diagnose if IRC connection is receiving messages
- Useful for debugging connection issues
These tools help troubleshoot when bot doesn't respond:
1. Run test_mention.py to verify detection logic
2. Run test_irc.py to verify IRC message reception
Corrected model list based on official Perplexity API documentation:
REMOVED (not available via API):
- llama-3.1-sonar-small-128k-online
- llama-3.1-sonar-large-128k-online
- llama-3.1-sonar-huge-128k-online
ADDED (actual API models):
- sonar-reasoning-pro (powered by DeepSeek-R1)
- sonar-deep-research (long-form research)
AVAILABLE MODELS:
1. sonar-pro (recommended for chat bots)
2. sonar (lightweight, fast)
3. sonar-reasoning (real-time reasoning)
4. sonar-reasoning-pro (advanced reasoning)
5. sonar-deep-research (research reports)
Updated info popup with:
- Accurate model descriptions from official docs
- Built on Llama 3.3 70B (sonar/sonar-pro)
- DeepSeek-R1 for sonar-reasoning-pro
- Clear use case recommendations
Updated MODEL_CHANGE.md with correct information.
Source: Perplexity API official documentation (2026)
Setup wizard improvements:
- Expanded model dropdown with 6 Perplexity models:
* sonar-pro (recommended default)
* sonar
* sonar-reasoning
* llama-3.1-sonar-small-128k-online
* llama-3.1-sonar-large-128k-online
* llama-3.1-sonar-huge-128k-online
- Added info button (?) next to model selector
- Info popup explains each model's characteristics:
* Performance
* Use cases
* Speed/quality tradeoffs
* Cost considerations
Created MODEL_CHANGE.md documentation:
- How to change model in .env file
- How to re-run setup wizard
- Detailed model descriptions
- Example configuration
Users can now easily choose the right model for their needs
and change it anytime without reconfiguring everything.
Enhanced bot to respond to partial names and ambiguous greetings:
MentionDetector improvements (utils.py):
- Auto-generate nicknames from bot name (kenearosmd → Kene, Kenearos)
- Add patterns for all nicknames (full name + partial names)
- New is_ambiguous_greeting() method for greetings without clear mention
- Updated extract_content() to remove all name variants
Bot logic improvements (chatbot.py):
- New check_if_addressed() method uses AI to determine if ambiguous
messages are directed at the bot
- AI analyzes greetings like "Hi wie gehts" and decides if bot should respond
- If AI confirms, message is processed like a normal mention
Recognition examples:
- kenearosmd: wie gehts → responds ✅
- Kene was meinst du → responds ✅
- Kenearos! → responds ✅
- Hi wie gehts → AI checks context → responds if appropriate ✅
This prevents the bot from spamming on every greeting while still
being responsive when addressed indirectly.
Enhanced MentionDetector to recognize bot name in more contexts:
Detection patterns now include:
- @botname anywhere (with word boundary)
- botname with punctuation (: ! ? , .)
- botname at start of message
- botname anywhere as whole word (new catchall pattern)
Content extraction improved to remove bot name from:
- Start of message (with @mention or plain)
- End of message (with optional punctuation)
- Middle of message (with punctuation)
Now responds to all these variations:
- @kenearosmd Hi
- kenearosmd: wie gehts?
- kenearosmd was meinst du?
- Hallo kenearosmd
- kenearosmd!
- Frage an kenearosmd hier
The bot was detecting mentions correctly but not responding because
the async event loop was never started.
Changes:
- Created separate _run_event_loop() method to run loop.run_forever()
- Start event loop in its own daemon thread before IRC bot
- IRC bot thread no longer sets event loop (handled by loop thread)
- Now asyncio.run_coroutine_threadsafe() can properly execute async tasks
This fixes the issue where mentions were detected but handle_mention()
was never executed because there was no running event loop to process
the coroutine.
Improved error handling in bot shutdown process:
- Check connection state before attempting to quit IRC
- Use thread-safe event loop shutdown
- Filter expected shutdown errors from error logs
- Changed shutdown errors to debug level logging
This prevents the "file descriptor cannot be a negative integer (-1)"
error from appearing as an ERROR when cleanly shutting down the bot.
Fixed inconsistent error handling in ai_provider.py and memory.py by:
- Adding optional logger parameter to PerplexityProvider and ConversationMemory classes
- Replacing all print() statements with proper logger.error() calls
- Updating chatbot.py to pass logger instance to both components
- Ensuring consistent logging architecture across the codebase
This improves error visibility and integrates with the existing logging infrastructure.
- Log extracted content to help debug empty content issue
- Add warning when content is empty after mention extraction
- Display extraction info in dashboard for better visibility
Helps diagnose why bot detects mentions but doesn't respond
- Replace PySimpleGUI 5.0.8.3 with FreeSimpleGUI 5.1.1
- FreeSimpleGUI is a community fork without license requirements
- PySimpleGUI 5.x requires paid license after trial period
- Remove compatibility fallback code (no longer needed)
- Update documentation to reflect FreeSimpleGUI usage
Fixes: AttributeError 'module PySimpleGUI has no attribute theme'
- Fix CI/CD failure due to PySimpleGUI 4.60.0 being removed from PyPI
- Upgrade to PySimpleGUI 5.0.8.3 (latest stable version)
- GUI code uses basic features that should remain compatible
Changes:
- Create setup_wizard.py with interactive configuration flow
- Validates Twitch OAuth token via IRC test
- Validates Perplexity API key with test request
- Guides user through all required settings
- Creates .env file and necessary directories
- Update config.py system prompt to reflect Kene's personality
- Bot now responds AS Kene (first person)
- Includes tech expertise (Bambu X1C, H2C, coding/bots)
- Reflects political stance (left-leaning, anti-right)
- Maintains authentic conversational style
- Update README.md with setup wizard instructions
- Clear step-by-step for Option 1 (wizard)
- Lists wizard features and benefits
This commit implements the full Eugen bot based on specifications in CLAUDE.md and eugen_claude.md.
Features implemented:
- Smart name recognition (@Eugen, Eugen:, etc.)
- Persistent conversation memory per user (max 25 messages, 1 hour retention)
- Perplexity Sonar API integration for AI responses
- Live monitoring dashboard with PySimpleGUI
- Setup wizard for first-time configuration
- Comprehensive logging (main log + API debug log)
Files added:
- config.py: Configuration management from .env and config.json
- utils.py: MentionDetector and Logger utility classes
- memory.py: ConversationMemory for persistent chat history
- ai_provider.py: PerplexityProvider for API integration
- gui.py: Dashboard and SetupWizard GUI components
- chatbot.py: Main EugenBot orchestrator with IRC handling
- requirements.txt: Python dependencies
- .env.example: Template for environment variables
- .gitignore: Renamed from gitignore for proper Git usage
Updated:
- README.md: Complete usage instructions and documentation
The bot is ready to use - users just need to add their API keys and run python chatbot.py