{"record":{"id":"52eb82cf6df10b0d","repo":"deepseek-ai/deepseek-harness","slug":"agent-id-id-does-not-match-session-id-agen","errorCode":null,"errorMessage":"agent id \"${id}\" does not match session id \"${agent.session.id}\"","messagePattern":"agent id \"(.+?)\" does not match session id \"(.+?)\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/agent/src/index.ts","lineNumber":477,"sourceCode":"  /**\n   * Insert an already-constructed agent without announcing it. This is the\n   * advanced ordered-lifecycle primitive used by the async agent factory: it\n   * first completes setup while the agent is unpublished, then assigns the\n   * returned detach closure into its pre-installed composite teardown before\n   * calling {@link announce}. Ordinary callers use {@link register}.\n   * @param agent - the prepared, unpublished agent.\n   * @param owner - live agent whose scoped context created this agent, or\n   *   undefined for a top-level runtime root. This is runtime ownership, not\n   *   the resumed session's durable parent lineage.\n   * @returns an idempotent closure that removes this exact entry and emits\n   *   `agent/disposed` with listener failures contained. When called from a\n   *   synchronous `agent/created` listener, removal and disposal wait until\n   *   that creation dispatch unwinds.\n   */\n  enter(agent: Agent, owner: Agent | undefined): () => void {\n    const id = agent.id\n    if (id !== agent.session.id) {\n      throw new Error(`agent id \"${id}\" does not match session id \"${agent.session.id}\"`)\n    }\n    const carrier = scopeTarget(agent, agent)\n    // This is the authoritative collision boundary. Concurrent create/resume\n    // operations may both prepare, but only one exact entry can publish.\n    if (this.store.has(id)) throw new Error(`agent \"${id}\" is already registered`)\n    const entry: AgentEntry = {\n      id,\n      agent,\n      owner,\n      carrier,\n      announced: false,\n      announcing: false,\n      detachRequested: false,\n    }\n    this.store.set(id, entry)\n    let entered = true\n    const detach = (): void => {\n      if (!entered) return","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/agent/src/index.ts#L459-L495","documentation":"Error \"agent id \"${id}\" does not match session id \"${agent.session.id}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/agent/src/index.ts:477 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the agent under an id that matches its session id."],"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"}