Skip to content

Conversation

@proggod
Copy link

@proggod proggod commented Apr 1, 2025

Context

This PR introduces three major improvements to Roo Code:

  1. A new unified diff viewer that provides more accurate and reliable code changes
  2. An API logger for better debugging and monitoring of model interactions
  3. Enhanced system prompt handling for improved model responses

Implementation

New Unified Diff Viewer

  • Implemented a new NewUnifiedDiffStrategy that provides more robust diff application
  • Added intelligent context matching with configurable confidence thresholds
  • Improved handling of indentation, line endings, and complex code changes
  • Added support for splitting large hunks into smaller, more manageable pieces
  • Implemented multiple search strategies (context matching, similarity matching) for better accuracy

API Logger

  • Added a new API logging system that captures system prompts and messages
  • Logs are stored in ~/.roo_logs/api_history.txt
  • Each log entry includes:
    • Timestamp
    • System prompt
    • Message history
    • Request details
  • Logging can be enabled/disabled via configuration

System Prompt Enhancements

  • Added support for dynamic system prompt appending
  • Improved handling of system prompts across different model providers
  • Added better formatting and cleaning of system prompts
  • Enhanced support for model-specific prompt requirements

Screenshots

before after
[Previous diff viewer showing basic changes] [New unified diff viewer showing improved context and accuracy]
[No API logging] [API logging showing detailed request information]

How to Test

  1. Testing the Diff Viewer:

    • Make complex code changes with indentation modifications
    • Verify that the changes are applied correctly with proper context
    • Test with various file types and change patterns
  2. Testing the API Logger:

    • Enable API logging in settings
    • Make a few requests to different models
    • Check ~/.roo_logs/api_history.txt for detailed logs
    • Verify that system prompts and messages are captured correctly
  3. Testing System Prompt Changes:

    • Try different system prompt configurations
    • Verify that prompts are properly formatted for each model
    • Check that dynamic prompt appending works as expected

Get in Touch

I'm available in the Roo Code Discord as [your handle] for any questions or feedback about these changes.


Important

Enhances Roo Code with a new diff viewer, API logging, and improved system prompt handling, integrating these features into the existing codebase with modular updates.

  • Diff Viewer:
    • Introduces DiffApproveProvider in src/integrations/diff-approve/DiffApproveProvider.ts for enhanced diff viewing.
    • Adds checkpointDiffWeb message handling in webviewMessageHandler.ts.
    • Updates ChatTextArea.tsx and CheckpointMenu.tsx to support new diff viewer actions.
  • API Logging:
    • Implements API logging in api-logger.ts with logApiRequest() and setApiLoggingEnabled().
    • Adds API_LOGGING experiment in experiments.ts and updates related tests.
    • Logs API requests in multiple provider files like anthropic.ts, gemini.ts, etc.
  • System Prompt Enhancements:
    • Adds SystemPromptTextArea component in SystemPromptTextArea.tsx for dynamic prompt appending.
    • Updates ChatView.tsx to include system prompt handling.
    • Modifies generatePrompt() in system.ts to append system prompt text.
  • Miscellaneous:
    • Updates package.json to include new dependencies and scripts.
    • Adds new i18n strings in chat.json and settings.json for UI elements.
    • Refactors Cline.ts to integrate new functionalities and improve modularity.

This description was created by Ellipsis for e61123c50823097b303bf5d59139cdbbb8577d30. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Apr 1, 2025

⚠️ No Changeset found

Latest commit: 0c136ff

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:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Apr 1, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 1, 2025

This pull request is quite large, with 53 changed files and over 4000 lines added. It includes a variety of changes such as documentation updates, new features, and refactoring across different components and services. To make the review process more manageable, it would be beneficial to split this pull request into smaller, more focused ones.

Here are some suggestions on how to split the changes:

  1. Documentation Updates: Separate all documentation-related changes into their own pull request. This includes files like DiffViewerButtonImplementation.md, ShadowCheckpoint.md, add_config_option.md, etc.

  2. New Features: Group new feature implementations, such as the diff viewer and API logging, into their own pull request. This includes changes in files like media/diffApprove.css, media/diffApprove.js, src/api/providers/*, etc.

  3. Refactoring and Enhancements: Any refactoring or enhancements, such as those in src/core/Cline.ts and src/core/tools/attemptCompletionTool.ts, can be grouped into another pull request.

By splitting the changes, it will be easier to review and test each part independently, ensuring a smoother integration process. Thank you for your understanding and cooperation!

@proggod proggod closed this Apr 1, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 1, 2025
@proggod proggod reopened this Apr 1, 2025
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap Apr 1, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 2, 2025
Comment on lines +18 to +23
.diff-header h2 {
margin: 0 0 16px 0;
font-size: 14px;
font-weight: normal;
color: var(--vscode-foreground);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use tailwind style ?

Comment on lines +23 to +26
logApiRequest({
systemPrompt,
messages,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Can logging be in another pr ?

@proggod proggod closed this Apr 2, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Apr 2, 2025
@proggod proggod deleted the roo_modular_integration branch April 13, 2025 17:44
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:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants