{"record":{"id":"2389c4ecd5814ce5","repo":"deepseek-ai/deepseek-harness","slug":"agent-presets-preset-presetid-already-exists-2389c4","errorCode":null,"errorMessage":"agent-presets: preset \"${presetId}\" already exists — a copy never overwrites; delete the existing preset first or choose another id","messagePattern":"agent-presets: preset \"(.+?)\" already exists — a copy never overwrites; delete the existing preset first or choose another id","errorType":"exception","errorClass":"PresetExistsError","httpStatus":null,"severity":"error","filePath":"packages/preset/agent-presets/src/index.ts","lineNumber":386,"sourceCode":"   * Copy is the only authoring write. Composition text never crosses this\n   * seam: the source is named by id and its directory is copied as it stands,\n   * so the copy is exactly as loadable as its source and authoring grants no\n   * capability the roster did not already carry. The copy is NOT mounted to\n   * validate — a source that mounts today yields a copy that mounts today.\n   * @param from - the preset the copy starts from; shipped presets are the\n   * primary source, so any trust is accepted.\n   * @param id - the new preset's id, which becomes its directory name.\n   * @param name - display name for the copy; absent falls back to the id.\n   * @throws when the source is unknown, the id is unusable or already taken,\n   * or the deployment configures no writable root.\n   */\n  async copy(from: string, id: string, name?: string): Promise<void> {\n    const source = await this.resolve(from)\n    // The roster check refuses ids any root supplies — shipped ones included,\n    // since a user directory named like a shipped preset is shadowed by it.\n    // The disk check inside copyComposition only sees the writable root.\n    if ((await this.list()).some(preset => preset.id === id)) {\n      throw new PresetExistsError(id)\n    }\n    await copyComposition(this.resolvedRoots, source, id, name)\n    // A settled mount under this id can only be stale (its preset was deleted\n    // from disk outside `remove`); the new preset must not inherit it. Every\n    // session already joined keeps the generation it runs on regardless.\n    this.standing.delete(id)\n  }\n\n  /**\n   * Delete a locally authored preset.\n   * @param id - the preset id.\n   * @throws when the preset is unknown or ships with the deployment.\n   */\n  async remove(id: string): Promise<void> {\n    await deleteComposition(this.resolvedRoots, await this.resolve(id))\n    // Sessions on the deleted preset keep their standing mount; only new\n    // sessions see the roster without it.\n    this.standing.delete(id)","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/preset/agent-presets/src/index.ts#L368-L404","documentation":"Error \"agent-presets: preset \"${presetId}\" already exists — a copy never overwrites; delete the existing preset first or choose another id\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/preset/agent-presets/src/index.ts:386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the existing preset first, or choose another 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"}