Fix vision pipeline: ffmpeg removal by autoremove, increase vision timeout, reduce frame count, add Discord activity awareness

- bot/Dockerfile: Add ffmpeg to reinstall line after apt-get autoremove
  (autoremove was sweeping up ffmpeg as 'no longer needed' after playwright install)
- bot/utils/image_handling.py: Increase video analysis timeout 120s→300s, 6→3 for Tenor GIFs (GTX 1660 VRAM constraint)
- bot/utils/activities.py: Add _activity_changed_at timestamp tracking,
  get_current_activity_label() and get_current_activity_fresh() with 30-min decay
- bot/utils/cat_client.py: Pass current Discord activity to Cheshire Cat pipeline
- bot/utils/llm.py: Inject current Discord activity into system prompt
- cat-plugins/*: Forward Discord activity through working_memory to personality plugins
- bot/persona/*/preamble.txt: Add Discord status usage guidelines for character prompts
- llama-swap-rocm-config.yaml: Add qwen3.5 model entry for ComfyUI prompt generation
- AGENTS.md: New project documentation file
This commit is contained in:
2026-05-27 01:18:12 +03:00
parent d333c61c8f
commit 9d2c14fa0b
12 changed files with 168 additions and 6 deletions

View File

@@ -43,6 +43,7 @@ def before_cat_reads_message(user_message_json: dict, cat) -> dict:
response_type = user_message_json.get('discord_response_type', None)
evil_mode = user_message_json.get('discord_evil_mode', False)
media_type = user_message_json.get('discord_media_type', None)
activity = user_message_json.get('discord_activity', None)
# Also check working memory for backward compatibility
if not guild_id:
@@ -55,6 +56,7 @@ def before_cat_reads_message(user_message_json: dict, cat) -> dict:
cat.working_memory['response_type'] = response_type
cat.working_memory['evil_mode'] = evil_mode
cat.working_memory['media_type'] = media_type
cat.working_memory['activity'] = activity
return user_message_json
@@ -351,6 +353,12 @@ Respond in the voice and attitude of your {mood_name.replace('_', ' ')} mood. Th
Miku is currently feeling: {mood_description}
Please respond in a way that reflects this emotional tone."""
# Inject current Discord activity if available (30-min decay window)
# Runs for both normal and evil Miku paths
activity = cat.working_memory.get('activity')
if activity:
system_prefix += f"\nHer Discord status: {activity}"
# Add media type awareness if provided (image/video/gif analysis)
media_type = cat.working_memory.get('media_type', None)
if media_type: