{"record":{"id":"a6b596c43e4bc6a4","repo":"xai-org/grok-build","slug":"session-does-not-exist-locally-session-registry-i","errorCode":null,"errorMessage":"Session does not exist locally (session registry is disabled by {})","messagePattern":"Session does not exist locally \\(session registry is disabled by (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/app/session_startup.rs","lineNumber":1103,"sourceCode":"    RemoteMissPlan::RestoreConversation\n}\n/// Remote-restore tail of [`resolve_existing_session`], split out so non-id targets can wrap every failure with the title-miss hint.\n///\n/// Always restores session state and memory only.\n/// Codebase checkout is refused in-place ([`RemoteMissPlan::RejectInPlaceCodeRestore`]) or deferred to the worktree handler.\n///\n/// On timeout the future is cancelled; partial JSONL may already be on disk and is recovered via a local-child scan of the remote id.\nasync fn restore_session_from_remote(\n    session_id: &str,\n    cwd: &str,\n    progress_on_stdout: bool,\n) -> anyhow::Result<ResolvedExisting> {\n    let raw_config = xai_grok_shell::config::load_effective_config()\n        .map_err(|e| anyhow::anyhow!(\"Failed to load config: {}\", e))?;\n    if let Some((false, source)) =\n        xai_grok_shell::util::config::session_registry_local_override_sourced(Some(&raw_config))\n    {\n        anyhow::bail!(\n            \"Session does not exist locally (session registry is disabled by {})\",\n            source.label()\n        );\n    }\n    emit_pre_tui_restore_line(\n        progress_on_stdout,\n        &format!(\n            \"Session {:?} not found locally, restoring conversation from remote...\",\n            session_id\n        ),\n    );\n    let agent_config = xai_grok_shell::agent::config::Config::new_from_toml_cfg(&raw_config)\n        .map_err(|e| anyhow::anyhow!(\"Failed to create agent config: {}\", e))?;\n    use xai_grok_shell::agent::session_registry_client::SessionRegistryClient;\n    use xai_grok_shell::auth::{AuthManager, ensure_authenticated_or_noninteractive};\n    use xai_grok_shell::session::restore::{RestoreSessionOpts, restore_session_with_storage};\n    use xai_grok_shell::util::grok_home::grok_home;\n    let deployment_key = agent_config.endpoints.deployment_key.clone();","sourceCodeStart":1085,"sourceCodeEnd":1121,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/app/session_startup.rs#L1085-L1121","documentation":"Raised when resolving an existing session locally while the local session registry has been explicitly disabled by a configuration override. `session_registry_local_override_sourced` returns the (enabled=false, source) pair, and the error names the config source (e.g. env var or config file) that disabled the registry, so local session lookup can never succeed while it is off.","triggerScenarios":"Running any resume/continue flow that calls the local resolver when `session_registry_local_override_sourced(Some(&raw_config))` yields `Some((false, source))` — i.e. a config file key or environment variable explicitly set the local session registry to disabled.","commonSituations":"An environment variable like a `GROK_*` registry toggle exported in shell profile/CI disabling the registry; a config file edited to disable session history; inheriting a disabled-registry setting from an enterprise/shared config.","solutions":["Find and remove/flip the disabling override named in the error message (the `source.label()`).","Check environment variables for the registry disable flag (`env | grep -i grok`) and unset it.","Inspect config files (user/project) for the session-registry setting and set it to enabled.","If the registry should stay disabled, use remote resume by session id instead of local lookup."],"exampleFix":"// before (shell)\nexport GROK_SESSION_REGISTRY=off\ngrok --resume \"my session\"\n// after\nunset GROK_SESSION_REGISTRY\ngrok --resume \"my session\"","handlingStrategy":"validation","validationCode":"let cfg = xai_grok_shell::config::load_effective_config()?;\nif let Some((false, source)) =\n    xai_grok_shell::util::config::session_registry_local_override_sourced(Some(&cfg))\n{\n    eprintln!(\"Local session registry disabled by {} — enable it or use remote resume\", source.label());\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = resolve_local_session(id) {\n    if e.to_string().contains(\"session registry is disabled by\") {\n        eprintln!(\"Enable the local session registry (see the source named in the error) and retry.\");\n    } else { return Err(e); }\n}","preventionTips":["Audit env vars and config files for registry-disable flags before scripting resume flows","Keep the `source.label()` from the error as the pointer to which layer to change","Document shared/enterprise config overrides so inherited disables are visible"],"tags":["config","session-registry","cli"],"backgroundTag":"feature-disabled-by-config","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}