{"record":{"id":"388d6668eb9947f1","repo":"xai-org/grok-build","slug":"devbox-login-is-not-available-in-this-build-compi","errorCode":null,"errorMessage":"devbox login is not available in this build (compiled without the `devbox-login` feature)","messagePattern":"devbox login is not available in this build \\(compiled without the `devbox-login` feature\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-shell/src/auth/devbox_login_stub.rs","lineNumber":25,"sourceCode":"//! points that can still be reached directly (`grok login --devbox`) return a\n//! descriptive error.\n\nuse super::manager::AuthManager;\nuse super::model::GrokAuth;\n\nconst UNAVAILABLE: &str =\n    \"devbox login is not available in this build (compiled without the `devbox-login` feature)\";\n\n/// Always `false` without the devbox auth feature; callers treat the\n/// process as running outside a devbox environment.\npub(crate) fn is_devbox_environment() -> bool {\n    false\n}\n\n/// Unreachable in practice (guarded by [`is_devbox_environment`]); errors\n/// defensively if called.\npub(crate) async fn mint_devbox_auth(_auth_manager: &AuthManager) -> anyhow::Result<GrokAuth> {\n    anyhow::bail!(UNAVAILABLE)\n}\n\n/// Unreachable in practice (guarded by [`is_devbox_environment`]); errors\n/// defensively if called.\npub(super) async fn mint_devbox_auth_raw() -> anyhow::Result<GrokAuth> {\n    anyhow::bail!(UNAVAILABLE)\n}\n\n/// `grok login --devbox` entry point: always errors in this build.\npub(crate) async fn run_devbox_login(\n    _config: &crate::agent::config::Config,\n) -> anyhow::Result<GrokAuth> {\n    anyhow::bail!(UNAVAILABLE)\n}\n","sourceCodeStart":7,"sourceCodeEnd":40,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-shell/src/auth/devbox_login_stub.rs#L7-L40","documentation":"In builds compiled without the `devbox-login` feature, devbox_login_stub provides mint_devbox_auth which unconditionally bails with the UNAVAILABLE message. It is a compile-time stub: real devbox auth code is feature-gated out, so this path always fails defensively even though is_devbox_environment would normally prevent reaching it.","triggerScenarios":"Calling mint_devbox_auth on a binary built without the `devbox-login` cargo feature, i.e. any code path that requests devbox authentication from AuthManager in a non-feature build.","commonSituations":"Running in a devbox environment with a production/release build that omitted the feature flag, or a misconfigured build pipeline that dropped `--features devbox-login`.","solutions":["Rebuild with the feature enabled: cargo build --features devbox-login","Use an alternative auth method: `grok login` or set XAI_API_KEY","Verify is_devbox_environment detection — if you're NOT in a devbox, don't request devbox auth","Check your install is the devbox variant of the binary, not the production one"],"exampleFix":"// before\ncargo build --release\n// after\ncargo build --release --features devbox-login","handlingStrategy":"fallback","validationCode":"// Detect stub build at runtime before attempting devbox auth\n// (message check) or prefer env-key auth when available\nif std::env::var(\"XAI_API_KEY\").is_ok() {\n    // use API-key auth path instead of devbox login\n}","typeGuard":null,"tryCatchPattern":"match mint_devbox_auth(&auth_manager).await {\n    Ok(auth) => auth,\n    Err(e) if e.to_string().contains(\"not available in this build\") => {\n        eprintln!(\"build lacks devbox-login; falling back to API key\");\n        auth_from_api_key().await?\n    },\n    Err(e) => return Err(e),\n}","preventionTips":["Build devbox images with --features devbox-login","Prefer XAI_API_KEY in environments where the feature is absent","Gate devbox auth calls on environment detection before invoking"],"tags":["auth","feature-flag","build","devbox"],"backgroundTag":"feature-not-compiled-in","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}