{"record":{"id":"89c39ca6422e164a","repo":"gitbutlerapp/gitbutler","slug":"could-not-determine-anthropic-credential-source","errorCode":null,"errorMessage":"Could not determine Anthropic credential source","messagePattern":"Could not determine Anthropic credential source","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/but/src/command/config.rs","lineNumber":1619,"sourceCode":"                        .prompt_secret(\"Enter OpenAI API key:\")?\n                        .context(\"No API key provided. Aborting configuration.\")?,\n                )\n            } else {\n                None\n            };\n\n            apply_openai_config(repo, scope, key_option, model, endpoint, secret)?;\n        }\n        LLMProviderKind::Anthropic => {\n            let key_options = nonempty::nonempty![\n                (\"Use GitButler API\", AiKeyOption::ButlerApi),\n                (\"Bring your own key\", AiKeyOption::BringYourOwn)\n            ];\n            let key_option = inout\n                .prompt_select(\"Select Anthropic credential source\", &key_options)?\n                .copied()\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\"Could not determine Anthropic credential source\")\n                })?;\n\n            let model = inout.prompt(\"Preferred Anthropic model (leave empty for default):\")?;\n            let secret = if matches!(key_option, AiKeyOption::BringYourOwn) {\n                Some(\n                    inout\n                        .prompt_secret(\"Enter Anthropic API key:\")?\n                        .context(\"No API key provided. Aborting configuration.\")?,\n                )\n            } else {\n                None\n            };\n\n            apply_anthropic_config(repo, scope, key_option, model, secret)?;\n        }\n        LLMProviderKind::Ollama => {\n            let endpoint = inout.prompt(\"Ollama endpoint host:port (optional):\")?;\n            let model = inout.prompt(\"Preferred Ollama model (optional):\")?;","sourceCodeStart":1601,"sourceCodeEnd":1637,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/config.rs#L1601-L1637","documentation":"Anthropic equivalent of the OpenAI credential-source prompt: after selecting Anthropic as provider, a picker offers 'Use GitButler API' vs 'Bring your own key', and cancelling it (None result) raises this error before the model/API-key prompts run.","triggerScenarios":"Selecting Anthropic in AI config, then aborting the 'Select Anthropic credential source' picker with Esc.","commonSituations":"User needs to create an Anthropic API key first; deciding between proxied and own key.","solutions":["Choose 'Use GitButler API' to skip key handling.","Or create an Anthropic key (console.anthropic.com), re-run, pick 'Bring your own key' and paste it.","Re-run `but config` AI setup to restart the flow."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match configure_ai(out).await {\n    Err(e) if e.to_string().contains(\"Anthropic credential source\") => { Ok(()) }\n    other => other,\n}","preventionTips":["Decide GitButler API vs own key before the prompt.","Create the Anthropic key first if bringing your own."],"tags":["interactive","picker","anthropic","credentials"],"backgroundTag":"prompt-cancelled","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}