Skip to content

Commit 08a0c89

Browse files
authored
Remove warning about writing not being allowed (RooCodeInc#5461)
1 parent d4abe73 commit 08a0c89

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/core/environment/__tests__/getEnvironmentDetails.spec.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -313,25 +313,6 @@ describe("getEnvironmentDetails", () => {
313313
expect(mockInactiveTerminal.getCurrentWorkingDirectory).toHaveBeenCalled()
314314
})
315315

316-
it("should include warning when file writing is not allowed", async () => {
317-
;(isToolAllowedForMode as Mock).mockReturnValue(false)
318-
;(getModeBySlug as Mock).mockImplementation((slug: string) => {
319-
if (slug === "code") {
320-
return { name: "💻 Code" }
321-
}
322-
323-
if (slug === defaultModeSlug) {
324-
return { name: "Default Mode" }
325-
}
326-
327-
return null
328-
})
329-
330-
const result = await getEnvironmentDetails(mockCline as Task)
331-
332-
expect(result).toContain("NOTE: You are currently in '💻 Code' mode, which does not allow write operations")
333-
})
334-
335316
it("should include experiment-specific details when Power Steering is enabled", async () => {
336317
mockState.experiments = { [EXPERIMENT_IDS.POWER_STEERING]: true }
337318
;(experiments.isEnabled as Mock).mockReturnValue(true)

src/core/environment/getEnvironmentDetails.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,6 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo
233233
}
234234
}
235235

236-
// Add warning if not in code mode.
237-
if (
238-
!isToolAllowedForMode("write_to_file", currentMode, customModes ?? [], { apply_diff: cline.diffEnabled }) &&
239-
!isToolAllowedForMode("apply_diff", currentMode, customModes ?? [], { apply_diff: cline.diffEnabled })
240-
) {
241-
const currentModeName = getModeBySlug(currentMode, customModes)?.name ?? currentMode
242-
const defaultModeName = getModeBySlug(defaultModeSlug, customModes)?.name ?? defaultModeSlug
243-
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.`
244-
}
245-
246236
if (includeFileDetails) {
247237
details += `\n\n# Current Workspace Directory (${cline.cwd.toPosix()}) Files\n`
248238
const isDesktop = arePathsEqual(cline.cwd, path.join(os.homedir(), "Desktop"))

0 commit comments

Comments
 (0)