[PR #6476] feat: allow users to edit suggested changes before applying #11920

Closed
opened 2026-02-16 18:16:51 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6476

State: closed
Merged: No


Adds ability for users to edit suggested file changes in their editor before applying them.

When the edit tool proposes changes, users can now press e to open the suggested content in their editor, make modifications, and have those modifications applied instead of the original suggestion.

Changes

  • packages/opencode/src/permission/editor.ts - new module for computing diffs between original and user-modified content
  • packages/opencode/src/util/text.ts - shared text utilities (normalizeLineEndings, getFirstDifferingLine, hasChanges)
  • packages/opencode/src/cli/cmd/tui/util/editor.ts - Editor.Result type for better error handling
  • packages/opencode/src/server/server.ts - typed modifyData validation
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx - UI integration for edit flow

Scope

  • Edit tool (single-file): supported
  • Patch tool (multi-file): unchanged, to be added separately in the future if desired

This PR was created with AI assistance

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6476 **State:** closed **Merged:** No --- Adds ability for users to edit suggested file changes in their editor before applying them. When the edit tool proposes changes, users can now press `e` to open the suggested content in their editor, make modifications, and have those modifications applied instead of the original suggestion. **Changes** - `packages/opencode/src/permission/editor.ts` - new module for computing diffs between original and user-modified content - `packages/opencode/src/util/text.ts` - shared text utilities (`normalizeLineEndings`, `getFirstDifferingLine`, `hasChanges`) - `packages/opencode/src/cli/cmd/tui/util/editor.ts` - `Editor.Result` type for better error handling - `packages/opencode/src/server/server.ts` - typed `modifyData` validation - `packages/opencode/src/cli/cmd/tui/routes/session/index.tsx` - UI integration for edit flow **Scope** - Edit tool (single-file): supported - Patch tool (multi-file): unchanged, to be added separately in the future if desired --- *This PR was created with AI assistance*
yindo added the pull-request label 2026-02-16 18:16:51 -05:00
yindo closed this issue 2026-02-16 18:16:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11920