{"record":{"id":"4b32c41cc4907153","repo":"deepseek-ai/deepseek-harness","slug":"goal-tool-driver-required","errorCode":"GOAL_TOOL_DRIVER_REQUIRED","errorMessage":"goal tools require an open model turn","messagePattern":"goal tools require an open model turn","errorType":"error_code","errorClass":"HarnessError","httpStatus":null,"severity":"error","filePath":"packages/goal/tool-goal/src/authority.ts","lineNumber":26,"sourceCode":"import type { ToolRunContext } from '@deepseek-ai/dsh-tools'\n\ntype TurnStartEvent = Extract<SessionEvent, { type: 'turn/start' }>\n\n/** Current open turn plus the events accepted after its start boundary. */\nexport interface GoalToolExecution {\n  readonly agent: Agent\n  readonly start: TurnStartEvent\n  readonly events: readonly SessionEvent[]\n}\n\n/** Hard authority granted to one state-changing call. */\nexport type GoalToolAuthority =\n  | { readonly kind: 'direct-human' }\n  | { readonly kind: 'goal-round'; readonly goal: GoalView }\n\n/** Throw one structured tool-policy failure. */\nfunction reject(message: string, code = 'GOAL_TOOL_AUTHORITY_REQUIRED'): never {\n  throw new HarnessError(message, code)\n}\n\n/** Locate the open turn enclosing a model tool call. */\nfunction openTurn(agent: Agent): { start: TurnStartEvent; events: readonly SessionEvent[] } {\n  const events = agent.session.events\n  for (let index = events.length - 1; index >= 0; index -= 1) {\n    const boundary = events[index]\n    if (boundary?.type === 'turn/end') {\n      reject('goal tools require an open model turn', 'GOAL_TOOL_DRIVER_REQUIRED')\n    }\n    if (boundary?.type === 'turn/start') {\n      return { start: boundary, events: events.slice(index + 1) }\n    }\n  }\n  return reject('goal tools require an open model turn', 'GOAL_TOOL_DRIVER_REQUIRED')\n}\n\n/**","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/tool-goal/src/authority.ts#L8-L44","documentation":"Error \"goal tools require an open model turn\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/tool-goal/src/authority.ts:26 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"}