waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Bug]: `wsh ai` don't pipe the additional message

Open rantos9 opened this issue 8 months ago • 1 comments

Current Behavior

On wsh reference there's the following example: tail -n 50 mylog.log | wsh ai - "can you tell me what this error means?". Currently it doesn't work. It pipes stdin to the ai block but not the additional message.

Image

Expected Behavior

I expected the message to be piped.

Steps To Reproduce

In a terminal block run:

for i in $(seq 1 100); do echo "2023-10-$(printf "%02d" $((RANDOM % 30 + 1))) $(printf "%02d:%02d:%02d" $((RANDOM % 24)) $((RANDOM % 60)) $((RANDOM % 60))) - INFO - This is a fake log entry number $i" >> mylog.log; done

tail -n 50 mylog.log | wsh ai - "can you tell me what this error means?"

Wave Version

Client Version 0.11.2 (202503082049)

Platform

macOS

OS Version/Distribution

macOS Sequoia 15.3.2

Architecture

arm64

Anything else?

No response

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

rantos9 avatar Apr 21 '25 16:04 rantos9

I do think this is a bug, however you can work around it like so. (echo "can you tell me what this error means?" & & tail -n 50 mylog.log) | wsh ai -

au70ma70n avatar Apr 28 '25 17:04 au70ma70n

just pushed a fix for this to main... #2129

sawka avatar Apr 28 '25 19:04 sawka