Browse Source

Remove warning about writing not being allowed (#5461)

Matt Rubens 7 months ago
parent
commit
08a0c897ef

+ 0 - 19
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)

+ 0 - 10
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"))