{"record":{"id":"55c57c45af276531","repo":"zeroclaw-labs/zeroclaw","slug":"auth-login-import-currently-supports-only-mo","errorCode":null,"errorMessage":"`auth login --import` currently supports only --model-provider openai-codex and xai.","messagePattern":"`auth login --import` currently supports only --model-provider openai-codex and xai\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-providers/src/auth/mod.rs","lineNumber":1368,"sourceCode":"                anyhow::Error::msg(format!(\n                    \"Gemini OAuth requires `oauth_client_secret` on `[providers.models.gemini.{profile}]`.\",\n                ))\n            })?;\n        Ok((client_id, client_secret))\n    }\n}\n\n#[async_trait::async_trait]\nimpl AuthProviderFlow for GeminiFlow {\n    async fn login(\n        &self,\n        ctx: &AuthFlowContext<'_>,\n        profile: &str,\n        device_code: bool,\n        import: Option<&std::path::Path>,\n    ) -> Result<()> {\n        if import.is_some() {\n            anyhow::bail!(\n                \"`auth login --import` currently supports only --model-provider openai-codex and xai.\",\n            );\n        }\n        let (client_id, client_secret) = Self::alias_creds(ctx.config, profile)?;\n\n        if device_code {\n            match crate::auth::gemini_oauth::start_device_code_flow(ctx.client, client_id).await {\n                Ok(device) => {\n                    println!(\"Google/Gemini device-code login started.\");\n                    println!(\"Visit: {}\", device.verification_uri);\n                    println!(\"Code:  {}\", device.user_code);\n                    if let Some(uri_complete) = &device.verification_uri_complete {\n                        println!(\"Fast link: {uri_complete}\");\n                    }\n                    let token_set = crate::auth::gemini_oauth::poll_device_code_tokens(\n                        ctx.client,\n                        client_id,\n                        client_secret,","sourceCodeStart":1350,"sourceCodeEnd":1386,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/auth/mod.rs#L1350-L1386","documentation":"The Gemini login implementation rejects any call with an import path: `auth login --import` is only implemented for openai-codex and xai (importing existing OAuth tokens from those vendors' CLI config files). Gemini's flow has no import path, so the guard at the top of login bails before doing anything else.","triggerScenarios":"Running `zeroclaw auth login --model-provider gemini --import ~/.gemini/oauth_creds.json` (or any --import value) — the import argument alone triggers it, regardless of file contents.","commonSituations":"Copy-pasting the Codex import command and only changing --model-provider, or scripts that always pass --import when a source file exists.","solutions":["For Gemini, run the normal browser flow: `zeroclaw auth login --model-provider gemini` (optionally --device-code)","If you meant to import, use a supported provider: `--model-provider openai-codex` or `--model-provider xai` with --import","Drop the --import flag from scripts when the target is gemini"],"exampleFix":"# before\nzeroclaw auth login --model-provider gemini --import ~/creds.json\n\n# after\nzeroclaw auth login --model-provider gemini","handlingStrategy":"validation","validationCode":"const IMPORT_CAPABLE: &[&str] = &[\"openai-codex\", \"xai\"];\nif import.is_some() {\n    anyhow::ensure!(\n        IMPORT_CAPABLE.contains(&model_provider),\n        \"--import is only supported for openai-codex and xai; got {model_provider}\"\n    );\n}","typeGuard":"fn supports_import(model_provider: &str) -> bool {\n    matches!(model_provider, \"openai-codex\" | \"xai\")\n}","tryCatchPattern":"match provider.login(ctx, profile, false, import_path).await {\n    Err(e) if e.to_string().contains(\"--import` currently supports only\") => {\n        // retry without import: normal browser flow\n        provider.login(ctx, profile, false, None).await\n    }\n    other => other,\n}","preventionTips":["Gate --import flags on provider capability before invoking login","Keep per-provider auth recipes in scripts instead of one generic command"],"tags":["auth","gemini","cli","unsupported-operation","import"],"backgroundTag":"unsupported-auth-method","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}