{"record":{"id":"60e738def85c9114","repo":"deepseek-ai/deepseek-harness","slug":"agent-id-is-already-registered","errorCode":null,"errorMessage":"agent \"${id}\" is already registered","messagePattern":"agent \"(.+?)\" is already registered","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/agent/src/index.ts","lineNumber":482,"sourceCode":"   * 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\n      entered = false\n      // Every callback reached by this creation dispatch must observe the same\n      // live entry, and disposal must follow creation. A listener may own\n      // the advanced detach capability, so make that ordering structural:\n      // visibility and the paired disposal are deferred until announce()'s","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/agent/src/index.ts#L464-L500","documentation":"Error \"agent \"${id}\" is already registered\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/agent/src/index.ts:482 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a unique agent id or unregister the existing agent first."],"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"}