warpdotdev/warp · error
No patterns provided to file_glob
Error message
No patterns provided to file_glob
What it means
run_file_glob rejects an empty patterns vector up front: file_glob (v1 or v2) with zero patterns is treated as a malformed invocation rather than matching everything.
Source
Thrown at app/src/ai/blocklist/action_model/execute/file_glob.rs:206
self.active_session
.as_ref(ctx)
.session(ctx)
.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(),View on GitHub (pinned to e72fd7aacb)
Solutions
- Validate patterns non-empty before dispatching the action and reject with a descriptive tool error
- If the model intended 'everything', translate empty patterns into an explicit '**/*' at the tool boundary
- Log the raw action payload when this fires to catch schema/deserialization bugs
Example fix
// before
ActionExecution::new_async(async move {
run_file_glob(patterns_clone, absolute_path, session, shell_launch_data).await
});
// after
if patterns.is_empty() {
return Err(anyhow!("file_glob requires at least one pattern"));
}
ActionExecution::new_async(async move {
run_file_glob(patterns_clone, absolute_path, session, shell_launch_data).await
}); Defensive patterns
Strategy: validation
Validate before calling
if patterns.is_empty() {
return Err(anyhow!("file_glob requires at least one pattern"));
} Type guard
fn valid_glob_request(patterns: &[String]) -> bool {
!patterns.is_empty()
} Try / catch
match run_file_glob(patterns, path, session, shell).await {
Err(e) if e.to_string() == "No patterns provided to file_glob" => {
Err(anyhow!("model emitted an empty pattern list; re-prompt"))
}
r => r,
} Prevention
- Validate the action payload schema (minItems on patterns) at deserialization
- Return a descriptive tool error to the model so it re-issues the call with patterns
- Decide explicitly whether empty patterns mean 'reject' or '**/*' and enforce it at one boundary
When it happens
Trigger: The agent model emits a FileGlob action whose patterns list is empty, or a caller filters/validates patterns into nothing before invoking run_file_glob (file_glob.rs:212-214).
Common situations: Model outputs an empty array for patterns; upstream validation strips invalid entries leaving none; deserialization of the action payload defaults to an empty vec.
Related errors
- No session provided to file_glob
- Expected {} field values, got {}
- Field '{}' is required
- Failed to materialize conversation: {e}
- File glob operation timed out
AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16).
Data as JSON: /api/errors/0a504c4673ead6a1.
Report an issue: GitHub.