Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented May 2, 2025

Context

It's very expensive to trigger postStateToWebView calls due to the serialization involved. Noisy terminal will trigger this due to the cline.say("command_output", ...) calls.

It's much faster to just send an event containing only the new output rather than full state updates.

In testing this was a huge performance win.


Important

Optimize terminal performance by sending incremental command outputs and updating related schemas and UI components.

  • Behavior:
    • Optimize terminal performance by sending only new output events instead of full state updates in executeCommandTool.ts.
    • Update ExecaTerminalProcess.ts to handle command abortion and output streaming more efficiently.
  • Schemas:
    • Update commandExecutionStatusSchema in schemas/index.ts to include started, output, exited, and fallback statuses.
  • UI Components:
    • Modify CommandExecution in CommandExecution.tsx to handle new command execution statuses and display outputs incrementally.
    • Update ChatRow.tsx to integrate with the new command execution flow and display.

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

@changeset-bot
Copy link

changeset-bot bot commented May 2, 2025

⚠️ No Changeset found

Latest commit: 062c89c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 2, 2025
this.startHotTimer(line)
}

if (this.aborted) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We now stop processing the terminal output when an abort signal is received. If the abort signal can't kill the process then we manually kill it.

})
}

export const splitCommandOutput = (text: string) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was expensive to run when there's lot of terminal output. I don't think it provided enough value to justify the performance hit.

@cte cte merged commit 2e66081 into main May 2, 2025
19 checks passed
@cte cte deleted the cte/terminal-performance branch May 2, 2025 09:38
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap May 2, 2025
mehmetsunkur pushed a commit to mehmetsunkur/Roo-Code that referenced this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants