{"record":{"id":"b6f6c509df400a53","repo":"zed-industries/zed","slug":"invalid-glob-err","errorCode":null,"errorMessage":"Invalid glob: {err}","messagePattern":"Invalid glob: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/tools/find_path_tool.rs","lineNumber":192,"sourceCode":"                offset: input.offset,\n                current_matches_page: paginated_matches.to_vec(),\n                all_matches_len: matches.len(),\n            })\n        })\n    }\n}\n\nfn search_paths(glob: &str, project: Entity<Project>, cx: &mut App) -> Task<Result<Vec<PathBuf>>> {\n    let path_style = project.read(cx).path_style(cx);\n    let path_matcher = match PathMatcher::new(\n        [\n            // Sometimes models try to search for \"\". In this case, return all paths in the project.\n            if glob.is_empty() { \"*\" } else { glob },\n        ],\n        path_style,\n    ) {\n        Ok(matcher) => matcher,\n        Err(err) => return Task::ready(Err(anyhow!(\"Invalid glob: {err}\"))),\n    };\n    let snapshots: Vec<_> = project\n        .read(cx)\n        .worktrees(cx)\n        .map(|worktree| worktree.read(cx).snapshot())\n        .collect();\n\n    cx.background_spawn(async move {\n        let mut results = Vec::new();\n        for snapshot in snapshots {\n            for entry in snapshot.entries(false, 0) {\n                if path_matcher.is_match(&snapshot.root_name().join(&entry.path)) {\n                    results.push(snapshot.absolutize(&entry.path));\n                }\n            }\n        }\n\n        Ok(results)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/agent/src/tools/find_path_tool.rs#L174-L210","documentation":"Raised in search_paths when PathMatcher::new rejects the model-supplied glob (with the empty glob substituted by `*`) as invalid syntax for the project's path style. The glob parsing error {err} names the fault; no paths can be searched until a valid glob is supplied.","triggerScenarios":"Thrown at crates/agent/src/tools/find_path_tool.rs:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the glob syntax (common issues: unbalanced brackets, invalid '**' placement)","Retry with a simpler pattern like '*.rs' or a plain substring path","If the model intended everything, an empty glob is auto-treated as '*'"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}