Add a way to delete custom providers from configuration
Problem
Open Code Review currently supports adding and updating custom providers through ocr config provider and ocr config set custom_providers.<name>.<field> <value>, but there does not appear to be a supported way to delete a custom provider once it has been saved.
Users currently need to manually edit ~/.opencodereview/config.json and remove the corresponding custom_providers.<name> entry. If the deleted custom provider is also the active provider, they also need to manually clear or change provider to avoid configuration resolution errors.
Current Behavior
ocr configsupportsprovider,model, andset.ocr config set custom_providers.<name>.<field> <value>creates or updates custom provider fields.- The Custom tab in
ocr config providersupports selecting existing custom providers and adding new ones. - There is no documented
delete,remove,unset, or equivalent command for custom providers.
Expected Behavior
Provide a supported way to delete custom providers.
A TUI-based deletion flow may be preferable, since custom providers are primarily managed through ocr config provider. We should also investigate how OpenCode handles provider deletion/removal in its TUI before finalizing the interaction design.
Possible approaches:
- Add a delete action in the Custom tab of
ocr config provider, for example pressingdon a selected custom provider and confirming deletion. - Optionally also add a non-interactive command, for example:
or:ocr config delete custom_providers.<name>ocr config unset custom_providers.<name>
When deleting the currently active provider, the command should either:
- clear the active
providerand related fallbackmodel, or - require confirmation and guide the user to select another provider.
Acceptance Criteria
- Users can delete a saved custom provider without manually editing
~/.opencodereview/config.json. - Deleting the active provider leaves the config in a valid state or provides a clear error/confirmation flow.
- Tests cover deleting an inactive custom provider and deleting the currently active custom provider.
- README/docs mention the supported deletion workflow.
Hello @MuoDoo , I would like to take this issue!
Hi @Ackberry, thanks for picking this up! We've been realizing this is a real gap in the UX — users shouldn't have to hand-edit config files to remove a provider. Really looking forward to your PR!
Awesome. Thanks!
bro I was working on this :(. Took a while because I was doing this as an open-source capstone for my coursework project
Hi @Ackberry, really sorry about this — I totally understand the frustration, especially when this is part of your coursework project.
What likely happened is that between your claim on Jun 15 and now, there was no visible WIP pull request, so another contributor may not have realized someone was already working on it and submitted PR #189 independently.
A tip for next time: opening a draft/WIP PR early (even with just a skeleton or TODO outline) is a great way to signal "I'm on it" — it shows up in the issue timeline and prevents duplicate effort.
That said, your effort absolutely deserves recognition. I've suggested on #189 that the merge commit include you as a co-author:
Co-authored-by: Deep Akbari <[email protected]>
There are plenty of other open issues that could use a contributor — you're very welcome to pick up another one! And if you've built something interesting for your capstone along the way, feel free to share it too. 🙌
bro I was working on this :(. Took a while because I was doing this as an open-source capstone for my coursework project
Sorry about that! I saw the issue had been open for a while with no linked PR, so I assumed it was inactive and went ahead with my implementation. If you've already put significant work into yours, feel free to open a PR too. Again, apologies for the overlap. 🙏
Hey @lizhengfeng101 and @yingjiexu2002 , thank you for understanding guys! You've already been kind enough to reply back, and that's okay. I can talk to my advisor and find another issue, and this time, I will be faster. I completely understand @yingjiexu2002 's concern, as I had provided no updates since almost a week.
@yingjiexu2002 can go ahead and contribute themselves. I can find another issue and thank you for asking me. 😃