Skip to content

feat: editable allow all#25088

Open
al-prk wants to merge 2 commits intoanomalyco:devfrom
al-prk:feature/editable-always-patterns
Open

feat: editable allow all#25088
al-prk wants to merge 2 commits intoanomalyco:devfrom
al-prk:feature/editable-always-patterns

Conversation

@al-prk
Copy link
Copy Markdown

@al-prk al-prk commented Apr 30, 2026

Issue for this PR

Closes #25089

Type of change

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

What does this PR do?

When a permission request is approved with Allow always, the TUI currently only lets you confirm the server-suggested patterns. That makes cases like devcontainer exec ls awkward, because the suggested rule is often much broader than what you actually want to allow.

This change makes the Allow always step editable. The prompt now opens a textarea pre-filled with the suggested patterns, and the user can replace them with narrower rules before confirming.

On the backend, the permission reply payload now accepts optional patterns. If custom patterns are provided, those are stored for the session. If the textarea is left empty, the existing behavior is preserved and OpenCode falls back to the server-suggested patterns.

How did you verify your code works?

  • Ran bun typecheck in packages/opencode
  • Ran bun test test/permission/next.test.ts in packages/opencode
  • Added coverage for:
    • custom patterns overriding the suggested always patterns
    • empty custom patterns falling back to the existing behavior
  • Manually checked the TUI flow:
    • Allow always opens an editable textarea
    • Enter confirms
    • Esc cancels
    • Alt+Enter inserts a newline

Screenshots / recordings

изображение

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title Editable allow all doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added needs:title needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@al-prk al-prk changed the title Editable allow all feat: editable allow all Apr 30, 2026
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]: Editable allow all

1 participant