Skip to content

Conversation

@tychenjiajun
Copy link

@tychenjiajun tychenjiajun commented Apr 20, 2025

  • Add enabledForSwitching config to control which modes can be switched to by LLMs
  • Update system prompts to exclude non-switchable modes from switch_mode tool
  • Update UI components in PromptsView to include enabledForSwitching checkbox
  • Update localization files for all supported languages
  • Update tests to verify behavior with non-switchable modes

Context

Fix #2668

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Add enabledForSwitching config to control AI mode switching, update UI, tests, and localization.

  • Behavior:
    • Add enabledForSwitching config to control mode switching by AI in modes.ts and switchModeTool.ts.
    • Update getModesSection() in modes.ts to filter out non-switchable modes.
    • Modify getToolDescriptionsForMode() in tools/index.ts to exclude switch_mode tool if no modes are switchable.
  • UI Components:
    • Add enabledForSwitching checkbox in PromptsView.tsx to toggle mode switching.
    • Update PromptsView.test.tsx to test enabledForSwitching behavior.
  • Localization:
    • Update localization files for all supported languages to include enabledForSwitching labels and descriptions.
  • Tests:
    • Add tests in CustomModesSettings.test.ts to verify enabledForSwitching behavior.
  • Schemas:
    • Update modeConfigSchema and promptComponentSchema in schemas/index.ts to include enabledForSwitching.

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

- Add enabledForSwitching config to control which modes can be switched to by LLMs
- Update system prompts to exclude non-switchable modes from switch_mode tool
- Update UI components in PromptsView to include enabledForSwitching checkbox
- Update localization files for all supported languages
- Update tests to verify behavior with non-switchable modes
@changeset-bot
Copy link

changeset-bot bot commented Apr 20, 2025

⚠️ No Changeset found

Latest commit: b13ed53

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 the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 20, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 20, 2025

The pull request introduces the 'enabledForSwitching' feature across multiple files, including tests, schemas, and localization files. While the changes are extensive, they appear to be related to a single cohesive feature. However, if there are any unrelated changes or if the changes can be logically grouped into smaller, more manageable pull requests, it might be beneficial to split them up. This can help with easier review and testing. Please consider if any parts of the changes can be separated into distinct pull requests.

@dosubot dosubot bot added the enhancement New feature or request label Apr 20, 2025
},
"enabledForSwitching": {
"label": "Habilitar aquest mode per a canvi per IA",
"description": "Quan està desactivat, aquest mode no s'inclourà al prompt del sistema de la IA i la IA no podrà canviar a aquest mode. Encara podeu seleccionar aquest mode manualment."
Copy link
Contributor

Choose a reason for hiding this comment

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

In the enabledForSwitching block, the description uses 'la IA' (e.g., 'al prompt del sistema de la IA' and 'la IA no podrà canviar a aquest mode'). In Catalan, it should ideally be written as 'l'IA' (e.g., 'al prompt del sistema de l'IA' and 'l'IA no podrà canviar a aquest mode'). This is a minor typographical error, but fixing it will improve clarity.

Suggested change
"description": "Quan està desactivat, aquest mode no s'inclourà al prompt del sistema de la IA i la IA no podrà canviar a aquest mode. Encara podeu seleccionar aquest mode manualment."
"description": "Quan està desactivat, aquest mode no s'inclourà al prompt del sistema de l'IA i l'IA no podrà canviar a aquest mode. Encara podeu seleccionar aquest mode manualment."

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 21, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 22, 2025
@sachasayan
Copy link
Contributor

Hey @tychenjiajun, thanks for this! Can you elaborate on what you're trying to achieve here, and how best to test? Are there any unresolved problems or assumptions that you know of? From the description it seems like you're aiming for more granular control over mode switching for each mode itself?

Screenshots and video would be appreciated!

SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
Co-authored-by: Dennis Bartlett <[email protected]>
@daniel-lxs
Copy link
Member

Hi @tychenjiajun,

I have a couple of questions regarding mode switching.

  1. Do you believe that Add a 'when to use' section to mode definitions #3571 offers adequate control over mode transitions?
  2. Are there any scenarios where it would be beneficial to prevent a mode from being switchable?

The proposed modification to getToolDescriptionsForMode() in tools/index.ts aims to exclude the switch_mode tool when no modes are switchable.

Also, does your current implementation support changing default modes? If not, is this adjustment required?

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Needs Review] in Roo Code Roadmap May 26, 2025
@hannesrudolph
Copy link
Collaborator

@tychenjiajun Thanks for submitting this PR, and apologies that it took us so long to review it.

We're closing this PR because the related issue wasn't fully scoped yet and is missing some critical aspects, such as completely removing the disabled mode from the system context. Before we can move forward, the issue needs proper scoping and approval.

If you'd like, feel free to open a new issue as a Detailed Feature Proposal clearly outlining what changes you propose. This will allow the dev team to properly review, scope, and approve the work. Otherwise, we'll handle the scoping directly within the dev team.

We appreciate your contribution and look forward to future input from you!

@github-project-automation github-project-automation bot moved this from Needs Preliminary Review to Done in Roo Code Roadmap May 27, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 27, 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 PR - Needs Preliminary Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Disable Default Modes

5 participants