deepseek-ai/deepseek-harness · error · HarnessError

GOAL_TOOL_INVALID_UPDATE

GOAL_TOOL_INVALID_UPDATE

Error message

goal_id must be non-empty and revision must be a positive safe integer

What it means

Compare-and-set guard in goalRef building the ref from model-supplied goal tool arguments: goal_id is empty or revision is not a positive safe integer. Fired before the goal service is contacted; the model's arguments are the faulty input.

Solutions

  1. Copy goal_id and revision exactly from a fresh get_goal result
  2. Re-run get_goal if the goal changed since the last read
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/goal/tool-goal/src/index.ts:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/dda799678431dcfc. Report an issue: GitHub.

Appendix: source

Thrown at packages/goal/tool-goal/src/index.ts:148

  }
  return { blockedAfterConsecutiveRounds: blockedAfter }
}

/** Whether optional text is meaningful rather than a strict-schema empty filler. */
function hasText(value: string | undefined): value is string {
  return value !== undefined && value !== ''
}

/** Whether an optional round cap is meaningful rather than a strict-schema zero filler. */
function hasRoundCap(value: number | undefined): value is number {
  return value !== undefined && value !== 0
}

/** Build the exact compare-and-set ref from model arguments. */
function goalRef(goalId: string, revision: number): GoalRef {
  if (goalId.length === 0 || goalId !== goalId.trim()
    || !Number.isSafeInteger(revision) || revision < 1) {
    throw new HarnessError(
      'goal_id must be non-empty and revision must be a positive safe integer',
      'GOAL_TOOL_INVALID_UPDATE',
    )
  }
  return { id: GoalId(goalId), revision }
}

/** Stable compact model result; activation is an observation, not replay state. */
function goalValue(goal: GoalView | undefined): GoalToolValue {
  if (goal === undefined) return { goal: null }
  return {
    goal: {
      id: goal.id,
      revision: goal.revision,
      objective: goal.objective,
      phase: goal.phase,
      roundsStarted: goal.roundsStarted,
      maxGoalRounds: goal.maxGoalRounds,

View on GitHub (pinned to b150a551b8)