{"record":{"id":"94ea8ae9f4704d8f","repo":"deepseek-ai/deepseek-harness","slug":"pattern-must-be-a-non-empty-string","errorCode":null,"errorMessage":"pattern must be a non-empty string","messagePattern":"pattern must be a non-empty string","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs-search/src/glob.ts","lineNumber":73,"sourceCode":"  timeoutMs: number\n}\n\n/** Validated `glob` arguments. */\nexport interface GlobInput {\n  pattern: string\n  path?: string\n}\n\n/**\n * Validate value constraints the schema DSL can't express: a non-blank\n * `pattern`, and a non-blank `path` when given. Throws a plain `Error` (an\n * ordinary tool argument error) otherwise.\n *\n * @param args - the schema-validated `glob` arguments.\n * @returns the accepted input, unchanged.\n */\nexport function parseGlobArgs(args: { pattern: string; path?: string }): GlobInput {\n  if (args.pattern.trim().length === 0) throw new Error('pattern must be a non-empty string')\n  if (args.path !== undefined && args.path.trim().length === 0) throw new Error('path must be a non-empty string when given')\n  return { pattern: args.pattern, ...args.path !== undefined ? { path: args.path } : {} }\n}\n\n/**\n * Build the fixed `rg --files` argv for one `glob` call. Every\n * model-controlled value ({@link GlobInput.pattern}, {@link GlobInput.path})\n * is a plain argv element — no shell layer exists, so no quoting applies; the\n * search root rides behind `--` so a leading-dash path can never be parsed as\n * a flag. `--sort=modified` orders by modification time, `--no-ignore\n * --hidden` searches ignored and hidden files, and\n * {@link GLOB_VCS_EXCLUDES} keeps VCS metadata out.\n *\n * @param input - the validated arguments.\n * @returns the complete ripgrep argument vector (excluding the binary itself).\n */\nexport function buildGlobCommand(input: GlobInput): string[] {\n  const parts = [","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs-search/src/glob.ts#L55-L91","documentation":"Error \"pattern must be a non-empty string\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs-search/src/glob.ts:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}