{"record":{"id":"f1aed9e382324289","repo":"deepseek-ai/deepseek-harness","slug":"file-path-must-be-a-non-empty-string-f1aed9","errorCode":null,"errorMessage":"file_path must be a non-empty string","messagePattern":"file_path must be a non-empty string","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs/src/write.ts","lineNumber":26,"sourceCode":"import type { Context } from '@deepseek-ai/cordis'\nimport { defineTool } from '@deepseek-ai/dsh-tools'\nimport type { DiffCallView, DiffResultView, ToolResult } from '@deepseek-ai/dsh-tools'\nimport type { FsWriteOutcome } from '@deepseek-ai/dsh-fs'\nimport type {} from '@deepseek-ai/dsh-fs'\nimport type {} from '@deepseek-ai/dsh-system-prompt'\nimport { computeHunkDiffs, diffsFromMeta } from './diff.ts'\nimport { remediateFsError } from './error.ts'\nimport { sessionResolveOptions } from './session-cwd.ts'\nimport type { FsSandboxController } from './sandbox.ts'\n\n/**\n * Validate value constraints the schema DSL can't express: only a non-blank\n * `file_path` — an empty `content` is legitimate (it writes an empty file).\n * @param args - the schema-validated raw tool arguments.\n * @returns the camelCased input; `content` passes through untouched.\n */\nexport function parseWriteArgs(args: { file_path: string; content: string }): { filePath: string; content: string } {\n  if (args.file_path.trim().length === 0) throw new Error('file_path must be a non-empty string')\n  return { filePath: args.file_path, content: args.content }\n}\n\n/**\n * Format a write outcome as one model-facing text block body.\n * @param displayPath - the backend-resolved path rendered in the envelope's `<path>` element.\n * @param outcome - the write outcome; its `operation` selects the Created/Updated wording.\n * @returns the model-facing confirmation envelope (no file content is echoed back).\n */\nexport function formatWriteOutput(displayPath: string, outcome: Pick<FsWriteOutcome, 'operation'>): string {\n  const verb = outcome.operation === 'create' ? 'Created' : 'Updated'\n  return `<path>${displayPath}</path>\n<type>file</type>\n<content>\n${verb} file\n</content>`\n}\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs/src/write.ts#L8-L44","documentation":"Error \"file_path must be a non-empty string\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs/src/write.ts:26 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"}