Skip to content

Commit 2aabbbe

Browse files
authored
Merge pull request #491 from Mng-dev-ai/fix/default-permission-defaults
Set default permission modes per agent
2 parents 961457d + c9d62fe commit 2aabbbe

9 files changed

Lines changed: 18 additions & 14 deletions

File tree

backend/app/api/endpoints/chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def send_message(
110110
prompt: str = Form(...),
111111
chat_id: str = Form(...),
112112
model_id: str = Form(...),
113-
permission_mode: PermissionMode = Form("acceptEdits"),
113+
permission_mode: PermissionMode = Form("bypassPermissions"),
114114
thinking_mode: str | None = Form(None),
115115
worktree: bool = Form(False),
116116
plan_mode: bool = Form(False),
@@ -430,7 +430,7 @@ async def queue_message(
430430
chat_id: UUID,
431431
content: str = Form(...),
432432
model_id: str = Form(...),
433-
permission_mode: PermissionMode = Form("acceptEdits"),
433+
permission_mode: PermissionMode = Form("bypassPermissions"),
434434
thinking_mode: str | None = Form(None),
435435
worktree: bool = Form(False),
436436
plan_mode: bool = Form(False),

backend/app/models/schemas/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ChatRequest(BaseModel):
3131
chat_id: UUID
3232
model_id: str = Field(..., min_length=1, max_length=255)
3333
attached_files: list[UploadFile] | None = None
34-
permission_mode: PermissionMode = "acceptEdits"
34+
permission_mode: PermissionMode = "bypassPermissions"
3535
thinking_mode: str | None = Field(None, max_length=50)
3636
worktree: bool = False
3737
plan_mode: bool = False

backend/app/models/schemas/queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class QueuedMessageBase(BaseModel):
1212
content: str = Field(..., min_length=1, max_length=100000)
1313
model_id: str = Field(..., min_length=1, max_length=255)
14-
permission_mode: PermissionMode = "acceptEdits"
14+
permission_mode: PermissionMode = "bypassPermissions"
1515
thinking_mode: str | None = None
1616
worktree: bool = False
1717
plan_mode: bool = False

backend/app/services/queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def add_message(
3838
chat_id: str,
3939
content: str,
4040
model_id: str,
41-
permission_mode: str = "acceptEdits",
41+
permission_mode: str = "bypassPermissions",
4242
thinking_mode: str | None = None,
4343
worktree: bool = False,
4444
plan_mode: bool = False,

frontend/src/components/chat/permission-mode-selector/PermissionModeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export const MODES_BY_AGENT: Record<AgentKind, PermissionModeOption[]> = {
4949
};
5050

5151
const DEFAULT_BY_AGENT: Record<AgentKind, PermissionMode> = {
52-
claude: 'acceptEdits',
53-
codex: 'auto',
52+
claude: 'bypassPermissions',
53+
codex: 'full-access',
5454
};
5555

5656
export function coercePermissionModeForAgent(

frontend/src/components/chat/sub-threads/CreateSubThreadDialog.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ import { useCreateSubThreadMutation } from '@/hooks/queries/useChatQueries';
2626
import { useSlashCommandSuggestions } from '@/hooks/useSlashCommandSuggestions';
2727
import { useChatContext } from '@/hooks/useChatContext';
2828
import { useModelStore } from '@/store/modelStore';
29-
import { useChatSettingsStore, DEFAULT_PERSONA } from '@/store/chatSettingsStore';
29+
import {
30+
useChatSettingsStore,
31+
DEFAULT_PERSONA,
32+
DEFAULT_PERMISSION_MODE,
33+
} from '@/store/chatSettingsStore';
3034
import { useAuthStore } from '@/store/authStore';
3135
import type { Chat } from '@/types/chat.types';
3236
import type { SlashCommand } from '@/types/ui.types';
@@ -47,7 +51,7 @@ export function CreateSubThreadDialog({ parentChat, onClose }: CreateSubThreadDi
4751
const [personaName, setPersonaName] = useState(DEFAULT_PERSONA);
4852
const [message, setMessage] = useState('');
4953
const [thinkingMode, setThinkingMode] = useState<ThinkingModeOption>(CLAUDE_THINKING_MODES[1]);
50-
const [permissionMode, setPermissionMode] = useState<PermissionMode>('acceptEdits');
54+
const [permissionMode, setPermissionMode] = useState<PermissionMode>(DEFAULT_PERMISSION_MODE);
5155

5256
const { customSkills, builtinSlashCommands } = useChatContext();
5357

frontend/src/services/queueService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { apiClient } from '@/lib/api';
22
import { ensureResponse, serviceCall } from '@/services/base/BaseService';
3-
import { DEFAULT_PERSONA } from '@/store/chatSettingsStore';
3+
import { DEFAULT_PERSONA, DEFAULT_PERMISSION_MODE } from '@/store/chatSettingsStore';
44
import type { PermissionMode } from '@/store/chatSettingsStore';
55
import { validateId, validateRequired } from '@/utils/validation';
66
import type { QueuedMessage, QueueAddResponse } from '@/types/queue.types';
@@ -9,7 +9,7 @@ async function queueMessage(
99
chatId: string,
1010
content: string,
1111
modelId: string,
12-
permissionMode: PermissionMode = 'acceptEdits',
12+
permissionMode: PermissionMode = DEFAULT_PERMISSION_MODE,
1313
thinkingMode: string | null = null,
1414
worktree: boolean = false,
1515
planMode: boolean = false,

frontend/src/store/chatSettingsStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type PermissionMode =
1111
| 'full-access';
1212

1313
const DEFAULT_KEY = '__default__';
14-
export const DEFAULT_PERMISSION_MODE: PermissionMode = 'acceptEdits';
14+
export const DEFAULT_PERMISSION_MODE: PermissionMode = 'bypassPermissions';
1515
export const DEFAULT_THINKING_MODE: string = 'medium';
1616
export const DEFAULT_WORKTREE = false;
1717
export const DEFAULT_PLAN_MODE = false;

frontend/src/store/messageQueueStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { create } from 'zustand';
22
import type { LocalQueuedMessage } from '@/types/queue.types';
33
import { queueService } from '@/services/queueService';
4-
import { DEFAULT_PERSONA } from '@/store/chatSettingsStore';
4+
import { DEFAULT_PERSONA, DEFAULT_PERMISSION_MODE } from '@/store/chatSettingsStore';
55
import type { PermissionMode } from '@/store/chatSettingsStore';
66

77
export const EMPTY_QUEUE: LocalQueuedMessage[] = [];
@@ -40,7 +40,7 @@ export const useMessageQueueStore = create<MessageQueueState>((set, get) => ({
4040
chatId: string,
4141
content: string,
4242
modelId: string,
43-
permissionMode: PermissionMode = 'acceptEdits',
43+
permissionMode: PermissionMode = DEFAULT_PERMISSION_MODE,
4444
thinkingMode: string | null = null,
4545
worktree: boolean = false,
4646
planMode: boolean = false,

0 commit comments

Comments
 (0)