{"record":{"id":"1d9c2ef327fd9ad7","repo":"xai-org/grok-build","slug":"local-workspace-resolve-returned-no-config-after-o","errorCode":null,"errorMessage":"local-workspace resolve returned no config after own-mode request","messagePattern":"local-workspace resolve returned no config after own-mode request","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/views/welcome/workspace_mode.rs","lineNumber":419,"sourceCode":"            );\n            Ok(WelcomeWorkspacePrepare::Continue {\n                session_override: Some(None),\n                warning: None,\n            })\n        }\n        WelcomeWorkspaceMode::LocalWorkspace => {\n            if !local_workspace_ack_satisfied() {\n                tracing::info!(\n                    target: WORKSPACE_MODE_LOG,\n                    event = \"welcome_local_ack\",\n                    outcome = \"await\",\n                    \"welcome Local requires ACK confirm\"\n                );\n                return Ok(WelcomeWorkspacePrepare::AwaitAck);\n            }\n            let cfg = resolve_local_workspace_config(true, Some(None), None, Some(cwd))?\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"local-workspace resolve returned no config after own-mode request\"\n                    )\n                })?;\n            // Live sessions still read the process stamp, so with agents alive only the one-shot override applies\n            if !agents_alive {\n                set_active_local_workspace(Some(cfg.clone()))?;\n            }\n            log_welcome_intent_applied(\n                selection,\n                startup_locked,\n                \"own_oneshot\",\n                if agents_alive { \"kept\" } else { \"stamped_own\" },\n            );\n            Ok(WelcomeWorkspacePrepare::Continue {\n                session_override: Some(Some(cfg)),\n                warning: None,\n            })\n        }","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/views/welcome/workspace_mode.rs#L401-L437","documentation":"`prepare_welcome_workspace_for_new_session` requests a Local workspace in \"own\" mode by calling `resolve_local_workspace_config(true, Some(None), None, Some(cwd))`. The resolver is expected to return Some(config) for that forced request; if it returns None the invariant is broken and this error is raised, leaving the app unable to activate the Local workspace.","triggerScenarios":"Starting a new session from the welcome view with Local/own-mode selected, when `resolve_local_workspace_config` with force=true returns None — e.g. the cwd is invalid/unavailable or resolver internal state (stamp/env) prevents producing a config despite the forced request.","commonSituations":"Launching from a deleted or unreadable working directory; environment where the resolver's own-mode prerequisites fail silently; regression in session_startup after a refactor changing resolver semantics.","solutions":["Re-launch from a valid existing working directory","Clear any persisted local-workspace stamp/ack state for the grok home and retry","Check `resolve_local_workspace_config` conditions (valid cwd, own-mode path) if you maintain the code","Update grok if this is a known regression"],"exampleFix":"// before (invariant violation)\nresolve_local_workspace_config(true, Some(None), None, Some(cwd))?.ok_or_else(|| anyhow!(\"...no config...\"))\n// after (defensive: log and fall back instead of hard error)\nmatch resolve_local_workspace_config(true, Some(None), None, Some(cwd))? {\n    Some(cfg) => Ok(cfg),\n    None => anyhow::bail!(\"local-workspace resolve failed for cwd={}; is the directory valid?\", cwd.display()),\n}","handlingStrategy":"try-catch","validationCode":"// guard before starting the session\nif !std::path::Path::new(&cwd).is_dir() {\n    eprintln!(\"cwd {:?} is invalid; Local workspace activation will fail\", cwd);\n}","typeGuard":null,"tryCatchPattern":"match prepare_welcome_workspace_for_new_session(&ctx).await {\n    Err(e) if e.to_string().contains(\"local-workspace resolve\") => {\n        log::warn!(\"local workspace unavailable: {e}; continuing with default workspace\");\n    }\n    other => other?,\n}","preventionTips":["Launch grok from a valid, existing working directory","Keep session_startup resolver invariants covered by tests (force=true must yield Some)","Avoid deleting/unmounting the project directory while the welcome view is active"],"tags":["workspace","invariant","welcome-view"],"backgroundTag":"workspace-resolve-returned-none","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}