feat: Last Prompt shows full prompt with evil mode awareness
- discord_bridge before_agent_starts now checks evil_mode from
working_memory to load the correct personality files:
Normal: miku_lore/prompt/lyrics + /app/moods/{mood}.txt
Evil: evil_miku_lore/prompt/lyrics + /app/moods/evil/{mood}.txt
- Reads files directly instead of relying on cross-plugin working_memory
- cat_client.query() returns (response, full_prompt) tuple
- Full prompt includes system prefix + recalled memories + conversation
- API /prompt/cat returns full_prompt field
This commit is contained in:
14
bot/bot.py
14
bot/bot.py
@@ -542,7 +542,7 @@ async def on_message(message):
|
||||
if globals.USE_CHESHIRE_CAT:
|
||||
try:
|
||||
from utils.cat_client import cat_adapter
|
||||
response = await cat_adapter.query(
|
||||
cat_result = await cat_adapter.query(
|
||||
text=enhanced_prompt,
|
||||
user_id=str(message.author.id),
|
||||
guild_id=str(guild_id) if guild_id else None,
|
||||
@@ -550,11 +550,12 @@ async def on_message(message):
|
||||
mood=globals.DM_MOOD,
|
||||
response_type=response_type,
|
||||
)
|
||||
if response:
|
||||
if cat_result:
|
||||
response, cat_full_prompt = cat_result
|
||||
logger.info(f"🐱 Cat embed response for {author_name}")
|
||||
import datetime
|
||||
globals.LAST_CAT_INTERACTION = {
|
||||
"prompt": enhanced_prompt,
|
||||
"full_prompt": cat_full_prompt,
|
||||
"response": response[:500] if response else "",
|
||||
"user": author_name,
|
||||
"mood": globals.DM_MOOD,
|
||||
@@ -639,7 +640,7 @@ async def on_message(message):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
response = await cat_adapter.query(
|
||||
cat_result = await cat_adapter.query(
|
||||
text=prompt,
|
||||
user_id=str(message.author.id),
|
||||
guild_id=str(guild_id) if guild_id else None,
|
||||
@@ -647,7 +648,8 @@ async def on_message(message):
|
||||
mood=current_mood,
|
||||
response_type=response_type,
|
||||
)
|
||||
if response:
|
||||
if cat_result:
|
||||
response, cat_full_prompt = cat_result
|
||||
effective_mood = current_mood
|
||||
if globals.EVIL_MODE:
|
||||
effective_mood = f"EVIL:{getattr(globals, 'EVIL_DM_MOOD', 'evil_neutral')}"
|
||||
@@ -655,7 +657,7 @@ async def on_message(message):
|
||||
# Track Cat interaction for Web UI Last Prompt view
|
||||
import datetime
|
||||
globals.LAST_CAT_INTERACTION = {
|
||||
"prompt": prompt,
|
||||
"full_prompt": cat_full_prompt,
|
||||
"response": response[:500] if response else "",
|
||||
"user": author_name,
|
||||
"mood": effective_mood,
|
||||
|
||||
Reference in New Issue
Block a user