Skip to content

fix(daemon): deduplicate image transfer notifications#100

Merged
ShunmeiCho merged 1 commit into
ShunmeiCho:mainfrom
LuD1161:fix/image-transfer-dedup
Jun 28, 2026
Merged

fix(daemon): deduplicate image transfer notifications#100
ShunmeiCho merged 1 commit into
ShunmeiCho:mainfrom
LuD1161:fix/image-transfer-dedup

Conversation

@LuD1161

@LuD1161 LuD1161 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Problem

When connected to a remote machine via SSH, clipboard image fetches trigger repeated macOS notifications:

image

Example: cc-clip #2848 — 7de9adb894b27c61 · 220x220 · png — Duplicate of #2846

The remote shim can fetch the same clipboard image multiple times in rapid succession (clipboard managers, agent retries, or the agent re-checking clipboard type after reading). Each fetch fires a new notification with no suppression.

Root Cause

Image transfer envelopes (KindImageTransfer) bypass the Deduper entirely because they have no GenericMessage payload — the dedup logic returns early with return true, nil when msg == nil.

Fix

Extend Deduper.AllowAt() to handle image transfer envelopes using (SessionID, Fingerprint) as the dedup key, applying the same 12-second suppression window used for other notification types. Repeated fetches of the same image within the window are silently suppressed.

Test plan

  • Updated TestDeduperImageTransferDedup — verifies first image passes, duplicate within window is suppressed, and same fingerprint passes again after window expires
  • Updated TestDuplicateDetectionViaNotification — integration test now expects duplicate suppression
  • All 142 daemon tests pass
  • Verified manually: notification spam stops after reinstalling and restarting the service

Image transfer envelopes bypassed the Deduper entirely because they
have no GenericMessage payload. This caused notification spam when the
remote shim fetched the same clipboard image repeatedly within a short
window. Extend AllowAt() to dedup image transfers by (SessionID,
Fingerprint) using the same 12-second suppression window.

Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ShunmeiCho
ShunmeiCho merged commit a9f83f6 into ShunmeiCho:main Jun 28, 2026
1 check passed
@ShunmeiCho

Copy link
Copy Markdown
Owner

Thanks @LuD1161 — merged in a9f83f6. Clean, well-scoped fix: keying image-transfer dedup on (SessionID, Fingerprint) and reusing the existing window was exactly the right layer, and the dedup_test/notify_test updates made the behavior change easy to verify. Appreciated the clear root-cause writeup. 🙏

@LuD1161

LuD1161 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Hey @ShunmeiCho 👋
Thanks for creating this project.
Its been super useful to me specially now that I've been coding with claude on my remote home server and connecting only over tmux.

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