Implemented experimental real production ready voice chat, relegated old flow to voice debug mode. New Web UI panel for Voice Chat.

This commit is contained in:
2026-01-20 23:06:17 +02:00
parent 362108f4b0
commit 2934efba22
31 changed files with 5408 additions and 357 deletions

View File

@@ -0,0 +1,78 @@
# Error Handling Quick Reference
## What Changed
When Miku encounters an error (like "Error 502" from llama-swap), she now says:
```
"Someone tell Koko-nii there is a problem with my AI."
```
And sends you a webhook notification with full error details.
## Webhook Details
**Webhook URL**: `https://discord.com/api/webhooks/1462216811293708522/...`
**Mentions**: @Koko-nii (User ID: 344584170839236608)
## Error Notification Format
```
🚨 Miku Bot Error
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Error Message:
Error: 502
User: username#1234
Channel: #general
Server: Guild ID: 123456789
User Prompt:
Hi Miku! How are you?
Exception Type: HTTPError
Traceback:
[Full Python traceback]
```
## Files Changed
1. **NEW**: `bot/utils/error_handler.py`
- Main error handling logic
- Webhook notifications
- Error detection
2. **MODIFIED**: `bot/utils/llm.py`
- Added error handling to `query_llama()`
- Prevents errors in conversation history
- Catches all exceptions and HTTP errors
3. **NEW**: `bot/test_error_handler.py`
- Test suite for error detection
- 26 test cases
4. **NEW**: `ERROR_HANDLING_SYSTEM.md`
- Full documentation
## Testing
```bash
cd /home/koko210Serve/docker/miku-discord/bot
python test_error_handler.py
```
Expected: ✓ All 26 tests passed!
## Coverage
✅ Works with both llama-swap (NVIDIA) and llama-swap-rocm (AMD)
✅ Handles all message types (DMs, server messages, autonomous)
✅ Catches connection errors, timeouts, HTTP errors
✅ Prevents errors from polluting conversation history
## No Changes Required
No configuration changes needed. The system is automatically active for:
- All direct messages to Miku
- All server messages mentioning Miku
- All autonomous messages
- All LLM queries via `query_llama()`