{"record":{"id":"f31e19b6607e1f1f","repo":"alibaba/open-code-review","slug":"unknown-provider-field-q-supported-fields-are-ap","errorCode":null,"errorMessage":"unknown provider field %q: supported fields are api_key, api_key_cmd, url, protocol, model, models, auth_header, extra_body, extra_headers, retry_codes, aws_region, aws_profile","messagePattern":"unknown provider field %q: supported fields are api_key, api_key_cmd, url, protocol, model, models, auth_header, extra_body, extra_headers, retry_codes, aws_region, aws_profile","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/config_cmd.go","lineNumber":688,"sourceCode":"\t\tfor _, w := range warnings {\n\t\t\tfmt.Fprintf(os.Stderr, \"[ocr] WARNING: %s\\n\", w)\n\t\t}\n\t\tentry.RetryCodes = codes\n\tcase \"aws_region\", \"aws_profile\":\n\t\tnormalized, err := normalizeAWSSetting(field, key, value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !providerAcceptsAWSSettings(providerName, entry) {\n\t\t\treturn fmt.Errorf(\"%s does not apply to provider %q: aws_region and aws_profile are only used by providers that authenticate from the AWS credential chain (protocol %s)\", field, providerName, llm.ProtocolAnthropicBedrock)\n\t\t}\n\t\tif field == \"aws_region\" {\n\t\t\tentry.AWSRegion = normalized\n\t\t} else {\n\t\t\tentry.AWSProfile = normalized\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown provider field %q: supported fields are api_key, api_key_cmd, url, protocol, model, models, auth_header, extra_body, extra_headers, retry_codes, aws_region, aws_profile\", field)\n\t}\n\treturn nil\n}\n\n// providerAcceptsAWSSettings reports whether aws_region / aws_profile mean\n// anything for this provider. Storing them anywhere else would be dead config\n// that reads as applied, so it is rejected instead.\n//\n// The entry's own protocol decides whenever it sets one: a preset's protocol can\n// be overridden per entry (see tryProviderConfig), so `protocol: openai` on the\n// bedrock preset would otherwise still accept AWS settings that nothing reads.\n// Only when the entry is silent does the preset's own AmbientAuth flag answer.\nfunc providerAcceptsAWSSettings(providerName string, entry *ProviderEntry) bool {\n\tif entry.Protocol != \"\" {\n\t\treturn llm.NormalizeProtocol(entry.Protocol) == llm.ProtocolAnthropicBedrock\n\t}\n\tpreset, isPreset := llm.LookupProvider(providerName)\n\treturn isPreset && preset.AmbientAuth","sourceCodeStart":670,"sourceCodeEnd":706,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/config_cmd.go#L670-L706","documentation":"The default branch of applyProviderField rejects any field name outside the supported list: api_key, api_key_cmd, url, protocol, model, models, auth_header, extra_body, extra_headers, retry_codes, aws_region, aws_profile. The error message includes the full supported list to guide correction.","triggerScenarios":"`ocr config set providers.<name>.<field> <value>` where <field> is misspelled (e.g. 'apikey', 'base_url', 'endpoint') or simply does not exist.","commonSituations":"Recalling field names from another tool's config (base_url vs url, apikey vs api_key); typos like extra-header; copying examples from outdated documentation.","solutions":["Check the spelling against the supported list in the error message","Run `ocr config --help` or consult docs for valid provider fields","Map the intended setting: e.g. base_url -> url, apikey -> api_key"],"exampleFix":"// before\nocr config set custom_providers.foo.base_url https://api.example.com\n// after\nocr config set custom_providers.foo.url https://api.example.com","handlingStrategy":"validation","validationCode":"valid=\"api_key api_key_cmd url protocol model models auth_header extra_body extra_headers retry_codes aws_region aws_profile\"\n[[ \" $valid \" == *\" $field \"* ]] && ocr config set providers.foo.\"$field\" \"$value\" || echo \"unknown field: $field\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the supported-field list handy; copy field names from docs","Common mappings: base_url -> url, apikey -> api_key, extra-header -> extra_headers","Use shell completion if available"],"tags":["cli","config","typo"],"backgroundTag":"unknown-config-field","analyzedSha":"5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f","analyzedAt":"2026-09-02T02:08:09.116Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}