Skip to content

Improve message reading API to prevent leakage#44

Merged
aphedges merged 6 commits intomainfrom
improve-message-reading-api
Jul 21, 2025
Merged

Improve message reading API to prevent leakage#44
aphedges merged 6 commits intomainfrom
improve-message-reading-api

Conversation

@aphedges
Copy link
Copy Markdown
Contributor

I wrote most of these commits last month, but I haven't rushed to create a PR because no leakage was actually happening. However, I feel these API improvements will still be useful both for the bots in this repository and the bots in other repositories (which might be using leaked messages).

I tested this PR using RandomProposerAdvisor, LrProbsTextVisualAdvisor, and FaafAdvisor without encountering any relevant issues. I also confirmed that no advice leakage was happening with FaafAdvisor.

I have made this PR as a draft because it needs to be merged after #43, which brings in a diplomacy update to provide a better message reading API.

@aphedges aphedges requested a review from YanzeJeremy July 14, 2025 20:00
@aphedges aphedges self-assigned this Jul 14, 2025
@aphedges aphedges marked this pull request as draft July 17, 2025 17:25
Copy link
Copy Markdown
Contributor

@YanzeJeremy YanzeJeremy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested out these changes and the modifications look to me!

@aphedges aphedges force-pushed the update-deps-2025-07-14 branch from 8144d83 to 966820a Compare July 21, 2025 18:05
Base automatically changed from update-deps-2025-07-14 to main July 21, 2025 18:10
aphedges added 6 commits July 21, 2025 14:10
This will make the refactoring in later commits easier.
`Game.messages` is unfiltered, which can cause accidental leakage. Using
`Game.get_messages()` is safer.
These are general-purpose methods that are useful to have for any bot.
The logic was used 6 separate times throughout the repository!
The logic was used 5 separate times throughout the repository!
@aphedges aphedges force-pushed the improve-message-reading-api branch from cb1ba89 to 7d0cc8e Compare July 21, 2025 18:11
@aphedges
Copy link
Copy Markdown
Contributor Author

aphedges commented Jul 21, 2025

I have merged #43, so this PR is ready to merge now! I will merge once CI passes.

@aphedges aphedges marked this pull request as ready for review July 21, 2025 18:12
@aphedges aphedges merged commit 0ee17c8 into main Jul 21, 2025
2 checks passed
@aphedges aphedges deleted the improve-message-reading-api branch July 21, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants