{"record":{"id":"02e7a8cf3af8eba9","repo":"deepseek-ai/deepseek-harness","slug":"session-id-already-exists","errorCode":null,"errorMessage":"session \"${id}\" already exists","messagePattern":"session \"(.+?)\" already exists","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/index.ts","lineNumber":918,"sourceCode":"   * cross-package primitives and a caller may interleave arbitrary work (or\n   * another create) between them, so a stale prepared session must NOT overwrite\n   * a live store entry of the same id — its detach disposer would later delete\n   * the REAL session. The {@link create} convenience and the agent factory call\n   * the two back-to-back so they never trip this, but the public API cannot\n   * assume that.\n   *\n   * @param session - a {@link prepare}d session not yet in the store.\n   * @returns the detach disposer (publication hooks + store removal). When called from\n   *   a synchronous `session/created` listener, removal and disposal wait until\n   *   that creation dispatch unwinds.\n   * @throws if a session with this id is already in the store.\n   */\n  enter(session: Session): () => void {\n    const id = session.id\n    const carrier = scopeTarget(session, scopeOf(this.ctx))\n    // This is the authoritative collision boundary after arbitrary unpublished\n    // preparation. Only one exact same-id transaction can publish.\n    if (this.store.has(id)) throw new Error(`session \"${id}\" already exists`)\n    if (attachments.has(session)) throw new Error(`session \"${id}\" is already attached to a store`)\n    const entry: SessionEntry = {\n      id,\n      session,\n      carrier,\n      emitCtx: this.ctx,\n      announced: false,\n      announcing: false,\n      appending: false,\n      detachRequested: false,\n      detach: () => { this.detachEntered(entry) },\n    }\n    this.store.set(id, entry)\n    attachments.set(session, entry)\n    let entered = true\n    const detach = (): void => {\n      if (!entered) return\n      entered = false","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/index.ts#L900-L936","documentation":"Error \"session \"${id}\" already exists\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/session/src/index.ts:918 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"}