continue icon indicating copy to clipboard operation
continue copied to clipboard

Run button only executes comments, ignores actual commands in code blocks

Open saimadib opened this issue 1 year ago • 3 comments

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue version: 
- IDE version: VSCode 1.100.2
- Model: Claude 3.7 Sonnet
- config:
  

  
  OR link to assistant in Continue hub:

Description

When using Continue, the run button in code blocks only processes comments (lines starting with #) but fails to execute the actual commands.

I have recorded a video demonstrating this issue. The video shows that when clicking on the run button, only the comment is processed while the actual command is ignored.

https://drive.google.com/file/d/1KNHq5AOpi9S2MVea1OsGWzjxjo1Jfm57/view?usp=sharing

To reproduce

  1. Open Continue in VS Code/JetBrains IDE
  2. Ask the assistant to help set up the project locally
  3. The assistant responds with a code block containing installation commands
  4. Click the "Run" button on the code block containing:
# From the root of the repository
npm run install-all-dependencies
  1. Observe that only the comment is executed, not the actual command

Log output


saimadib avatar May 19 '25 03:05 saimadib

I've created a PR (#5744 ) to improve the command extraction functionality. The changes focus on making the command parsing more robust by handling multi-line commands, filtering comments, and preserving command operators.

Looking ahead, we could further improve the user experience by:

  1. Adding validation at the LLM level to ensure generated commands are clean and don't include comments
  2. Implementing a pre-processing step in the LLM output to strip any comments or unnecessary content before the command reaches the RunInTerminalButton component

This would create a more consistent experience where users only see and execute the actual commands, without any additional content.

Would love to hear thoughts on these suggestions for future improvements.

saimadib avatar May 20 '25 03:05 saimadib

@saimadib thanks for this great PR. This was on my TODO list. Great work.

chezsmithy avatar May 20 '25 21:05 chezsmithy

Fixed by #5744

RomneyDa avatar May 24 '25 00:05 RomneyDa