Run button only executes comments, ignores actual commands in code blocks
Before submitting your bug report
- [x] I believe this is a bug. I'll try to join the Continue Discord for questions
- [x] I'm not able to find an open issue that reports the same bug
- [x] I've seen the troubleshooting guide on the Continue Docs
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
- Open Continue in VS Code/JetBrains IDE
- Ask the assistant to help set up the project locally
- The assistant responds with a code block containing installation commands
- Click the "Run" button on the code block containing:
# From the root of the repository
npm run install-all-dependencies
- Observe that only the comment is executed, not the actual command
Log output
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:
- Adding validation at the LLM level to ensure generated commands are clean and don't include comments
- 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 thanks for this great PR. This was on my TODO list. Great work.
Fixed by #5744