xai-org/grok-build · error

Session does not exist locally (session registry is disabled

Error message

Session does not exist locally (session registry is disabled by {})

What it means

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.

Source

Thrown at crates/codegen/xai-grok-pager/src/app/session_startup.rs:1103

    RemoteMissPlan::RestoreConversation
}
/// Remote-restore tail of [`resolve_existing_session`], split out so non-id targets can wrap every failure with the title-miss hint.
///
/// Always restores session state and memory only.
/// Codebase checkout is refused in-place ([`RemoteMissPlan::RejectInPlaceCodeRestore`]) or deferred to the worktree handler.
///
/// 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.
async fn restore_session_from_remote(
    session_id: &str,
    cwd: &str,
    progress_on_stdout: bool,
) -> anyhow::Result<ResolvedExisting> {
    let raw_config = xai_grok_shell::config::load_effective_config()
        .map_err(|e| anyhow::anyhow!("Failed to load config: {}", e))?;
    if let Some((false, source)) =
        xai_grok_shell::util::config::session_registry_local_override_sourced(Some(&raw_config))
    {
        anyhow::bail!(
            "Session does not exist locally (session registry is disabled by {})",
            source.label()
        );
    }
    emit_pre_tui_restore_line(
        progress_on_stdout,
        &format!(
            "Session {:?} not found locally, restoring conversation from remote...",
            session_id
        ),
    );
    let agent_config = xai_grok_shell::agent::config::Config::new_from_toml_cfg(&raw_config)
        .map_err(|e| anyhow::anyhow!("Failed to create agent config: {}", e))?;
    use xai_grok_shell::agent::session_registry_client::SessionRegistryClient;
    use xai_grok_shell::auth::{AuthManager, ensure_authenticated_or_noninteractive};
    use xai_grok_shell::session::restore::{RestoreSessionOpts, restore_session_with_storage};
    use xai_grok_shell::util::grok_home::grok_home;
    let deployment_key = agent_config.endpoints.deployment_key.clone();

View on GitHub (pinned to bc7f02eddd)

Solutions

  1. Find and remove/flip the disabling override named in the error message (the `source.label()`).
  2. Check environment variables for the registry disable flag (`env | grep -i grok`) and unset it.
  3. Inspect config files (user/project) for the session-registry setting and set it to enabled.
  4. If the registry should stay disabled, use remote resume by session id instead of local lookup.

Example fix

// before (shell)
export GROK_SESSION_REGISTRY=off
grok --resume "my session"
// after
unset GROK_SESSION_REGISTRY
grok --resume "my session"
Defensive patterns

Strategy: validation

Validate before calling

let cfg = xai_grok_shell::config::load_effective_config()?;
if let Some((false, source)) =
    xai_grok_shell::util::config::session_registry_local_override_sourced(Some(&cfg))
{
    eprintln!("Local session registry disabled by {} — enable it or use remote resume", source.label());
}

Try / catch

if let Err(e) = resolve_local_session(id) {
    if e.to_string().contains("session registry is disabled by") {
        eprintln!("Enable the local session registry (see the source named in the error) and retry.");
    } else { return Err(e); }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of xai-org/grok-build@bc7f02eddd (2026-08-31). Data as JSON: /api/errors/a6b596c43e4bc6a4. Report an issue: GitHub.