Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jun 11, 2025

Closes: #4200
Closes: #4384

This PR implements a marker to track when a command finished executing as a workaround for this VSCode issue: microsoft/vscode#250764.

The inspiration comes from @sstublic's comment: #4200 (comment)

Basically commands executed by Roo Code will look like this on the terminal:

git commit -m "this is a commit" ; echo -n "ROO_CMD_1749668438357_9frv9vg"

Then we check if the marker is present in the output, this is completely hidden from the model to avoid confusion.

I tested against the integrations tests that were failing due to the bug and it solved the issues.
Also tested on Windows.


Important

Adds execution marker in TerminalProcess to track command completion by appending and detecting a unique marker in command output.

  • Behavior:
    • Adds executionMarker to TerminalProcess to track command completion.
    • Appends unique marker to commands in run() to detect completion in output stream.
    • Handles both PowerShell and other shells by appending marker differently.
  • Execution:
    • Detects marker in output stream to determine command completion.
    • Removes marker from fullOutput once detected.
    • Emits shell_execution_complete event with success exit code if marker is detected.
  • Misc:
    • Updates run() to handle marker logic and stream processing.
    • Adds comments explaining marker usage and stream handling.

This description was created by Ellipsis for 7b8dde8. You can customize this summary. It will automatically update as commits are pushed.

@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners June 11, 2025 19:19
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 11, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Jun 11, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 12, 2025
@daniel-lxs
Copy link
Member Author

Closing this for now.

@daniel-lxs daniel-lxs closed this Jun 20, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 20, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 20, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of a version of this where we do it for Powershell only if that’s the most acute issue and then roll it out to other shells as a follow-up once it’s live for a bit? cc: @sstublic

@sstublic
Copy link

What do you think of a version of this where we do it for Powershell only if that’s the most acute issue and then roll it out to other shells as a follow-up once it’s live for a bit? cc: @sstublic

Since there are no other takes on this and @daniel-lxs seems to have done a really good job with this, I'd be really happy and grateful with any progress on the issue.

From my end, if you do this for Powershell, I'll use it for sure and leave a feedback if it's working correctly/bug is fixed. Maybe you can use that to decide if you want to move on to other shells.

@daniel-lxs
Copy link
Member Author

We can probably make it so that this is enabled with a setting in the Terminal section, that way users that are affected can be instructed to enable this.

If we hear reports that this implementation is affecting them in any other way we can either remove it or polish it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

When Roo runs command in the terminal gets stuck even if the command is finished Roo Code loses the ability to parse PowerShell command outputs

5 participants