feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#1728
feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#17280daryo wants to merge 2 commits intoComposioHQ:mainComposioHQ/agent-orchestrator:mainfrom 0daryo:fix/claude-code-permission-mode-acceptedits0daryo/agent-orchestrator:fix/claude-code-permission-mode-accepteditsCopy head branch name to clipboard
Conversation
…iven prompts Maps a new AgentPermissionMode value 'auto' to Claude Code's '--permission-mode auto', letting Claude's built-in classifier decide per-tool whether to prompt — a safer middle ground between 'default' (prompts on every tool) and 'permissionless' (full bypass via --dangerously-skip-permissions, which also surfaces a non-interactive confirmation prompt that blocks tmux workers). The new value flows through the canonical type, both Zod config schemas (project + global), and the YAML config-instruction comment. Existing 'permissionless' and 'auto-edit' mappings are unchanged. Other agent plugins fall through to their default for 'auto' (documented in the AgentPermissionMode JSDoc).
…anch The if/else-if branches are self-explanatory; the JSDoc on AgentPermissionMode now matches the one-line style of the other modes.
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to adding a new opt-in permission mode with no modifications to existing paths. All four layers of the abstraction (canonical type, both Zod schemas, the plugin command builders, and the config comment) are updated consistently and in lock-step. The new auto branch in getLaunchCommand and getRestoreCommand is strictly additive — existing permissionless, auto-edit, default, and suggest branches are untouched. Vitest tests assert the correct CLI flag is emitted and that --dangerously-skip-permissions is absent for the new mode, covering both the launch and restore code paths. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/plugins/agent-claude-code/src/index.ts | Adds --permission-mode auto emission in both getLaunchCommand and getRestoreCommand; logic is symmetric and consistent with existing permissionless/auto-edit handling. |
| packages/core/src/types.ts | AgentPermissionMode union and normalizeAgentPermissionMode guard both updated to include "auto"; change is complete and type-safe. |
| packages/core/src/config.ts | "auto" added to both AgentPermissionSchema and RoleAgentSpecificConfigSchema enums; no default or transform side-effects introduced. |
| packages/core/src/global-config.ts | LocalProjectConfigSchema.agentConfig.permissions enum updated to include "auto"; consistent with config.ts changes. |
| packages/plugins/agent-claude-code/src/index.test.ts | New tests cover launch (asserts --permission-mode auto present, --dangerously-skip-permissions absent) and restore (full command string assertion) for the "auto" mode. |
| packages/cli/src/lib/config-instruction.ts | Inline comment in the example YAML updated to list "auto" between "auto-edit" and "suggest", matching the canonical type order. |
| .changeset/claude-code-permission-mode-auto.md | Changeset marks all three affected packages (ao-plugin-agent-claude-code, ao-core, ao-cli) as minor bumps with a clear feature description. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[AgentPermissionMode input] --> B{normalizeAgentPermissionMode}
B -->|"skip"| C["permissionless"]
B -->|"permissionless"| C
B -->|"auto-edit"| D["auto-edit"]
B -->|"auto"| E["auto"]
B -->|"default"| F["default"]
B -->|"suggest"| G["suggest"]
B -->|unknown| H["undefined (no-op)"]
C --> I["--dangerously-skip-permissions"]
D --> I
E --> J["--permission-mode auto"]
F --> K["(no permission flag)"]
G --> K
I --> L[getLaunchCommand / getRestoreCommand]
J --> L
K --> L
Reviews (1): Last reviewed commit: "chore(agent-claude-code): trim verbose c..." | Re-trigger Greptile
Summary
Adds
autotoAgentPermissionMode, mapping to Claude Code's--permission-mode autoso users can opt into the classifier-driven mode instead of--dangerously-skip-permissions. Existingpermissionless/auto-editbehavior is unchanged. Other agent plugins fall through to their default forauto(documented in theAgentPermissionModeJSDoc).Closes #1729.
Test plan
pnpm typecheck— all packages passpnpm --filter @aoagents/ao-plugin-agent-claude-code test— 160/160 pass (includes newautotests for launch/restore)permissions: autoin a liveao spawn