Skip to content

Fix percentage mismatch between chat messages and OBS overlay#34

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-percentage-in-chat-overlay
Open

Fix percentage mismatch between chat messages and OBS overlay#34
Copilot wants to merge 2 commits intomainfrom
copilot/fix-percentage-in-chat-overlay

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

Chat was displaying different similarity percentages than the overlay for the same guess (e.g. "maison: 47%" in chat vs 48% on overlay) due to inconsistent rounding strategies.

Root cause

  • Chat (bot/bot.py): int(score * 100) — truncates toward zero
  • Overlay (index.html): Math.round(score * 100) — rounds to nearest integer

For a score like 0.475, this produces 47% in chat and 48% in the overlay.

Changes

  • bot/bot.py: Replace int(score * 100) with round(score * 100) in all four display sites — guess (new guess + already-cited), hint, and status commands
  • tests/test_commands.py: Add regression test using a scorer returning 0.475 to assert chat shows 48%, not 47%
# Before
pct = int(result.entry.score * 100)   # 0.475 → 47

# After
pct = round(result.entry.score * 100) # 0.475 → 48
Original prompt

This section details on the original issue you should resolve

<issue_title>The percentage is not always the same in the chat and in the overlay.</issue_title>
<issue_description>Image</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…y's Math.round()

Co-authored-by: FlorentPoinsaut <1256948+FlorentPoinsaut@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix percentage mismatch in chat and overlay Fix percentage mismatch between chat messages and OBS overlay Mar 15, 2026
Copilot AI requested a review from FlorentPoinsaut March 15, 2026 09:44
@FlorentPoinsaut FlorentPoinsaut marked this pull request as ready for review March 15, 2026 09:45
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.

The percentage is not always the same in the chat and in the overlay.

2 participants