{"record":{"id":"4c2b70b114cabe87","repo":"deepseek-ai/deepseek-harness","slug":"invalid-todos-at-most-one-task-may-be-in-progress","errorCode":null,"errorMessage":"invalid todos: at most one task may be in_progress (got ${active})","messagePattern":"invalid todos: at most one task may be in_progress \\(got (.+?)\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/todo/tool-todo/src/index.ts","lineNumber":108,"sourceCode":" */\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(),\n    status: zod.union([zod.literal('pending'), zod.literal('in_progress'), zod.literal('completed')]),\n  })),\n  zod.null(),\n])\n\n/**\n * Register the `todo_write` tool on `ctx.tools` and, when the session-projection seam is composed,\n * the `todos` unit.\n * @param ctx - registrant context carrying the tool registry.\n * @param config - deployment's explicit todo policy.","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/todo/tool-todo/src/index.ts#L90-L126","documentation":"Error \"invalid todos: at most one task may be in_progress (got ${active})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/todo/tool-todo/src/index.ts:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Mark at most one task in_progress; move the others back to pending."],"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"}