{"record":{"id":"303256d0f812f92e","repo":"deepseek-ai/deepseek-harness","slug":"path-must-be-a-non-empty-string-when-given-303256","errorCode":null,"errorMessage":"path must be a non-empty string when given","messagePattern":"path must be a non-empty string when given","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs-search/src/grep.ts","lineNumber":92,"sourceCode":"    else if (char === '}') braceDepth = Math.max(0, braceDepth - 1)\n    else if (char === ',' && braceDepth === 0) {\n      throw new Error('include must be one glob, not a comma-separated list (use {a,b} alternation instead)')\n    }\n  }\n}\n\n/**\n * Validate value constraints the schema DSL can't express: a non-EMPTY\n * `pattern` (whitespace is a legitimate regex), a non-blank `path` when given,\n * and a single positive `include` glob ({@link GrepInput}). Throws a plain\n * `Error` (an ordinary tool argument error) otherwise.\n *\n * @param args - the schema-validated `grep` arguments.\n * @returns the accepted input, unchanged.\n */\nexport function parseGrepArgs(args: { pattern: string; path?: string; include?: string }): GrepInput {\n  if (args.pattern.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  if (args.include !== undefined) validateInclude(args.include)\n  return {\n    pattern: args.pattern,\n    ...args.path !== undefined ? { path: args.path } : {},\n    ...args.include !== undefined ? { include: args.include } : {},\n  }\n}\n\n/**\n * Build the fixed line-oriented `rg --json` argv for one `grep` call. Every\n * model-controlled value ({@link GrepInput.pattern}, {@link GrepInput.path},\n * {@link GrepInput.include}) is a plain argv element — no shell layer exists,\n * so no quoting applies; the pattern and include ride in `--flag=value` form\n * and the target behind `--`, so a leading-dash value can never be parsed as\n * a flag.\n *\n * @param input - the validated arguments.\n * @returns the complete ripgrep argument vector (excluding the binary itself).","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs-search/src/grep.ts#L74-L110","documentation":"Error \"path must be a non-empty string when given\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs-search/src/grep.ts:92 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"}