From 08a0c897efc23122e08ccf82f13cebbe4b321443 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 7 Jul 2025 23:55:29 -0400 Subject: [PATCH] Remove warning about writing not being allowed (#5461) --- .../__tests__/getEnvironmentDetails.spec.ts | 19 ------------------- src/core/environment/getEnvironmentDetails.ts | 10 ---------- 2 files changed, 29 deletions(-) diff --git a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts index 57e7fe0f27..a1b8691e70 100644 --- a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts +++ b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts @@ -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) diff --git a/src/core/environment/getEnvironmentDetails.ts b/src/core/environment/getEnvironmentDetails.ts index 7a3847334d..8d4f157f4d 100644 --- a/src/core/environment/getEnvironmentDetails.ts +++ b/src/core/environment/getEnvironmentDetails.ts @@ -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"))