Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#1728

Open
0daryo 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
Open

feat(agent-claude-code): add 'auto' permission mode for classifier-driven prompts#1728
0daryo 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

@0daryo
Copy link
Copy Markdown

@0daryo 0daryo commented May 8, 2026

Summary

Adds auto to AgentPermissionMode, mapping to Claude Code's --permission-mode auto so users can opt into the classifier-driven mode instead of --dangerously-skip-permissions. Existing permissionless / auto-edit behavior is unchanged. Other agent plugins fall through to their default for auto (documented in the AgentPermissionMode JSDoc).

Closes #1729.

Test plan

  • pnpm typecheck — all packages pass
  • pnpm --filter @aoagents/ao-plugin-agent-claude-code test — 160/160 pass (includes new auto tests for launch/restore)
  • Manual verification with permissions: auto in a live ao spawn

0daryo added 2 commits May 8, 2026 15:26
…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.
@0daryo 0daryo marked this pull request as ready for review May 8, 2026 07:18
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR adds "auto" as a new value in AgentPermissionMode, wiring it to Claude Code's --permission-mode auto CLI flag so users can opt into the classifier-driven permission model instead of --dangerously-skip-permissions. All four layers of the change — the canonical type, both Zod validation schemas, the plugin's launch and restore command builders, and the config-instruction comment — are updated consistently.

  • packages/core/src/types.ts / config.ts / global-config.ts: "auto" is added to AgentPermissionMode, normalizeAgentPermissionMode, AgentPermissionSchema, RoleAgentSpecificConfigSchema, and LocalProjectConfigSchema in lock-step, preserving existing default/transform behavior for all other values.
  • packages/plugins/agent-claude-code/src/index.ts: Both getLaunchCommand and getRestoreCommand gain an else if (permissionMode === "auto") branch emitting --permission-mode auto; new Vitest tests cover both paths.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "chore(agent-claude-code): trim verbose c..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(agent-claude-code): support Claude Code's auto permission mode

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.