Skip to content

Windows Desktop: pasted screenshot attaches twice in composer #37575

@ianarsenault-tn

Description

@ianarsenault-tn

Bug Description

On Hermes Desktop for Windows, pasting a screenshot into the chat composer attaches the same image twice.

The duplicate attachments are saved as two separate files under:

C:\Users\ianar\AppData\Roaming\Hermes\composer-images\

Example from one paste:

  • composer_2026-06-02_18-33-43-065_224319.png
  • composer_2026-06-02_18-33-43-065_9c6f14.png

Both appear to be the same screenshot.

Steps to Reproduce

  1. On Windows 11, take/copy a screenshot to the clipboard.
  2. Open Hermes Desktop.
  3. Paste the screenshot into the chat composer.
  4. Observe the image appears as two attachments.

Expected Behavior

The pasted screenshot should attach once.

Actual Behavior

The pasted screenshot attaches twice.

Suspected Cause

The composer paste handler extracts image blobs from both clipboard.items and clipboard.files.

On Windows/Electron, the same clipboard image can appear through both paths. The current dedupe uses Set<Blob>(), which only dedupes the same object reference. Electron may provide two different Blob/File objects containing the same image, so both are saved.

Relevant code observed locally:

  • apps/desktop/src/app/chat/composer/index.tsx

    • handlePaste
    • calls extractClipboardImageBlobs(event.clipboardData)
  • apps/desktop/src/app/chat/composer/text-utils.ts

    • extractClipboardImageBlobs
    • checks both clipboard.items and clipboard.files
    • dedupes with Set<Blob>()

Possible Fix

Either:

  • Prefer clipboard.items and skip clipboard.files if image blobs were already found, or
  • Dedupe by image metadata/content-like signature such as type + size + name + lastModified, rather than Blob object identity.

Environment

  • OS: Windows 11
  • App: Hermes Desktop
  • Repo: NousResearch/hermes-agent

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havetype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions