Skip to content

Conversation

@robertheadley
Copy link
Contributor

@robertheadley robertheadley commented May 13, 2025

  1. Renamed "Errors" Tab to "Console"
    Changed tab ID from 'errors' to 'console' in McpView.tsx
    Updated view ID from 'errors-view' to 'console-view'
    Changed empty state message to use 'noLogs' translation key
  2. Fixed Console Message Coloring
    Modified how messages are displayed to ensure proper coloring
    STDOUT messages now display in white (using var(--vscode-foreground))
    Error messages continue to display in red for visual distinction
  3. Added MCP Logs to AI Context
    Enhanced McpHub.ts to refresh the system prompt when MCP logs are updated
    This ensures the AI is aware of MCP logs and can respond to them
  4. Fixed Code Escaping for MCP Tools
    Updated useMcpToolTool.ts to properly handle code snippets with special characters
    Ensured consistent escaping behavior between approval and execution phases
    Created and ran a test script confirming our fix works with:
    LaTeX code containing multiple backslashes and special characters
    Python code with quotes, indentation, and backslashes
    Valid JSON data (passed through unchanged)
    Invalid JSON data (properly detected and reported)

Related GitHub Issue

Closes: #2549

Description

Test Procedure

Created and ran a test script confirming our fix works with:
LaTeX code containing multiple backslashes and special characters
Python code with quotes, indentation, and backslashes
Valid JSON data (passed through unchanged)
Invalid JSON data (properly detected and reported)

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

Before
before
After
after


Important

Enhances MCP console display, fixes tool arguments, and improves logging and code handling.

  • UI Enhancements:
    • Renamed "Errors" tab to "Console" in McpView.tsx.
    • Updated empty state message to "No logs".
  • Console Message Coloring:
    • Modified McpErrorRow.tsx to display STDOUT messages in white and error messages in red.
  • AI Context:
    • Enhanced McpHub.ts to refresh system prompt when MCP logs update.
  • Code Escaping:
    • Updated useMcpToolTool.ts to handle code snippets with special characters.
    • Ensured consistent escaping between approval and execution phases.

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

- Rename MCP 'Errors' tab to 'Console' for better semantic meaning
- Update tab ID from 'errors' to 'console' in McpView.tsx
- Change view ID from 'errors-view' to 'console-view'
- Use 'noLogs' translation key for empty state message
- Add MCP logs to AI's context awareness through system prompt
- Fix MCP tool arguments handling to properly escape code snippets
- Ensure consistent handling of arguments for approval and execution
- White text for standard output (stdout), red for errors
@changeset-bot
Copy link

changeset-bot bot commented May 13, 2025

🦋 Changeset detected

Latest commit: 5ec3d82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
roo-cline Minor

Not sure what this means? Click here to learn what changesets are.

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

- Fixed TypeScript error in McpHub.ts by adding return type to appendErrorMessage
- Added changesets documenting the improvements to MCP console functionality
- Fixed type definition consistency for console logging levels
@robertheadley robertheadley force-pushed the enhancement/mcp-console-logs branch from 7fc5c31 to 4ec16e6 Compare May 13, 2025 02:18
@robertheadley robertheadley marked this pull request as ready for review May 13, 2025 18:14
@robertheadley robertheadley requested review from cte and mrubens as code owners May 13, 2025 18:14
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working enhancement New feature or request labels May 13, 2025
…sion

- Modified getMcpServersSection to return an empty string when enableMcpServerCreation is false
- Added unit tests to verify the behavior
- This change ensures that when 'Create MCP servers' is toggled off, MCP logs will not be included in the system prompt/context
@hannesrudolph
Copy link
Collaborator

@robertheadley can you please include images?

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 14, 2025
@robertheadley
Copy link
Contributor Author

robertheadley commented May 14, 2025

Before
before
After
after

@robertheadley
Copy link
Contributor Author

@robertheadley can you please include images?

I had, but they stopped displaying in the original. I tried to edit it, but they wouldn't display.

@hannesrudolph
Copy link
Collaborator

@robertheadley can you please include images?

I had, but they stopped displaying in the original. I tried to edit it, but they wouldn't display.

got the images working in the main info.

@hannesrudolph
Copy link
Collaborator

@robertheadley what if there is an error?

@robertheadley
Copy link
Contributor Author

@robertheadley what if there is an error?

Errors are displayed in red.

@hannesrudolph
Copy link
Collaborator

@robertheadley please split this PR up into 3 separate PRs?

PR A

  1. Renamed "Errors" Tab to "Console"
    Changed tab ID from 'errors' to 'console' in McpView.tsx
    Updated view ID from 'errors-view' to 'console-view'
    Changed empty state message to use 'noLogs' translation key
  2. Fixed Console Message Coloring
    Modified how messages are displayed to ensure proper coloring
    STDOUT messages now display in white (using var(--vscode-foreground))
    Error messages continue to display in red for visual distinction

PR B
3. Added MCP Logs to AI Context
Enhanced McpHub.ts to refresh the system prompt when MCP logs are updated
This ensures the AI is aware of MCP logs and can respond to them

PR C
4. Fixed Code Escaping for MCP Tools
Updated useMcpToolTool.ts to properly handle code snippets with special characters
Ensured consistent escaping behavior between approval and execution phases
Created and ran a test script confirming our fix works with:
LaTeX code containing multiple backslashes and special characters
Python code with quotes, indentation, and backslashes
Valid JSON data (passed through unchanged)
Invalid JSON data (properly detected and reported)

@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 20, 2025
@robertheadley
Copy link
Contributor Author

Fair. OK.

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

Labels

bug Something isn't working enhancement New feature or request 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.

MCP: LLMs unable to properly escape JSON passed to MCP

2 participants