{"record":{"id":"1ea36a013cb7e414","repo":"deepseek-ai/deepseek-harness","slug":"invalid-todo-content-must-be-a-non-empty-string","errorCode":null,"errorMessage":"invalid todo: `content` must be a non-empty string","messagePattern":"invalid todo: `content` must be a non-empty string","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/todo/tool-todo/src/index.ts","lineNumber":98,"sourceCode":"/**\n * Validate the value constraints the ParameterSchemaSpec can't express and build the canonical {@link\n * TodoItem}[]: trimmed non-empty unique content, and at most one `in_progress` item unless the\n * deployment allows parallel work. The registry has already enforced the status enum and rejected\n * unknown item keys (`additionalProperties: false` — the logged snapshot must equal what the model\n * believes it wrote, so a nested/extended item shape fails loud at the schema boundary instead of\n * silently flattening); the cast below records that guarantee.\n * @param raw - the model-supplied list, already schema-checked.\n * @param allowParallel - whether several items may be `in_progress` at once.\n * @returns the canonical list.\n */\nfunction toTodoList(raw: { content: string; status: string }[], allowParallel: boolean): TodoItem[] {\n  const todos: TodoItem[] = []\n  const seen = new Set<string>()\n  let active = 0\n  for (const item of raw) {\n    const content = item.content.trim()\n    if (content.length === 0) {\n      throw new Error('invalid todo: `content` must be a non-empty string')\n    }\n    if (seen.has(content)) {\n      throw new Error(`invalid todos: duplicate content ${JSON.stringify(content)}`)\n    }\n    seen.add(content)\n    if (item.status === 'in_progress') active++\n    todos.push({ content, status: item.status as TodoItem['status'] })\n  }\n  if (!allowParallel && active > 1) {\n    throw new Error(`invalid todos: at most one task may be in_progress (got ${active})`)\n  }\n  return todos\n}\n\n/** Wire payload schema of the `todos` projection (whole list or pre-first-write null). */\nconst todosProjectionSchema: ZodType<TodoItem[] | null> = zod.union([\n  zod.array(zod.object({\n    content: zod.string(),","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/todo/tool-todo/src/index.ts#L80-L116","documentation":"Error \"invalid todo: `content` must be a non-empty string\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/todo/tool-todo/src/index.ts:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give every todo a non-empty content string."],"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"}