Skip to content

Conversation

@dmmulroy
Copy link

@dmmulroy dmmulroy commented Dec 30, 2025

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

@allisoneer
Copy link

This is really really really good. I just want to +1 the directional intentions of these changes.

@dmmulroy dmmulroy marked this pull request as ready for review December 30, 2025 23:30
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.

2 participants