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
- Ensure file_glob is only dispatched from executors with a live active_session
- For headless flows, provide a detached Session or route globbing through a sessionless implementation
- 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
- Only dispatch file_glob from contexts that own a live terminal session
- Bind the session at action-creation time and fail fast if absent
- Give headless/ambient flows a sessionless glob implementation instead of relying on active_session
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
- No patterns provided to file_glob
- Expected {} field values, got {}
- Field '{}' is required
- File glob operation timed out
- MCP server '{name}' config must be a JSON object
AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16).
Data as JSON: /api/errors/5dc160233cf3ecca.
Report an issue: GitHub.