diff --git a/apps/desktop/src/shared/utils/agent-launch-request.test.ts b/apps/desktop/src/shared/utils/agent-launch-request.test.ts index de4bc0b4d63..9264b27fc46 100644 --- a/apps/desktop/src/shared/utils/agent-launch-request.test.ts +++ b/apps/desktop/src/shared/utils/agent-launch-request.test.ts @@ -46,7 +46,7 @@ describe("buildPromptAgentLaunchRequest", () => { agentType: "codex", terminal: { command: - 'codex -c model_reasoning_effort="high" --dangerously-bypass-approvals-and-sandbox -c model_reasoning_summary="detailed" -c model_supports_reasoning_summaries=true', + 'codex -c model_reasoning_effort="high" -c model_reasoning_summary="detailed" -c model_supports_reasoning_summaries=true --full-auto', }, }); }); diff --git a/apps/docs/content/docs/terminal-presets.mdx b/apps/docs/content/docs/terminal-presets.mdx index 5baecb51971..6078dbcac80 100644 --- a/apps/docs/content/docs/terminal-presets.mdx +++ b/apps/docs/content/docs/terminal-presets.mdx @@ -41,15 +41,17 @@ Presets are parallel by default. ## Quick-Add Templates -Pre-configured presets for popular AI agents: - -- **amp** - `amp` -- **claude** - `claude --dangerously-skip-permissions` -- **codex** - Full danger mode with high reasoning effort -- **gemini** - `gemini --yolo` -- **pi** - `pi` -- **cursor-agent** - Cursor AI agent -- **opencode** - Open-source AI coding agent +Pre-configured presets for popular AI agents. Defaults are safe-by-default — agents can read and edit files, but still prompt before running shell commands or touching files outside your workspace. Edit any preset to opt into a more permissive mode. + +- **amp** - `amp` (built-in permission rules auto-deny destructive ops) +- **claude** - `claude --permission-mode acceptEdits` +- **codex** - `codex ... --full-auto` (workspace-sandboxed) +- **gemini** - `gemini --approval-mode=auto_edit` +- **copilot** - `copilot --allow-tool=write` +- **cursor-agent** - `cursor-agent` (prompts for every action) +- **mastracode** - Mastra's coding agent (opt-in: auto-approves all actions by default at the CLI; no startup flag to restrict) +- **opencode** - Open-source AI coding agent (opt-in: full file and shell access by default at the CLI; no startup flag to restrict) +- **pi** - Minimal terminal coding harness (opt-in: auto-approves all actions by default at the CLI; no startup flag to restrict) ## Preset Bar diff --git a/bun.lock b/bun.lock index 406d5bd1793..f5134fae6b4 100644 --- a/bun.lock +++ b/bun.lock @@ -109,7 +109,7 @@ }, "apps/desktop": { "name": "@superset/desktop", - "version": "1.5.6", + "version": "1.5.5", "dependencies": { "@ai-sdk/anthropic": "^3.0.43", "@ai-sdk/openai": "3.0.36", @@ -7305,8 +7305,6 @@ "proxy-agent/lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="], - "proxy-agent/proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], - "radix-ui/@radix-ui/react-aspect-ratio": ["@radix-ui/react-aspect-ratio@1.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Yq6lvO9HQyPwev1onK1daHCHqXVLzPhSVjmsNjCa2Zcxy2f7uJD2itDtxknv6FzAKCwD1qQkeVDmX/cev13n/g=="], "radix-ui/@radix-ui/react-avatar": ["@radix-ui/react-avatar@1.1.10", "", { "dependencies": { "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-is-hydrated": "0.1.0", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-V8piFfWapM5OmNCXTzVQY+E1rDa53zY+MQ4Y7356v4fFz6vqCyUtIz2rUD44ZEdwg78/jKmMJHj07+C/Z/rcog=="], diff --git a/packages/host-service/src/terminal/env.test.ts b/packages/host-service/src/terminal/env.test.ts index 490eed59d7c..9a45c5e0388 100644 --- a/packages/host-service/src/terminal/env.test.ts +++ b/packages/host-service/src/terminal/env.test.ts @@ -393,7 +393,7 @@ describe("buildV2TerminalEnv", () => { const env = buildV2TerminalEnv(baseParams); expect(env).toMatchObject({ TERM: "xterm-256color", - TERM_PROGRAM: "Superset", + TERM_PROGRAM: "kitty", TERM_PROGRAM_VERSION: "2.0.0", COLORTERM: "truecolor", PWD: "/tmp/workspace", @@ -405,7 +405,7 @@ describe("buildV2TerminalEnv", () => { SUPERSET_AGENT_HOOK_PORT: "51741", SUPERSET_AGENT_HOOK_VERSION: "2", }); - expect(env.TERM_PROGRAM).toBe("Superset"); + expect(env.TERM_PROGRAM).toBe("kitty"); expect(env.LANG).toContain("UTF-8"); }); diff --git a/packages/host-service/src/terminal/env.ts b/packages/host-service/src/terminal/env.ts index 135594ba068..247a035f904 100644 --- a/packages/host-service/src/terminal/env.ts +++ b/packages/host-service/src/terminal/env.ts @@ -144,7 +144,11 @@ export function buildV2TerminalEnv( Object.assign(env, getShellBootstrapEnv({ shell, baseEnv, supersetHomeDir })); env.TERM = "xterm-256color"; - env.TERM_PROGRAM = "Superset"; + // claude-code and similar chat TUIs only parse kitty CSI-u (e.g. Shift+Enter + // → \x1b[13;2u) when TERM_PROGRAM ∈ {ghostty, kitty, iTerm.app, WezTerm, + // WarpTerminal}. xterm.js already emits the right bytes — claim kitty so + // they're parsed instead of submitted as plain Enter. + env.TERM_PROGRAM = "kitty"; env.TERM_PROGRAM_VERSION = hostServiceVersion; env.COLORTERM = "truecolor"; env.COLORFGBG = themeType === "light" ? "0;15" : "15;0"; diff --git a/packages/shared/src/agent-command.test.ts b/packages/shared/src/agent-command.test.ts index 6b1ecde6f0c..720af0c1cc5 100644 --- a/packages/shared/src/agent-command.test.ts +++ b/packages/shared/src/agent-command.test.ts @@ -13,7 +13,7 @@ describe("buildAgentPromptCommand", () => { }); expect(command).toContain( - "model_supports_reasoning_summaries=true -- \"$(cat <<'SUPERSET_PROMPT_12345678'", + "model_supports_reasoning_summaries=true --full-auto -- \"$(cat <<'SUPERSET_PROMPT_12345678'", ); expect(command).toContain("- Only modified file: runtime.ts"); }); @@ -26,7 +26,7 @@ describe("buildAgentPromptCommand", () => { }); expect(command).toStartWith( - "claude --dangerously-skip-permissions \"$(cat <<'SUPERSET_PROMPT_abcdefgh'", + "claude --permission-mode acceptEdits \"$(cat <<'SUPERSET_PROMPT_abcdefgh'", ); }); diff --git a/packages/shared/src/builtin-terminal-agents.ts b/packages/shared/src/builtin-terminal-agents.ts index 1d043e8a160..b634fe09179 100644 --- a/packages/shared/src/builtin-terminal-agents.ts +++ b/packages/shared/src/builtin-terminal-agents.ts @@ -62,7 +62,7 @@ export const BUILTIN_TERMINAL_AGENTS = [ label: "Claude", description: "Anthropic's coding agent for reading code, editing files, and running terminal workflows.", - command: "claude --dangerously-skip-permissions", + command: "claude --permission-mode acceptEdits", includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ @@ -80,9 +80,9 @@ export const BUILTIN_TERMINAL_AGENTS = [ description: "OpenAI's coding agent for reading, modifying, and running code across tasks.", command: - 'codex -c model_reasoning_effort="high" --dangerously-bypass-approvals-and-sandbox -c model_reasoning_summary="detailed" -c model_supports_reasoning_summaries=true', + 'codex -c model_reasoning_effort="high" -c model_reasoning_summary="detailed" -c model_supports_reasoning_summaries=true --full-auto', promptCommand: - 'codex -c model_reasoning_effort="high" --dangerously-bypass-approvals-and-sandbox -c model_reasoning_summary="detailed" -c model_supports_reasoning_summaries=true --', + 'codex -c model_reasoning_effort="high" -c model_reasoning_summary="detailed" -c model_supports_reasoning_summaries=true --full-auto --', includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ @@ -90,9 +90,8 @@ export const BUILTIN_TERMINAL_AGENTS = [ label: "Gemini", description: "Google's open-source terminal agent for coding, problem-solving, and task work.", - command: "gemini --yolo", - promptCommand: "gemini", - promptCommandSuffix: "--yolo", + command: "gemini --approval-mode=auto_edit", + promptCommand: "gemini --approval-mode=auto_edit", includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ @@ -101,7 +100,6 @@ export const BUILTIN_TERMINAL_AGENTS = [ description: "Mastra's coding agent for building, debugging, and shipping code from the terminal.", command: "mastracode", - includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ id: "opencode", @@ -109,7 +107,6 @@ export const BUILTIN_TERMINAL_AGENTS = [ description: "Open-source coding agent for the terminal, IDE, and desktop.", command: "opencode", promptCommand: "opencode --prompt", - includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ id: "pi", @@ -117,7 +114,6 @@ export const BUILTIN_TERMINAL_AGENTS = [ description: "Minimal terminal coding harness for flexible coding workflows.", command: "pi", - includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ id: "kimi", @@ -134,9 +130,8 @@ export const BUILTIN_TERMINAL_AGENTS = [ label: "Copilot", description: "GitHub's coding agent for planning, editing, and building in your repo.", - command: "copilot --allow-all", - promptCommand: "copilot -i --allow-all", - promptCommandSuffix: "--yolo", + command: "copilot --allow-tool=write", + promptCommand: "copilot -i --allow-tool=write", includeInDefaultTerminalPresets: true, }), createBuiltinTerminalAgent({ @@ -145,7 +140,6 @@ export const BUILTIN_TERMINAL_AGENTS = [ description: "Cursor's coding agent for editing, running, and debugging code in parallel.", command: "cursor-agent", - promptCommandSuffix: "--yolo", }), ] as const;