Remove warning about writing not being allowed (#5461)

This commit is contained in:
Matt Rubens 2025-07-07 23:55:29 -04:00 committed by GitHub
parent d4abe73875
commit 08a0c897ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 29 deletions

View file

@ -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)

View file

@ -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"))