Skip to content

Conversation

@daniel-lxs
Copy link
Member

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

This PR makes some improvements to the McpExecution.tsx component to increase performance and reduce lag.

  • Not rendering the response if the block is not expanded.
  • The input arguments are parsed only after the model has completely written it.

Important

Optimize McpExecution.tsx by deferring JSON parsing and rendering only when necessary to improve performance.

  • Behavior:
    • McpExecution.tsx now only renders responses when the block is expanded, preventing unnecessary rendering.
    • JSON parsing for responseText and argumentsText is deferred until data is complete, avoiding partial JSON parsing.
  • Functions:
    • tryParseJson is now a useCallback to memoize the function and prevent unnecessary re-creations.
    • responseData and argumentsData use useMemo to optimize parsing logic based on component state.
  • Components:
    • ResponseContainerInternal checks isExpanded before rendering content to avoid performance issues with large responses.

This description was created by Ellipsis for 996a7cd. 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 13, 2025 00:49
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jun 13, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Jun 13, 2025
@mrubens mrubens merged commit 5f29348 into main Jun 13, 2025
22 checks passed
@mrubens mrubens deleted the fix/mcp_block_performance branch June 13, 2025 01:17
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 13, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 13, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 13, 2025
cte pushed a commit that referenced this pull request Jun 24, 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 lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants