Skip to content

dsh web: paste-to-path temp files (modlens-dsh-paste-*) are never cleaned up #51

Description

@xiyoucheng

What happened

Pasting an image into the dsh web GUI while a text-only model is selected works
(paste-to-path: the image lands as a file under the system temp folder and the
composer receives the path as plain text), but the temp file is never removed
afterwards. Each paste creates a new modlens-dsh-paste-<random>/paste.<ext>
directory, and these accumulate indefinitely — they survive the read, the
session, and dsh restarts.

The exact command

Not applicable — no command fails; this is about the dsh web paste-to-path flow
(paste an image into the composer under a text-only model). The files appear
under the system temp directory, e.g.
C:\Users\<user>\AppData\Local\Temp\modlens-dsh-paste-XXXX\paste.png.

The full error

None — nothing errors; the problem is disk accumulation over time.

Harness and environment

  • Harness: DeepSeek Harness (dsh), web profile, modlens installed as the native
    plugin (@liustack/modlens@3.17.2)
  • Provider: openai (Qwen-compatible endpoint), but the leak happens before any
    provider is involved
  • modlens --version: 3.17.2
  • node --version: v24.9.0
  • OS: Windows (system temp = %LOCALAPPDATA%\Temp)

Expected

The paste artifact should be removed once it is no longer needed (for example
when the image has been read or the session ends), or stale
modlens-dsh-paste-* directories should be purged periodically. Note the
attachment route (pasting while a (modlens vision) variant is selected) does
not leave temp files behind after the read — paste-to-path should behave the
same.

Steps to reproduce

  1. In the dsh web GUI select a plain text-only model (no (modlens vision)
    suffix).
  2. Paste an image into the composer — the message receives a file path under
    %TEMP%\modlens-dsh-paste-XXXX\.
  3. Let the image be read (or skip the read), then close the session and even
    restart dsh.
  4. Open %TEMP% and confirm the modlens-dsh-paste-XXXX directory is still
    there.
  5. Paste more images — one new directory per paste, each up to 25 MB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions