warpdotdev/warp · error

No session provided to file_glob

Error message

No session provided to file_glob

What it means

run_file_glob requires an active terminal Session (used for shell type selection and git checks). When the executor's active_session resolves to None, the invocation fails immediately with this message.

Source

Thrown at app/src/ai/blocklist/action_model/execute/file_glob.rs:209

            .is_some_and(|session| session.supports_parallel_command_execution())
    }
}

fn is_file_glob_v2(input: &ExecuteActionInput) -> bool {
    matches!(input.action.action, AIAgentActionType::FileGlobV2 { .. })
}

async fn run_file_glob(
    patterns: Vec<String>,
    absolute_path: String,
    session: Option<Arc<Session>>,
    shell_launch_data: Option<ShellLaunchData>,
) -> anyhow::Result<FileGlobV2Result> {
    if patterns.is_empty() {
        return Err(anyhow::anyhow!("No patterns provided to file_glob"));
    }
    let Some(session) = session else {
        return Err(anyhow::anyhow!("No session provided to file_glob"));
    };
    let shell_type = session.shell().shell_type();

    let is_in_git_repo = is_git_repository(&absolute_path, session.as_ref())
        .await
        .unwrap_or_else(|e| {
            report_error!(e.context("Failed to run command to check if in git repository"));
            false
        });

    if is_in_git_repo {
        run_git_ls_files_command(
            &patterns,
            &absolute_path,
            session.as_ref(),
            shell_launch_data,
            shell_type,
        )

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Ensure file_glob is only dispatched from executors with a live active_session
  2. For headless flows, provide a detached Session or route globbing through a sessionless implementation
  3. Check whether the session was closed mid-run and re-dispatch after rebinding

Example fix

// before
let session = self.active_session.as_ref(ctx).session(ctx); // Option<Arc<Session>>

// after
let Some(session) = self.active_session.as_ref(ctx).session(ctx) else {
    return Err(anyhow!("file_glob requires an active session"));
};
Defensive patterns

Strategy: validation

Validate before calling

let Some(session) = self.active_session.as_ref(ctx).session(ctx) else {
    return Err(anyhow!("file_glob requires an active session"));
};

Type guard

fn has_session(executor: &FileGlobExecutor, ctx: &AppContext) -> bool {
    executor.active_session.as_ref(ctx).session(ctx).is_some()
}

Try / catch

match run_file_glob(patterns, path, session, shell).await {
    Err(e) if e.to_string() == "No session provided to file_glob" => {
        rebind_session_and_redispatch().await
    }
    r => r,
}

Prevention

When it happens

Trigger: Executing a file_glob action in a context where executor.active_session is absent - e.g. an ambient/headless run with no attached terminal session (file_glob.rs:215-218).

Common situations: Agent actions dispatched from background (cloud/ambient) execution where no local terminal exists; session torn down between action queueing and execution; wiring bug leaving active_session unset.

Related errors


AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16). Data as JSON: /api/errors/5dc160233cf3ecca. Report an issue: GitHub.