You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Apply Patch / Edit permission view only shows the first file #55337
Re-logging this issue for the OpenCode 2.x codebase as both legacy #17076 and #36119 were closed automatically by bots despite the bug remaining unresolved.
Current Behavior: When a model groups multiple file changes into a single apply_patch payload, the EditBody component in packages/tui/src/routes/session/permission.tsx only maps the first file's diff text. Granting permission silently applies all subsequent, hidden file modifications.
Expected Behavior: The permission TUI should utilize the request.metadata.files array to let users switch tabs or cycle through all files contained in the patch payload before approving.
Plugins
No response
OpenCode version
v2.0.28
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal
Reacted by Gregor Dieter, Pierce Fu, BulatVakhitov and Dmitry Demin
Thanks for re-filing this for v2. I reproduced it on v2.0.28, and it still happens on the latest dev (3a69bae).
How I reproduced it:
Set edit permission to ask.
Have the model send a single patch (apply_patch) call that updates src/alpha.ts and src/beta.ts and creates src/gamma.ts.
The permission prompt says Edit src/alpha.ts and shows only alpha's diff. Nothing in the prompt shows the other two files.
After Allow once, all three files are changed.
The recording and screenshots below show the prompt and the result after approving, and the script below reproduces it.
The cause is that the TUI's permission presentation (permissionPresentation in packages/tui/src/util/permission.ts) reads only metadata.files[0], even though the request includes every file and its diff.
Related earlier reports from v1, both closed: #17076 and #36119. #23262 was an earlier PR that added file cycling to this prompt.
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
Activity
opencode-agent commentedon Oct 14, 2026
Thanks for re-filing this for v2. I reproduced it on v2.0.28, and it still happens on the latest
dev(3a69bae).How I reproduced it:
editpermission to ask.patch(apply_patch) call that updatessrc/alpha.tsandsrc/beta.tsand createssrc/gamma.ts.The recording and screenshots below show the prompt and the result after approving, and the script below reproduces it.
The cause is that the TUI's permission presentation (
permissionPresentationinpackages/tui/src/util/permission.ts) reads onlymetadata.files[0], even though the request includes every file and its diff.Related earlier reports from v1, both closed: #17076 and #36119. #23262 was an earlier PR that added file cycling to this prompt.
recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.drakeo338 commentedon Oct 14, 2026
I'm looking at this and plan to open a fix shortly.
gysi commentedon Oct 17, 2026
@drakeo338 thanks for the PR! When will it be merged?
BulatVakhitov commentedon Nov 19, 2026
I'm looking forward to this feature being added. Really miss it in current version.
fix(tui): show every file in a multi-file edit permission