Skip to content

Commit 71bc964

Browse files
committed
chore(code): disable bash mode for cloud
1 parent 22ea7c3 commit 71bc964

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

apps/code/src/renderer/features/message-editor/components/MessageEditor.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { SessionConfigOption } from "@agentclientprotocol/sdk";
33
import { BranchSelector } from "@features/git-interaction/components/BranchSelector";
44
import { useGitQueries } from "@features/git-interaction/hooks/useGitQueries";
55
import { getUserPromptsForTask } from "@features/sessions/stores/sessionStore";
6+
import { useIsWorkspaceCloudRun } from "@features/workspace/hooks/useWorkspace";
67
import { useConnectivity } from "@hooks/useConnectivity";
78
import { ArrowUp, Circle, Stop } from "@phosphor-icons/react";
89
import { Flex, IconButton, Text, Tooltip } from "@radix-ui/themes";
@@ -169,6 +170,7 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
169170
const clearFocusRequest = useDraftStore((s) => s.actions.clearFocusRequest);
170171
const { isOnline } = useConnectivity();
171172
const taskId = context?.taskId;
173+
const isCloud = useIsWorkspaceCloudRun(taskId);
172174
const disabled = context?.disabled ?? false;
173175
const isLoading = context?.isLoading ?? false;
174176
const repoPath = context?.repoPath;
@@ -207,6 +209,7 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
207209
autoFocus,
208210
context: { taskId, repoPath },
209211
getPromptHistory,
212+
capabilities: { bashMode: !isCloud },
210213
onSubmit,
211214
onBashCommand,
212215
onBashModeChange,

apps/code/src/renderer/features/message-editor/tiptap/useTiptapEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
464464

465465
const text = editor.getText().trim();
466466

467-
if (text.startsWith("!")) {
467+
if (enableBashMode && text.startsWith("!")) {
468468
// Bash mode requires immediate execution, can't be queued
469469
if (isLoading) {
470470
toast.error("Cannot run shell commands while agent is generating");

apps/code/src/renderer/features/panels/components/LeafNodeRenderer.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Cloud as CloudIcon } from "@phosphor-icons/react";
22
import { Flex, Text } from "@radix-ui/themes";
3-
import { useWorkspace } from "@renderer/features/workspace/hooks/useWorkspace";
3+
import { useIsWorkspaceCloudRun } from "@renderer/features/workspace/hooks/useWorkspace";
44
import type { Task } from "@shared/types";
55
import type React from "react";
66
import { useMemo } from "react";
@@ -40,8 +40,7 @@ export const LeafNodeRenderer: React.FC<LeafNodeRendererProps> = ({
4040
onAddTerminal,
4141
onSplitPanel,
4242
}) => {
43-
const workspace = useWorkspace(taskId);
44-
const isCloud = workspace?.mode === "cloud";
43+
const isCloud = useIsWorkspaceCloudRun(taskId);
4544
const inputTabs = useMemo(
4645
() =>
4746
isCloud

apps/code/src/renderer/features/workspace/hooks/useWorkspace.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export function useWorkspace(taskId: string | undefined): Workspace | null {
5252
);
5353
}
5454

55+
export function useIsWorkspaceCloudRun(taskId: string | undefined): boolean {
56+
const workspace = useWorkspace(taskId);
57+
return workspace?.mode === "cloud";
58+
}
59+
5560
export function useWorkspaceLoaded(): boolean {
5661
const { isFetched } = useWorkspacesQuery();
5762
return isFetched;

0 commit comments

Comments
 (0)