Skip to content

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

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
}                                

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions