Skip to content

Add a way to delete custom providers from configuration #136

@MuoDoo

Description

@MuoDoo

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 config supports provider, model, and set.
  • ocr config set custom_providers.<name>.<field> <value> creates or updates custom provider fields.
  • The Custom tab in ocr config provider supports 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 pressing d on a selected custom provider and confirming deletion.
  • Optionally also add a non-interactive command, for example:
    ocr config delete custom_providers.<name>
    or:
    ocr config unset custom_providers.<name>

When deleting the currently active provider, the command should either:

  • clear the active provider and related fallback model, 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.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions