Description
opencli deepseek ask --file silently fails with [NO RESPONSE]. Three bugs in utils.js:
-
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.
-
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.
-
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
Description
opencli deepseek ask --filesilently fails with[NO RESPONSE]. Three bugs inutils.js:sendMessage clicked the wrong button.
btn.closest('div')?.querySelector('textarea')always returned null (the button IS a div, soclosest('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.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.DataTransfer ownership transfer.
inp.files = dt.filestransfers the FileList ownership and emptiesdt.files. The code then passed the now-emptydt.filesto React's onChange handler.Steps to Reproduce
Expected Behavior
OpenCLI Version
1.7.7
Node.js Version
Other
Operating System
macOS