Skip to content

feat(tui): add permission prompt behavior config#29104

Open
tkemperman wants to merge 1 commit into
anomalyco:devfrom
tkemperman:permission-prompt-confirmation-config
Open

feat(tui): add permission prompt behavior config#29104
tkemperman wants to merge 1 commit into
anomalyco:devfrom
tkemperman:permission-prompt-confirmation-config

Conversation

@tkemperman
Copy link
Copy Markdown

@tkemperman tkemperman commented May 24, 2026

Issue for this PR

Closes #29105
Addresses #19528

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Adds permission_prompt.default_response to tui.json so users can choose which permission response is selected by default (once, always, or reject).
  • Adds permission_prompt.confirmation to control whether selecting a permission response opens a second confirmation dialog.
  • Supports global confirmation defaults, per-response overrides, and per-permission/per-pattern overrides for cases like requiring confirmation for bash commands matching rm *.
  • Preserves current behavior when permission_prompt.confirmation is omitted: Allow always still requires a second confirmation.
  • Documents the new TUI configuration and adds unit coverage for confirmation defaults and overrides.

How did you verify your code works?

  • Ran PATH="$HOME/.bun/bin:$PATH" bun test test/cli/tui/permission-prompt.test.ts in packages/opencode.
  • Ran PATH="$HOME/.bun/bin:$PATH" bun typecheck in packages/opencode.
  • Pre-push hook ran bun turbo typecheck successfully across the workspace.
  • Manually tested in a local sandbox with default_response: "always", confirmation.default: "never", and confirmation.permission.bash["rm *"]: "always".

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes

- Add tui.json permission_prompt.default_response so users can choose the default permission response.

- Add tui.json permission_prompt.confirmation so second confirmations can be disabled by default or required for specific responses, permissions, and patterns.

- Preserve existing behavior when permission_prompt.confirmation is omitted by continuing to confirm Allow always.

- Update the TUI permission prompt to apply the configured default response and confirmation rules.

- Document the new TUI settings and add unit coverage for default, response-level, and pattern-level confirmation behavior.
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.

[FEATURE]: Configure permission prompt default response and confirmations

1 participant