mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-19 12:58:09 +00:00
2.8 KiB
2.8 KiB
Improve Negotiation Awareness - Experiment
Analysis Date: May 18, 2025
Issue Identified
Powers don't modify their messaging strategies when other powers aren't responding to them. The system already tracks messages to powers, but doesn't explicitly note when outgoing messages are being ignored.
Solution Plan
- Add a method to track which powers are not responding to messages
- Include this information in the negotiation diary prompt
- Add examples showing how to adapt strategies when ignored
Implementation Strategy
- Minimal changes to avoid breaking working system
- Add unanswered message tracking to negotiation diary generation
- Update prompts to include awareness of non-responsive powers
Files to Modify
ai_diplomacy/game_history.py- Add method to track ignored messagesai_diplomacy/prompts/negotiation_diary_prompt.txt- Add awareness of non-responsive powersai_diplomacy/agent.py- Include ignored messages in diary context
Changes to Implement
Step 1: Add tracking method to game_history.py ✓ COMPLETE
Added get_ignored_messages_by_power() method that:
- Tracks which powers don't respond to private messages
- Looks for responses in current and next phase
- Returns a dict mapping power names to their ignored messages
Step 2: Update negotiation diary prompt ✓ COMPLETE
- Added ignored messages context to the prompt
- Added task item to note non-responsive powers
- Added strategic guidance for handling silence
- Added example scenario showing adaptation to ignored messages
Step 3: Update agent.py ✓ COMPLETE
- Added ignored messages tracking in
generate_negotiation_diary_entry() - Included ignored context in template variables
- Added preprocessing for the new template variable
Step 4: Update conversation instructions ✓ COMPLETE
- Added consideration for powers ignoring messages
- Added strategic guidance for dealing with non-responsive powers
Summary of Changes
- Added
get_ignored_messages_by_power()method togame_history.py - Updated
negotiation_diary_prompt.txtwith ignored messages context and example - Modified
agent.pyto track and include ignored messages in diary generation - Enhanced
conversation_instructions.txtwith guidance for non-responsive powers
Technical Implementation
The system now:
- Tracks when private messages go unanswered
- Provides context about which powers are ignoring messages
- Gives strategic guidance on adapting diplomatic approaches
- Includes examples of adjusting strategy based on silence
- Handles both Message objects and dictionary representations
All changes were minimal and surgical to avoid breaking the working system.
Bug Fix
Fixed TypeError where the method was trying to subscript Message objects as dictionaries. The method now handles both Message objects (used in actual game) and dictionaries (used in tests).