fix: read config from file for reload and improve provider validation

- Change reloadConfig to read from opencode.json file instead of HTTP API
- Add logging for OpenCode PATCH responses to aid debugging
- Make providerId optional in schema with custom validation when needed
- Update test to mock fs.readFile instead of fetch
This commit is contained in:
Chris Scott committed 2026-04-13 21:44:39 -04:00
1 parent 1f55bcdfc2
commit 8cfc6c0a17
5 files changed
+24 -35

No files matched your search

@@ -237,9 +237,9 @@ export function OpenCodeModelsEditor({ providers, onChange }: OpenCodeModelsEdit
<OpenCodeModelDialog
open={!!editingModel}
onOpenChange={() => setEditingModel(null)}
onSubmit={(providerId: string, modelId: string, model: ConfigModel) => {
onSubmit={(providerId: string, modelId: string, model: ConfigModel, newProvider?: NewProviderConfig) => {
if (editingModel) {
handleModelSubmit(providerId, modelId, model, undefined, editingModel.providerId, editingModel.modelId)
handleModelSubmit(providerId, modelId, model, newProvider, editingModel.providerId, editingModel.modelId)
}
}}
availableProviders={availableProviderIds}