Skip to content

[Bug]: deepseek --file upload fails silently #1167

@Benjamin-eecs

Description

@Benjamin-eecs

Description

opencli deepseek ask --file silently fails with [NO RESPONSE]. Three bugs in utils.js:

  1. sendMessage clicked the wrong button. btn.closest('div')?.querySelector('textarea') always returned null (the button IS a div, so closest('div') returns itself). Every send used the Enter key fallback. When the send button was disabled during file upload, it clicked the attachment button instead.

  2. sendWithFile sent the message before upload finished. DeepSeek shows the file preview chip immediately (optimistic UI) but the send button stays aria-disabled="true" until the PoW challenge + server upload completes (~2s). The code sent the message as soon as the preview appeared.

  3. DataTransfer ownership transfer. inp.files = dt.files transfers the FileList ownership and empties dt.files. The code then passed the now-empty dt.files to React's onChange handler.

Steps to Reproduce

echo "The answer is 42." > /tmp/test.txt
opencli deepseek ask "what number is in this file" --new --file /tmp/test.txt --timeout 60
# Returns: [NO RESPONSE] No reply within 60s.

Expected Behavior

- response: The number in the file is 42.

OpenCLI Version

1.7.7

Node.js Version

Other

Operating System

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions