{"record":{"id":"3c151ad952c4f891","repo":"alibaba/open-code-review","slug":"config-path-not-available","errorCode":null,"errorMessage":"config path not available","messagePattern":"config path not available","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/provider_tui.go","lineNumber":1344,"sourceCode":"\treturn out\n}\n\nfunc cloneCustomProviderList(src []customProviderListItem) []customProviderListItem {\n\tout := make([]customProviderListItem, len(src))\n\tfor i, cp := range src {\n\t\tout[i] = customProviderListItem{name: cp.name, entry: cloneProviderEntry(cp.entry)}\n\t}\n\treturn out\n}\n\nfunc (m *providerTUIModel) applyEditCustomProviderSave() error {\n\tif m.existingCfg == nil {\n\t\tm.formError = \"failed to save: config not loaded\"\n\t\treturn fmt.Errorf(\"config not loaded\")\n\t}\n\tif m.configPath == \"\" {\n\t\tm.formError = \"failed to save: config path not available\"\n\t\treturn fmt.Errorf(\"config path not available\")\n\t}\n\tr := m.result()\n\tbackupProviders := cloneCustomProvidersMap(m.existingCfg.CustomProviders)\n\tbackupActiveProvider := m.existingCfg.Provider\n\tbackupActiveModel := m.existingCfg.Model\n\tbackupCustomList := cloneCustomProviderList(m.customProviders)\n\n\tif m.existingCfg.CustomProviders == nil {\n\t\tm.existingCfg.CustomProviders = make(map[string]ProviderEntry)\n\t}\n\tentry := m.existingCfg.CustomProviders[r.editTargetName]\n\tif r.model != \"\" {\n\t\tentry.Model = r.model\n\t}\n\tif len(r.models) > 0 {\n\t\tentry.Models = append([]string(nil), r.models...)\n\t}\n\tentry.Models = ensureModelInList(entry.Models, r.model)","sourceCodeStart":1326,"sourceCodeEnd":1362,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/provider_tui.go#L1326-L1362","documentation":"Sentinel guard in applyEditCustomProviderSave: it fires when the TUI model was constructed without a config file path (e.g. running against defaults only), so persisting an edited custom provider has no destination. It is a precondition failure, not a save I/O error — the edit was never attempted on disk.","triggerScenarios":"Thrown at cmd/opencodereview/provider_tui.go:1344 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the provider TUI in a context where a config file path is known (config file present or creatable via --config)","If you intentionally run config-less, do not attempt to edit/save custom providers","Pass an explicit config path when launching ocr so edits have a target"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f","analyzedAt":"2026-09-02T02:08:09.116Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}