{"record":{"id":"669766fbdff8c75c","repo":"deepseek-ai/deepseek-harness","slug":"goal-already-exists","errorCode":"GOAL_ALREADY_EXISTS","errorMessage":"goal \"${current.id}\" already exists with phase \"${current.phase}\"","messagePattern":"goal \"(.+?)\" already exists with phase \"(.+?)\"","errorType":"exception","errorClass":"GoalError","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/index.ts","lineNumber":256,"sourceCode":"    const cache = this.cache(agent.session)\n    this.sync(agent.session, cache)\n    cache.activation = 'disarmed'\n    return this.view(cache)\n  }\n\n  /**\n   * Create and arm a goal. A completed goal may be replaced; every other\n   * current phase must be cleared or resumed instead.\n   * @param agent - owning live agent.\n   * @param request - objective and optional round cap.\n   * @returns the created live view.\n   */\n  create(agent: Agent, request: CreateGoalRequest): GoalView {\n    const spec = resolveCreateGoal(request, this.resolved.defaultMaxGoalRounds)\n    const cache = this.prepareMutation(agent)\n    const current = cache.state.goal\n    if (current !== undefined && current.phase !== 'complete') {\n      throw new GoalError(`goal \"${current.id}\" already exists with phase \"${current.phase}\"`, 'GOAL_ALREADY_EXISTS')\n    }\n    const now = Date.now()\n    const goal: GoalSnapshot = {\n      id: GoalId(`goal-${randomUUID()}`),\n      revision: 1,\n      objective: spec.objective,\n      phase: 'active',\n      maxGoalRounds: spec.maxGoalRounds,\n    }\n    return this.commitSnapshot(agent, cache, 'create', goal, 0, now, now, 'armed')\n  }\n\n  /**\n   * Edit objective and/or round cap without changing phase.\n   * @param agent - owning live agent.\n   * @param ref - expected current revision.\n   * @param request - at least one replacement field.\n   * @returns the edited view.","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/index.ts#L238-L274","documentation":"Error \"goal \"${current.id}\" already exists with phase \"${current.phase}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/index.ts:256 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"}