From aa0aeec573870a4e86ff0c55caf8cd3e0d9c8965 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 9 May 2026 06:33:28 +0000 Subject: [PATCH] =?UTF-8?q?test:=20reproduce=20#4285=20=E2=80=94=20broken?= =?UTF-8?q?=20default=20agent=20commands=20for=20Claude=20and=20Codex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a co-located test file capturing the two misconfigured defaults reported in #4285: - Claude default `--permission-mode acceptEdits` does not enable auto mode (the user expects no per-action prompts on first run). - Codex default pairs `--sandbox workspace-write` with `--ask-for-approval never`, which produces "sandbox doesn't allow me to run terminal command" because codex cannot escalate when the sandbox blocks an operation. Both tests fail against current defaults, demonstrating the issue. Refs #4285 --- .../src/builtin-terminal-agents.test.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/shared/src/builtin-terminal-agents.test.ts diff --git a/packages/shared/src/builtin-terminal-agents.test.ts b/packages/shared/src/builtin-terminal-agents.test.ts new file mode 100644 index 00000000000..5e26b5033ce --- /dev/null +++ b/packages/shared/src/builtin-terminal-agents.test.ts @@ -0,0 +1,33 @@ +import { describe, expect, test } from "bun:test"; +import { BUILTIN_TERMINAL_AGENT_COMMANDS } from "./builtin-terminal-agents"; + +describe("issue #4285: out-of-the-box defaults must produce a working agent", () => { + test("claude default launches in auto mode", () => { + const [command] = BUILTIN_TERMINAL_AGENT_COMMANDS.claude; + // Per the issue: users expect Claude's default to be "auto mode" so + // the agent can run without per-action permission prompts. The two + // flags that disable prompting are `--dangerously-skip-permissions` + // and `--permission-mode bypassPermissions`. `acceptEdits` only + // auto-accepts file edits — it still prompts before shell commands, + // which the issue reports as broken-on-first-run behavior. + const enablesAutoMode = + command.includes("--dangerously-skip-permissions") || + command.includes("--permission-mode bypassPermissions"); + expect(enablesAutoMode).toBe(true); + }); + + test("codex default does not combine workspace-write sandbox with `--ask-for-approval never`", () => { + const [command] = BUILTIN_TERMINAL_AGENT_COMMANDS.codex; + // Per the issue: this exact pairing produces "sandbox doesn't allow + // me to run terminal command" errors. The workspace-write sandbox + // blocks shell operations needing network or out-of-workspace access, + // and `--ask-for-approval never` removes the agent's ability to + // escalate — so codex silently refuses instead of asking the user. + // Working alternatives: `--full-auto` (workspace-write + on-failure), + // or `--dangerously-bypass-approvals-and-sandbox` for full auto mode. + const isBrokenCombination = + command.includes("--sandbox workspace-write") && + command.includes("--ask-for-approval never"); + expect(isBrokenCombination).toBe(false); + }); +});