-
Notifications
You must be signed in to change notification settings - Fork 0
feat: show all hole cards and bot names in hand-history mode #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Improves hand-history mode for bot testing and debugging by showing all players' hole cards from the start of each hand, and displaying bot names instead of IDs throughout. Changes: - Add HoleCards field to HandPlayer struct for passing cards to monitors - Update hand runner to pass hole cards and display names in OnHandStart - Modify pretty monitor to display all players' hole cards in the "HOLE CARDS" section - Use bot.DisplayName() instead of bot.ID for consistent naming This makes it much easier to understand bot decision-making when reviewing hands, as you can see what everyone was holding from the start rather than only at showdown. Example output: *** HOLE CARDS *** Dealt to aragorn-dev Q♣ K♠ Dealt to complex-bot-1 7♣ J♥ Dealt to complex-bot-2 9♦ K♦ All names (aragorn-dev, complex-bot-1, etc.) now appear consistently in headers, actions, and summary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
internal/server/hand_runner.go
Outdated
| for i, bot := range hr.bots { | ||
| player := hr.handState.Players[i] | ||
| displayName := bot.DisplayName() | ||
| if displayName == "" { | ||
| displayName = bot.ID // Fallback to ID if no display name | ||
| } | ||
| players[i] = HandPlayer{ | ||
| Seat: i, | ||
| Name: bot.ID, // Use bot ID for stats tracking | ||
| Chips: hr.handState.Players[i].Chips, | ||
| Name: displayName, | ||
| Chips: player.Chips, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using display names as HandPlayer.Name breaks stats indexing
Changing HandPlayer.Name to bot.DisplayName() means the OnHandStart callback now receives display names instead of the unique bot IDs StatsMonitor expects. StatsMonitor uses player.Name as the key for seatToBotID and detailedStats, but later reads and exposes detailed stats by bot ID (stats.BotID). After this change the keys no longer match, so VPIP/PFR data is never returned and multiple bots with the same display name overwrite each other. Consider keeping HandPlayer.Name as the stable ID and passing display names separately or updating StatsMonitor accordingly.
Useful? React with 👍 / 👎.
Addresses P1 feedback: using DisplayName as HandPlayer.Name broke stats tracking because StatsMonitor uses player.Name as the stable key for indexing bot statistics. Changes: - Add DisplayName field to HandPlayer struct for human-readable display - Keep Name field as bot.ID for stable stats tracking (prevents stats key mismatches and duplicate display name conflicts) - Update pretty monitor to use DisplayName for all display purposes (seat listings, hole cards, actions) This ensures stats tracking works correctly while still showing friendly bot names (aragorn-dev, complex-bot-1, etc.) consistently in hand-history output. Co-authored-by: chatgpt-codex-connector[bot]
|
✅ Fixed the P1 stats tracking issue! Problem: Using Solution: Added a separate
Changes in commit 5206515:
Verification:
Thanks @chatgpt-codex-connector for catching this! |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Improves hand-history mode for bot testing and debugging by showing all players' hole cards from the start of each hand, and displaying bot names instead of IDs throughout the output.
Changes
Hole Cards Visibility
HoleCardsfield toHandPlayerstruct for passing cards to monitorsOnHandStartcallbackConsistent Bot Naming
OnHandStartto usebot.DisplayName()instead ofbot.IDMotivation
The
spawnsubcommand is primarily used for testing and troubleshooting bots. In the previous implementation, hole cards were only shown at showdown (like in real poker), which made it difficult to understand why bots made certain decisions during the hand.Additionally, bot IDs (like
5fd3de2c) appeared in the header and actions, while bot names (likearagorn-dev,complex-bot-1) only appeared in the summary, creating inconsistent and confusing output.Example Output
Before:
After:
Testing