Skip to content

fix(cli): show multi-file apply_patch diffs#17080

Open
german-swan wants to merge 2 commits intoanomalyco:devfrom
german-swan:fix/multi-file-apply-patch-diffs
Open

fix(cli): show multi-file apply_patch diffs#17080
german-swan wants to merge 2 commits intoanomalyco:devfrom
german-swan:fix/multi-file-apply-patch-diffs

Conversation

@german-swan
Copy link

@german-swan german-swan commented Mar 11, 2026

Issue for this PR

Closes #17076

Type of change

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

What does this PR do?

apply_patch already returns per-file diff metadata, but the CLI permission view still treated patch approvals like a single-file edit and only showed one diff block. This updates the TUI approval renderer to use metadata.files when present, keep each file path as a header, and place the whole patch set inside one shared scroll area so multi-file reviews are easier to navigate.

It also adds explicit apply_patch rendering in run mode so non-interactive CLI output prints one diff block per changed file instead of falling back to generic tool output.

How did you verify your code works?

  • Ran bun run typecheck in packages/opencode
  • Reproduced a multi-file apply_patch locally in TUI and confirmed all file diffs render in one scrollable view with per-file headers

Screenshots / recordings

Screenshot 2026-03-11 at 21 05 33

Checklist

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

@github-actions github-actions bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Mar 11, 2026
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #15893: fix: re-read files after formatting in apply_patch
#15893

This PR is related to apply_patch functionality. While it focuses on re-reading files after formatting rather than rendering diffs, it addresses the same feature area and may have overlapping concerns with PR #17080's changes to apply_patch behavior.

All other search results returned PR #17080 itself or unrelated PRs.

@github-actions github-actions bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Mar 11, 2026
@github-actions
Copy link
Contributor

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

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.

CLI/TUI multi-file apply_patch approval only shows first file diff

1 participant