Skip to content

Comments

fix(msg): stop say from repeating in listen mode#23

Open
mldangelo wants to merge 1 commit intomainfrom
fix/msg-listen-duplicate-say
Open

fix(msg): stop say from repeating in listen mode#23
mldangelo wants to merge 1 commit intomainfrom
fix/msg-listen-duplicate-say

Conversation

@mldangelo
Copy link
Member

Summary

  • msg_listen was truncating message timestamps from float to integer (${new_ts%.*}), e.g. 1707849600.51707849600
  • The relay uses strict > comparison, so the truncated integer timestamp caused already-seen messages to be re-fetched every 2-second poll cycle
  • This triggered msg_say (TTS) repeatedly for the same message, never "clearing" it
  • Fix: preserve the full float timestamp so the relay correctly excludes already-seen messages

Test plan

  • Run crab msg listen and send a message — verify it displays once and TTS fires once
  • Verify subsequent polls don't re-display or re-speak the same message
  • Send multiple messages in quick succession — all should display exactly once

🤖 Generated with Claude Code

The listen loop truncated message timestamps to integers via
${new_ts%.*}, causing the relay's strict > comparison to re-return
the same messages every polling cycle. This made msg_say fire
repeatedly for already-seen messages. Keep the full float timestamp
so messages are properly excluded after being displayed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant