mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-11 22:51:26 +00:00
Remove warning about writing not being allowed (#5461)
This commit is contained in:
parent
d4abe73875
commit
08a0c897ef
2 changed files with 0 additions and 29 deletions
|
|
@ -313,25 +313,6 @@ describe("getEnvironmentDetails", () => {
|
|||
expect(mockInactiveTerminal.getCurrentWorkingDirectory).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it("should include warning when file writing is not allowed", async () => {
|
||||
;(isToolAllowedForMode as Mock).mockReturnValue(false)
|
||||
;(getModeBySlug as Mock).mockImplementation((slug: string) => {
|
||||
if (slug === "code") {
|
||||
return { name: "💻 Code" }
|
||||
}
|
||||
|
||||
if (slug === defaultModeSlug) {
|
||||
return { name: "Default Mode" }
|
||||
}
|
||||
|
||||
return null
|
||||
})
|
||||
|
||||
const result = await getEnvironmentDetails(mockCline as Task)
|
||||
|
||||
expect(result).toContain("NOTE: You are currently in '💻 Code' mode, which does not allow write operations")
|
||||
})
|
||||
|
||||
it("should include experiment-specific details when Power Steering is enabled", async () => {
|
||||
mockState.experiments = { [EXPERIMENT_IDS.POWER_STEERING]: true }
|
||||
;(experiments.isEnabled as Mock).mockReturnValue(true)
|
||||
|
|
|
|||
|
|
@ -233,16 +233,6 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo
|
|||
}
|
||||
}
|
||||
|
||||
// Add warning if not in code mode.
|
||||
if (
|
||||
!isToolAllowedForMode("write_to_file", currentMode, customModes ?? [], { apply_diff: cline.diffEnabled }) &&
|
||||
!isToolAllowedForMode("apply_diff", currentMode, customModes ?? [], { apply_diff: cline.diffEnabled })
|
||||
) {
|
||||
const currentModeName = getModeBySlug(currentMode, customModes)?.name ?? currentMode
|
||||
const defaultModeName = getModeBySlug(defaultModeSlug, customModes)?.name ?? defaultModeSlug
|
||||
details += `\n\nNOTE: You are currently in '${currentModeName}' mode, which does not allow write operations. To write files, the user will need to switch to a mode that supports file writing, such as '${defaultModeName}' mode.`
|
||||
}
|
||||
|
||||
if (includeFileDetails) {
|
||||
details += `\n\n# Current Workspace Directory (${cline.cwd.toPosix()}) Files\n`
|
||||
const isDesktop = arePathsEqual(cline.cwd, path.join(os.homedir(), "Desktop"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue