Skip to content

fix(signal): evict oldest sent timestamp instead of arbitrary one - #2773

Closed
dieutx wants to merge 1 commit into
NousResearch:mainfrom
dieutx:fix/signal-sent-timestamp-eviction
Closed

fix(signal): evict oldest sent timestamp instead of arbitrary one#2773
dieutx wants to merge 1 commit into
NousResearch:mainfrom
dieutx:fix/signal-sent-timestamp-eviction

Conversation

@dieutx

@dieutx dieutx commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _track_sent_timestamp() uses set.pop() to evict when the echo-back filter exceeds 50 entries
  • set.pop() removes an arbitrary element, not the oldest — could drop a recent timestamp while keeping old ones
  • This causes the echo-back filter to miss actual echo-backs in Note to Self / self-chat mode
  • Fix: use min() to always evict the oldest timestamp

How to reproduce

  • Use Signal Note to Self / self-chat mode
  • Send 50+ messages rapidly
  • Some echo-backs may slip through the filter because recent timestamps get evicted randomly

How to test

  • All 33 signal tests pass
  • The fix is a 1-line change: set.pop()set.discard(min(set))

Platform tested

  • Linux, hermes-agent v0.4.0

set.pop() removes an arbitrary element, so the echo-back filter
could drop a recent timestamp while keeping old ones. This causes
the filter to miss actual echo-backs and let duplicate messages
through. Use min() to always evict the oldest timestamp.
@dieutx dieutx closed this Mar 24, 2026
@dieutx dieutx reopened this Mar 24, 2026
@dieutx dieutx closed this Mar 24, 2026
@dieutx dieutx reopened this Mar 24, 2026
@dieutx

dieutx commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing — small fix with no tests, cleaning up stale PRs.

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