opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Adding smart edit

Open SimplyYourAverageDev opened this issue 3 months ago • 6 comments

This PR adds "smart edit" which basically uses Morph V3 Large (an LLM specified for applying code edits) so that the main LLM can sometimes apply edits that are hard to describe.

SimplyYourAverageDev avatar Sep 27 '25 21:09 SimplyYourAverageDev

Does this supersede https://github.com/sst/opencode/pull/1916 ?

jenslys avatar Sep 28 '25 10:09 jenslys

Does this supersede #1916 ?

Well I'm not sure, their implementation only supports Morph API and also doesn't do diff at all so...

SimplyYourAverageDev avatar Sep 29 '25 12:09 SimplyYourAverageDev

@thdxr @adamdotdevin Any chance you would consier this merge?

SimplyYourAverageDev avatar Sep 30 '25 15:09 SimplyYourAverageDev

Thanks for implementing the smart_edit tool—it seems great for handling complex code edits! Just a concern: since it uses OpenRouter's morph/morph-v3-large model, users not set up with OpenRouter might run into failures if the main LLM picks this tool, which could disrupt their experience. Perhaps we could make the tool available only when OpenRouter is configured, or adjust the LLM's tool selection to avoid preferring it over the existing edit tool?

zenyr avatar Oct 07 '25 17:10 zenyr

https://github.com/sst/opencode/pull/1916 @adamdotdevin either of these implementations look good to you?

bhaktatejas922 avatar Oct 11 '25 11:10 bhaktatejas922

@thdxr ?

bhaktatejas922 avatar Oct 14 '25 22:10 bhaktatejas922