{"record":{"id":"e0a35cb406351d66","repo":"deepseek-ai/deepseek-harness","slug":"agents-firstid-and-id-use-duplicate-exac","errorCode":null,"errorMessage":"agents \"${firstId}\" and \"${id}\" use duplicate exact session identity \"${exactIdentity}\"","messagePattern":"agents \"(.+?)\" and \"(.+?)\" use duplicate exact session identity \"(.+?)\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/agent-loop/src/index.ts","lineNumber":289,"sourceCode":"  })[]\n}\n\n/** Agent-loop configuration after defaults and load-time validation. */\ntype ResolvedConfig = Config & { maxParallelToolCalls: number }\n\n/** Reject self-contained identity conflicts before any configured agent starts. */\nfunction validateConfiguredAgents(agents: Config['agents']): void {\n  const exactIdentities = new Map<SessionId, string>()\n  for (const { id, sessionId, resumeSessionId } of agents) {\n    const hasResumeId = resumeSessionId !== undefined && resumeSessionId !== ''\n    if (sessionId !== undefined && hasResumeId) {\n      throw new Error(`agent \"${id}\": sessionId and resumeSessionId are mutually exclusive`)\n    }\n    const exactIdentity = hasResumeId ? resumeSessionId : sessionId\n    if (exactIdentity === undefined) continue\n    const firstId = exactIdentities.get(exactIdentity)\n    if (firstId !== undefined) {\n      throw new Error(`agents \"${firstId}\" and \"${id}\" use duplicate exact session identity \"${exactIdentity}\"`)\n    }\n    exactIdentities.set(exactIdentity, id)\n  }\n}\n\n/** Concrete agent factory and driver service. */\nexport class AgentLoop extends Service implements AgentFactory {\n  static inject = ['agents', 'sessions', 'llm', 'tools', 'systemPrompt']\n\n  /** Runtime schema for declarative agents. */\n  static Config = z.object({\n    maxParallelToolCalls: z.number().step(1).min(1).default(DEFAULT_MAX_PARALLEL_TOOL_CALLS),\n    agents: z.array(z.object({\n      id: z.string().required(),\n      sessionId: z.string().min(1),\n      provider: z.string(),\n      model: z.string(),\n      maxTokens: z.number().step(1).min(1).max(Number.MAX_SAFE_INTEGER),","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/agent-loop/src/index.ts#L271-L307","documentation":"Error \"agents \"${firstId}\" and \"${id}\" use duplicate exact session identity \"${exactIdentity}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/agent-loop/src/index.ts:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give each agent a distinct exact session identity."],"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"}