Adding smart edit
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.
Does this supersede https://github.com/sst/opencode/pull/1916 ?
Does this supersede #1916 ?
Well I'm not sure, their implementation only supports Morph API and also doesn't do diff at all so...
@thdxr @adamdotdevin Any chance you would consier this merge?
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?
https://github.com/sst/opencode/pull/1916 @adamdotdevin either of these implementations look good to you?
@thdxr ?