Skip to content

UI Prefers global modes json over built-in modes but agents do not #2558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
strawgate opened this issue Apr 13, 2025 · 12 comments · Fixed by #3791
Closed

UI Prefers global modes json over built-in modes but agents do not #2558

strawgate opened this issue Apr 13, 2025 · 12 comments · Fixed by #3791
Assignees
Labels
bug Something isn't working Issue - In Progress Someone is actively working on this. Should link to a PR soon.

Comments

@strawgate
Copy link

When defining the global modes json with a slug that matches a built-in mode slug. The UI shows the prompt from the file but the agent is passed the prompt saved from before the global modes file was introduced with the slug.

Ex

    {
      "slug": "architect",
      "name": "Architect",
      "roleDefinition": "You are Roo, an experienced technical leader who is inquisitive and an excellent planner. Your goal is to gather information and get context to create a detailed plan for accomplishing the user's task, which the user will review and approve before you to implement the solution.",
      "customInstructions": "## **Architect Role: Adaptive Planning & Coordination**\n\n**Research & Planning (Adaptive)**\n- Gather context. Perform deeper research and evaluate approaches for complex tasks. Recommend a solution. You have access to product and dependency documentation with the External Documentation MCP server and you can fetch any documentation you might need for future usage. Search documentation often and don't hestiate to search multiple indices. Always search documentation for API calls.\n- Iterate with the user (Strawgate) on complex/ambiguous tasks.\n- **Lite-Touch:** For simple tasks, create a concise `/plans/<plan name>/plan.md`. Execute simple steps directly if appropriate.\n- **Heavy-Touch:** For complex tasks needing delegation, create a detailed `plan.md` and proceed to Implementation Planning.\n\n**Implementation Planning (Heavy-Touch Only)**\n- Define required worker resources (e.g., `Worker 1: Code Expert + Python`). Be practical.\n- Create worker plans (`plan-1.md`, `plan-2.md` etc.) and a verification plan (`plan-verify.md`).\n\n**Context Handoff (If Necessary)**\n- Monitor context size. If approaching limits (~100k tokens), propose handoff to the user.\n- If approved, create `/plans/<plan name>/handoff-<timestamp>.md` with standard fields (Plan Link, Status, Remaining, Context, Next Step) and notify the Project Manager to initiate the next task segment. Cease work on this segment.",
      "groups": [
        "read",
        "edit",
        "browser",
        "command",
        "mcp"
      ],
      "source": "global"
    }

Originally posted by @strawgate in #2542 (comment)

Copy link

dosubot bot commented Apr 13, 2025

Hello @strawgate! I'm Dosu, here to help you solve bugs, answer questions, and assist you in becoming a contributor. I'm available while you wait for a human maintainer. Let's tackle this together!

The issue you're encountering seems to be related to the precedence of global modes JSON files over built-in modes in the UI versus the agent behavior. According to the documentation, the configuration files and settings dictate the behavior of mode selection for agents. Specifically, project-level configurations from .roomodes, global configurations from custom_modes.json, and default configurations are applied in a specific order. The directory-based method (.roo/rules-{mode-slug}/) takes precedence over the single file method (.roorules-{mode-slug}), ensuring predictable behavior for projects using the new structure [1][2].

However, it appears that while the UI correctly prioritizes the global modes JSON, the agent does not update its prompt based on the new global modes file. This discrepancy might be due to how the agent loads and applies prompts, which may not be fully aligned with the UI's behavior. Unfortunately, I couldn't find specific details in the repository about the logic for handling conflicts between global and built-in mode slugs for agents. This might be an area that requires further investigation or a bug report to address the inconsistency.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the bug Something isn't working label Apr 13, 2025
@mrubens
Copy link
Collaborator

mrubens commented Apr 13, 2025

Thanks for flagging! We'll take a look.

@ChrisRoyse
Copy link

I can't get rid of the default modes, they are stuck and its messing up my entire roo set up since my orchestrator keeps changing to the default modes instead of the ones I set up. I ccan't figure out how to delete the default modes or overwrite them.!!!!

@iamhenry
Copy link

iamhenry commented Apr 14, 2025

Would love to be able to override them as well and delete them

@hannesrudolph hannesrudolph moved this from New to Issue [Unassigned] in Roo Code Roadmap Apr 15, 2025
@hannesrudolph hannesrudolph added the Issue - Unassigned / Actionable Clear and approved. Available for contributors to pick up. label Apr 17, 2025
@mrubens
Copy link
Collaborator

mrubens commented Apr 28, 2025

@strawgate I'm unable to repro this - when I override in the global modes the role definition and custom instructions seem to take effect in the prompt.

@strawgate
Copy link
Author

strawgate commented May 3, 2025

here's a screenshot of me overriding the code mode and then pressing copy system prompt and pasting it, the role def and custom instructions are not used

Image

@mrubens
Copy link
Collaborator

mrubens commented May 3, 2025

Thank you @strawgate, let me see if I can repro this.

@mrubens
Copy link
Collaborator

mrubens commented May 3, 2025

Strange, still not able to repro

@MuriloFP
Copy link

MuriloFP commented May 8, 2025

I'm also unable to reproduce it. Do you still have this issue @strawgate ?

Any particular flow to cause this? I tried changing it through the UI, through the custom_modes.json file (just like yours), and the System Message is always showing my custom role, not the default.

@strawgate
Copy link
Author

okay I see what the flow that causes the problem is

  1. First edit the built-in mode directly in the UI
  2. Then make a custom mode with the same slug
  3. Then check the system prompt

If you do not first edit the mode in the UI before reusing the slug then you have no problem

@mrubens
Copy link
Collaborator

mrubens commented May 8, 2025

Ahhh that helps, thank you

@ChuKhaLi
Copy link

I could fix this

@hannesrudolph hannesrudolph moved this from Issue [Unassigned] to Issue [In Progress] in Roo Code Roadmap May 21, 2025
@hannesrudolph hannesrudolph added Issue - In Progress Someone is actively working on this. Should link to a PR soon. and removed Issue - Unassigned / Actionable Clear and approved. Available for contributors to pick up. labels May 21, 2025
@github-project-automation github-project-automation bot moved this from Issue [Unassigned] to Done in Roo Code Roadmap May 28, 2025
@github-project-automation github-project-automation bot moved this from Issue [In Progress] to Done in Roo Code Roadmap May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue - In Progress Someone is actively working on this. Should link to a PR soon.
Projects
Status: Done
7 participants