Skip to content

[FEATURE]: Expose applyable patch in edit permission metadata #31625

Closed as not planned

Description

@zawedcvg

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

OpenCode currently sends permission.asked events for edit permissions with metadata.diff. This isnt applyable as a unified patch because it is run through trimDiff(), which removes common indentation from diff content lines.
This breaks clients/integrations that consume permission.asked over the server/SSE API and want to preview the proposed edit using standard patch tooling, as in the case in https://github.com/nickjvandyke/opencode.nvim.

Requested enhancement:

Expose an untrimmed, applyable patch separately from the display diff, for example:

metadata: {
  filepath,
  diff,  // current trimmed display diff
  patch, // untrimmed createTwoFilesPatch(...) output
}                                

Activity

  1. zhibinF commented on Jun 18, 2026

    @zhibinF

    Hi, I'd like to try implementing this.

  2. github-actions commented on Aug 18, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions